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.
This commit is contained in:
misuzu 2024-09-15 21:48:27 +03:00 committed by GitHub
parent d33b553400
commit 4c1d53818b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -496,6 +496,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
@ -515,15 +521,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`.
Use your declared user account to log in.
If you didnt declare one, you should still be able to log in using the `root` user.
You'll probably want to create some user accounts as well, which can
be done with `useradd`:
```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).