User and root
There are two sections related to users and authentication in an Agama profile:
root: allows to set the authentication mechanism for therootuser.user: defines a "first user".
For a successful installation, one of the following conditions must be met:
- A password or an SSH public key is defined for the
rootuser. - A first user is defined.
root user
The root section allows to specify an authentication method for the root user.
{
root: {
sshPublicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPj/J1N38v/7Gbxz5A6jiSBhLbUwrJOVlBxDQhuW8tvg user@example.net",
hashedPassword: true,
password: "$y$j9T$qGMrxRmEHUV3kCXQAywcP1$g4n4.O2tUf2Dq9CJTohTb4/HJ9Wdzr2Z33MD8srkPV1"
}
}
The following fields are supported:
password:rootpassword, hashed or not depending onhashedPassword.hashedPassword: whether thepasswordis hashed (true) or not (falseor undefined).sshPublicKey: SSH public key to be copied to the/root/.ssh/authorized_keysfile.
First user
The user section defines a first user:
{
user: {
fullName: "Jane Doe",
userName: "jane.doe",
hashedPassword: false,
password: "123456"
}
}
This section includes the following fields:
userName: user name (or login name).fullName: user's full name.password:rootpassword, hashed or not depending onhashedPassword.hashedPassword: whether thepasswordis hashed (true) or not (falseor undefined).
Encrypted passwords
The encrypted password can be obtained by running the mkpasswd command from the whois package.
To get the list of supported hashing methods run the mkpasswd --method=help command. Then use the
selected method for hashing your password, for example mkpasswd --method=yescrypt.
Make sure the selected hashing method is supported by the target system, different systems might support different set of methods.
Do not use any DES or MD5 based algorithms, these are considered insecure. Check man 5 crypt
manual page for details about the hashing methods and their strength.
Alternatively you can use the openssl passwd -6 command. This generates a SHA-512 password hash,
for the SHA-256 method use the -5 option.