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

Support non-interactive password authentication with sshpass #305

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

a-kenji
Copy link
Contributor

@a-kenji a-kenji commented Apr 23, 2024

Allow setting the bootstrap password on invocation of nixos-anywhere.

This makes use of the sshpass program, to provide ssh-copy-id with the password.

The runtimeDeps change in the following way:

sshpass: ∅ → 1.10, +29.5 KiB

Improves the usage especially together with the iso image installers of nixos-images.

src/nixos-anywhere.sh Outdated Show resolved Hide resolved
@a-kenji a-kenji force-pushed the add-password branch 2 times, most recently from 1ec533e to 74d16ec Compare April 23, 2024 09:52
Allow setting the bootstrap password on invocation of
`nixos-anywhere`.

This makes use of the `sshpass` program, to provide `ssh-copy-id` with
the password.

The `runtimeDeps` change in the following way:

sshpass: ∅ → 1.10, +29.5 KiB

Improves the usage especially together with the iso image installers of `nixos-images`.
@Lassulus Lassulus merged commit 5f06770 into nix-community:main Apr 23, 2024
23 checks passed
@a-kenji a-kenji deleted the add-password branch April 23, 2024 10:29
@Mic92 Mic92 changed the title feat: add copy-password Support non-interactive password authentication with sshpass Apr 30, 2024
@malteneuss
Copy link

So when we create a new virtual machine that has a predefined user password (i'm planning of trying out Hetzner), instead of logging-in manually and adding our local ssh key into the VM's authorized_keys file to be able to login, we can just use something along the lines of

SSH_PASS=<vm-password> nixos-anywhere --env-password <user>@<ip>...

directly?

That would be/is a great quality of life improvement!

@a-kenji
Copy link
Contributor Author

a-kenji commented Apr 30, 2024

Yes, that was the motivation, though I haven't tested it yet with hetzner.
I have tested it with the nixos-images so far.
I would be happy to get feedback about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants