Skip to content

Commit

Permalink
[Backport release-24.05] nixos/doc: update Installing section (#342125
Browse files Browse the repository at this point in the history
)

nixos/doc: update `Installing` section (#341995)

Mention how to set a user password right after installation.
Also don't suggest to use `useradd` to add users.

(cherry picked from commit 4c1d538)

Co-authored-by: misuzu <[email protected]>
  • Loading branch information
github-actions[bot] and misuzu committed Sep 15, 2024
1 parent 4a34a6f commit 19adb98
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions nixos/doc/manual/installation/installing.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,12 @@ Use the following commands:
Retype new password: ***
```

If you have a user account declared in your `configuration.nix` and plan to log in using this user, set a password before rebooting, e.g. for the `alice` user:

```ShellSession
# nixos-enter --root /mnt -c 'passwd alice'
```

::: {.note}
For unattended installations, it is possible to use
`nixos-install --no-root-passwd` in order to disable the password
Expand All @@ -519,15 +525,13 @@ Use the following commands:
menu. This allows you to easily roll back to a previous
configuration if something goes wrong.

You should log in and change the `root` password with `passwd`.

You'll probably want to create some user accounts as well, which can
be done with `useradd`:
Use your declared user account to log in.
If you didn’t declare one, you should still be able to log in using the `root` user.

```ShellSession
$ useradd -c 'Eelco Dolstra' -m eelco
$ passwd eelco
```
::: {.note}
Some graphical display managers such as SDDM do not allow `root` login by default, so you might need to switch to TTY.
Refer to [](#sec-user-management) for details on declaring user accounts.
:::

You may also want to install some software. This will be covered in
[](#sec-package-management).
Expand Down

0 comments on commit 19adb98

Please sign in to comment.