Expanded user section

This commit is contained in:
Tastatur 2023-12-28 16:04:13 +01:00
parent 36a92dc3d0
commit 4ffb056a67

View file

@ -29,10 +29,16 @@ And create a `_power` group for user's to be able to poweroff the system without
Adding a user in alpine can be done using the `setup-user` script. Here we can specify the name, fullname, groups and more:
```
# setup-user -g wheel,plugdev,_seatd,nix -f <"Full Name"> <username>
# setup-user -g wheel,plugdev,_seatd,nix,_power -f "<Full Name>" <username>
# passwd <username>
```
And you (might) have to change the shell of the user in `/etc/passwd` from `/sbin/nologin` to a shell from `/etc/shells`. Alpine Linux comes with `/bin/ash` by default:
```
<username>:x:1234:1234:<Full Name>:/home/<username>:/bin/<shell>
```
> It's also recommended to have an "admin" account which is the only one in the wheel group.
Don't login yet if you want to encrypt the directory.
@ -85,11 +91,25 @@ Encrypt the directory with:
```
# fscrypt encrypt /home/<username> --user=<username>
[Enter 1 so that it's unlocks when the user logs in]
[Create a new login protector]
[Enter 1 so that it unlocks the directory when the user logs in]
```
Then login with the user to check if it worked. It should also have given you a recovery password which should be stored somewhere safely (like Bitwarden). To check the status of the directory run:
Then reboot and login with the user to check if it worked. It should also have given you a recovery password which should be stored somewhere safely (like Bitwarden). To check the status of the directory run:
```
$ fscrypt status /home/<username>
```
## TLDR
If you have already set up a system with a user but want to add another do this:
```
# setup-user -g (wheel,)plugdev,_seatd,nix,_power -f "<Full Name>" <username>
# passwd <username>
[Change shell in /etc/passwd]
# fscrypt encrypt /home/<username> --user=<username>
[Create a new login protector]
[Enter 1 so that it unlocks the directory when the user logs in]
```