Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deployment.keys.*.user/group need to be sent after activation #232

Closed
rbvermaa opened this issue Oct 1, 2014 · 11 comments
Closed

deployment.keys.*.user/group need to be sent after activation #232

rbvermaa opened this issue Oct 1, 2014 · 11 comments
Labels

Comments

@rbvermaa
Copy link
Member

rbvermaa commented Oct 1, 2014

Otherwise deployments fail on initial deployments.

@aaronlevin
Copy link

@rbvermaa is this what is causing my deployment to end with:

error: unable to start SSH master connection to ‘root@130.211.108.123’

?

@rened
Copy link

rened commented Nov 14, 2014

@aaronlevin did you find a work-around for this? EC2 deployments work fine for me, but container deployments fail with this error.

@rbvermaa
Copy link
Member Author

The mentioned error is not the error that would show up with this issue.

@rbvermaa
Copy link
Member Author

@rened I am not 100% sure, but it might be the ssh connection (as root) to the server where the containers are running.

@rened
Copy link

rened commented Nov 14, 2014

Thanks a lot @rbvermaa, that fixed it! I was not aware that also for deployments to a container on localhost a ssh login to root@localhost would be required - adding my key to users.extraUsers.root.openssh.authorizedKeys fixed it.

I would like to add instructions for this for newcomers like me, would example/trivial-container.nix be a good place?

And thanks a lot for all your work on nixops - it is one of the coolest things I have ever seen.

@rbvermaa
Copy link
Member Author

I don't think the container backend is described yet in the manual, which would be the best place to put any documentation. We should probably also improve the error message in this particular situation.

@rened
Copy link

rened commented Nov 14, 2014

Ok, I'll draft a little section for the manual then, just walking thought the trivial-container.nix example.

@rbvermaa
Copy link
Member Author

@rened Awesome! Very much appreciated!

@philandstuff
Copy link

I have an issue where if I set deployment.keys."foo".user, and a nixos module is responsible for creating this user in a users.extraUsers expression, then the deployment fails because it tries to chown the key before creating the user. Is this the same issue, or should I file a new one?

@aszlig
Copy link
Member

aszlig commented Dec 8, 2015

This should be related to #362.

@aszlig aszlig added the bug label Dec 8, 2015
ryanartecona added a commit to ryanartecona/nixops that referenced this issue Feb 25, 2016
Instead of chowning keys to their user/group every time they are sent,
only attempt the chown during send-keys if the user and group both
exist, and again do a chown during activation after the users and groups
have been created.

One result is that if a key and its user and/or group are to be created
in the same `nixops deploy`, the key will first be uploaded and owned
by root:root, then chmod'd, then late in activation the key will be
chowned to the newly created user/group. This includes a node's first
deploy, when it has neither keys nor users/groups.

Another result is that between send-keys and the next deploy (often,
but not necessarily, in the same `nixops deploy`), a key may
have its permissions set as configured, but _not_ be owned by the
configured user/group (instead root:root), which is presumed safe.

fixes NixOS#362, fixes NixOS#232
ryanartecona added a commit to ryanartecona/nixops that referenced this issue Feb 26, 2016
Instead of chowning keys to their user/group every time they are sent,
only attempt the chown during send-keys if the user and group both
exist, and again do a chown during activation after the users and groups
have been created.

One result is that if a key and its user and/or group are to be created
in the same `nixops deploy`, the key will first be uploaded and owned
by root:root, then chmod'd, then late in activation the key will be
chowned to the newly created user/group. This includes a node's first
deploy, when it has neither keys nor users/groups.

Another result is that between send-keys and the next deploy (often,
but not necessarily, in the same `nixops deploy`), a key may
have its permissions set as configured, but _not_ be owned by the
configured user/group (instead root:root), which is presumed safe.

fixes NixOS#362, fixes NixOS#232
@domenkozar
Copy link
Member

See #400

ryanartecona added a commit to ryanartecona/nixops that referenced this issue Jun 24, 2016
Instead of chowning keys to their user/group every time they are sent,
only attempt the chown during send-keys if the user and group both
exist, and again do a chown during activation after the users and groups
have been created.

One result is that if a key and its user and/or group are to be created
in the same `nixops deploy`, the key will first be uploaded and owned
by root:root, then chmod'd, then late in activation the key will be
chowned to the newly created user/group. This includes a node's first
deploy, when it has neither keys nor users/groups.

Another result is that between send-keys and the next deploy (often,
but not necessarily, in the same `nixops deploy`), a key may
have its permissions set as configured, but _not_ be owned by the
configured user/group (instead root:root), which is presumed safe.

fixes NixOS#362, fixes NixOS#232
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants