Giter Club home page Giter Club logo

Comments (5)

ilmanzo avatar ilmanzo commented on May 25, 2024

Looking at it , I think it needs a bit of redesign, because the user home directory is involved also in the ssh key creation:

const initScript = `
set -e
rm -f /run/nologin
sshdir=/root/.ssh
mkdir $sshdir; chmod 700 $sshdir
touch $sshdir/authorized_keys; chmod 600 $sshdir/authorized_keys
`

and

publicKey, err := c.publicKey()
if err != nil {
	return err
}
if err := copy(name, publicKey, "/root/.ssh/authorized_keys"); err != nil {
	return err
}

from footloose.

dlespiau avatar dlespiau commented on May 25, 2024

yes, you are right! I think there are two different things:

  1. Allow the creation of arbitrary users when creating the container (this idea wasn't really properly captured yet, filed #43)
  2. The syntax of the ssh command (which is the subject of this issue and is a much smaller change). I believe the ssh command syntax should follow what the real ssh does:
$ footloose ssh node0
-> try to login with the current user

$ footloose ssh root@node0
-> try to login with the root user

Of course the first thing will not work until we can provision new users into the containers.

There is a detail that needs to be taken into consideration as well: it'd be great to be able to mirror the current user inside the container (name, id, gid) so we can mount part of the filesystem in the container and still end up with the right id/gid for the files we create from inside the container: #11.

from footloose.

dlespiau avatar dlespiau commented on May 25, 2024

Just to be clear, I think it's fine to just address the point 2. above separately from the more general problem of user creation.

from footloose.

dlespiau avatar dlespiau commented on May 25, 2024

We could also say that user provisioning is not the domain of machine creation and is best left to other tools such as ansible. We could still install the ssh key for the root user tough, to bootstrap the other tools.

That may be fair game.

from footloose.

dlespiau avatar dlespiau commented on May 25, 2024

Fixed by #44

from footloose.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.