Skip to content

Commit 9584f86

Browse files
sedlundmergify[bot]
authored andcommitted
docs: correct SSHPASS variable and improve clarity
1 parent 1933f2e commit 9584f86

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

docs/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Options:
1717
print full build logs
1818
* --env-password
1919
set a password used by ssh-copy-id, the password should be set by
20-
the environment variable SSH_PASS
20+
the environment variable SSHPASS
2121
* -s, --store-paths <disko-script> <nixos-system>
2222
set the store paths to the disko-script and nixos-system directly
2323
if this is given, flake is not needed

docs/quickstart.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ You will need:
2121
performed
2222
- A disk configuration containing details of the file system that will be
2323
created on the new server.
24-
- A target machine, reachable via SSH, with your SSH public key deployed and the
25-
privilege to either login directly as root or to use password-less sudo.
24+
- A target machine that is reachable via SSH, either using keys or a password,
25+
and the privilege to either log in directly as root or a user with
26+
password-less sudo.
2627

2728
**nixos-anywhere** doesn’t need to be installed. You can run it directly from
2829
[the Github repository.](https://github.com/nix-community/nixos-anywhere)
@@ -103,14 +104,14 @@ below.
103104
simply reference your local directory when you run **nixos-anywhere**. This
104105
example uses a local directory on the source machine.
105106

106-
6. On the target machine, make sure you have access as root via ssh by adding
107-
your SSH key to the file `authorized_keys` in the directory `/root/.ssh`
107+
6. **Connectivity to the Target Machine**:
108108

109-
Optionally, bootstrapping can also be performed through password login. For
110-
example through the `image-installer-*` provided by
111-
`nix-community/nixos-images`. Assign your password to the `SSH_PASS`
112-
environment variable and specify `--env-password` as an additional command
113-
line option. This will provide `ssh-copy-id` with the required password.
109+
**nixos-anywhere** will create a temporary SSH key to use for the
110+
installation. If your SSH key is not found, you will be asked for your
111+
password. If you are using a non-root user, you must have access to sudo
112+
without a password. To avoid SSH password prompts, set the `SSHPASS`
113+
environment variable to your password and add `--env-password` to the
114+
`nixos-anywhere` command.
114115

115116
7. (Optional) Test your nixos and disko configuration:
116117

src/nixos-anywhere.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Options:
1919
print full build logs
2020
* --env-password
2121
set a password used by ssh-copy-id, the password should be set by
22-
the environment variable SSH_PASS
22+
the environment variable SSHPASS
2323
* -s, --store-paths <disko-script> <nixos-system>
2424
set the store paths to the disko-script and nixos-system directly
2525
if this is given, flake is not needed

0 commit comments

Comments
 (0)