Skip to content

Login Passwords

Login passwords are kept as hashes in secrets/passwords.yaml; see the Secrets concept for the trust model behind them.

You can set a user’s login password with just set-password. The command prompts for the password, hashes it with mkpasswd, and writes the encrypted value into secrets/passwords.yaml:

Terminal window
just set-password alice

The file maps each user name to that password hash, so it never carries a password in clear text:

secrets/passwords.yaml
alice: $y$j9T$…

You can verify a password against the stored hash, without decrypting it into view, with:

Terminal window
just verify-password alice

To make a host apply these passwords, point passwords.secrets at the file in its configuration. Each user the file names then takes their hash as their users.users.<name>.hashedPasswordFile:

hosts/example/default.nix
passwords.secrets = ../../secrets/passwords.yaml;