sudo EDITOR=vim visudo
Change this line:
-%sudo ALL=(ALL:ALL) ALL
+%sudo ALL=NOPASSWD: ALL
Create some groups that the user should belong to. These are normally created
when installing packages, but you might not have done that yet. Note that
addgroup
will print a warning if the groups already exist.
sudo addgroup --system docker
sudo addgroup --system libvirt
NEWUSER=⟪NAME⟫
If you want, you can create a ZFS dataset for the user's home directory.
zfs create rpool/home/$NEWUSER
find /etc/skel -mindepth 1 -maxdepth 1 -exec cp -av {} /home/$NEWUSER \;
sudo adduser --disabled-password --no-create-home $NEWUSER
chown -R $NEWUSER:$NEWUSER /home/$NEWUSER
Otherwise, to create a normal home directory:
sudo adduser --disabled-password $NEWUSER
Then, add the user to some groups:
sudo usermod --append --groups docker,libvirt,sudo,systemd-journal $NEWUSER
sudo passwd $NEWUSER
This authorizes the keys that a user has on GitHub, which can be convenient:
sudo -i -u $NEWUSER
mkdir -m 700 -p .ssh
curl https://github.com/⟪USER⟫.keys | tee -a .ssh/authorized_keys