Table of contents
I keep forgetting and googling the stuff I need to set up my VMs. Right now I’m setting up Klipper again, so these commands are suddenly relevant again.
Users
A new user
sudo adduser <username>Add them to sudo
sudo usermod -aG sudo <username>Sudo without a password
sudo visudo
# At the very bottom of the file<username> ALL=(ALL) NOPASSWD: ALLSSH
Generating a key
ssh-keygen -f ~/.ssh/<filename> -t ed25519Copying the key over
ssh-copy-id -i ~/.ssh/<filename> <user>@<address>sshd config for key-based login
Open the config itself:
sudo nvim /etc/ssh/sshd_configIn the config:
- Ban root:
PermitRootLogin no- Turn off password login:
PasswordAuthentication no- Disable interactive passwords:
KbdInteractiveAuthentication no- Enable key-based access:
PubkeyAuthentication yesAfter that, restart sshd on the server:
sudo systemctl restart sshdTo make sure password login no longer works, run:
ssh -o PreferredAuthentications=password <user>@<address>You should get back:
<user>@<address>: Permission denied (publickey).Bells and whistles
This is where I’ll keep adding things I like having on a box, either to make work easier or just for the looks.
Starship
curl -sS https://starship.rs/install.sh | sh