Skip to content

Commit

Permalink
docs: correct SSHPASS variable and improve clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
sedlund committed Aug 25, 2024
1 parent 1933f2e commit ec83904
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Options:
print full build logs
* --env-password
set a password used by ssh-copy-id, the password should be set by
the environment variable SSH_PASS
the environment variable SSHPASS
* -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
19 changes: 10 additions & 9 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ You will need:
performed
- A disk configuration containing details of the file system that will be
created on the new server.
- A target machine, reachable via SSH, with your SSH public key deployed and the
privilege to either login directly as root or to use password-less sudo.
- A target machine that is reachable via SSH, either using keys or a password,
and the privilege to either log in directly as root or a user with
password-less sudo.

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

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

Optionally, bootstrapping can also be performed through password login. For
example through the `image-installer-*` provided by
`nix-community/nixos-images`. Assign your password to the `SSH_PASS`
environment variable and specify `--env-password` as an additional command
line option. This will provide `ssh-copy-id` with the required password.
**nixos-anywhere** will create a temporary SSH key to use for the
installation. 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.

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

Expand Down
2 changes: 1 addition & 1 deletion src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Options:
print full build logs
* --env-password
set a password used by ssh-copy-id, the password should be set by
the environment variable SSH_PASS
the environment variable SSHPASS
* -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

0 comments on commit ec83904

Please sign in to comment.