Skip to content

add support for providing sudo passwords via environemnt variables #551

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Options:
print full build logs
* --env-password
set a password used by ssh-copy-id, the password should be set by
the environment variable SSHPASS
the environment variable SSHPASS. Additionally, sudo password can be set
via SUDO_PASSWORD environment variable for remote sudo operations
(only supported with sudo, not doas)
* -s, --store-paths <disko-script> <nixos-system>
set the store paths to the disko-script and nixos-system directly
if this is given, flake is not needed
Expand Down
4 changes: 3 additions & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ example uses a local directory on the source machine.
If your SSH key is not found, you will be asked for your password. If you are
using a non-root user, you must have access to sudo without a password. To avoid
SSH password prompts, set the `SSHPASS` environment variable to your password
and add `--env-password` to the `nixos-anywhere` command. If providing a
and add `--env-password` to the `nixos-anywhere` command. Additionally, if your
target machine requires a sudo password, you can set the `SUDO_PASSWORD`
environment variable (only supported with sudo, not doas). If providing a
specific SSH key through `-i` (identity_file), this key will then be used for
the installation and no temporary SSH key will be created.

Expand Down
4 changes: 3 additions & 1 deletion docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ Options:
print full build logs
* --env-password
set a password used by ssh-copy-id, the password should be set by
the environment variable SSHPASS
the environment variable SSHPASS. Additionally, sudo password can be set
via SUDO_PASSWORD environment variable for remote sudo operations
(only supported with sudo, not doas)
* -s, --store-paths <disko-script> <nixos-system>
set the store paths to the disko-script and nixos-system directly
if this is given, flake is not needed
Expand Down
1 change: 1 addition & 0 deletions src/get-facts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ hasTar=$(has tar)
hasCpio=$(has cpio)
hasSudo=$(has sudo)
hasDoas=$(has doas)
hasPasswordlessSudo=$(if [ "$(has sudo)" = "y" ] && sudo -n true >/dev/null 2>&1; then echo "y"; else echo "n"; fi)
hasWget=$(has wget)
hasCurl=$(has curl)
hasSetsid=$(has setsid)
Expand Down
Loading
Loading