User management
How to rule them all
User commands
Create users
Create a sudo user named mountdoom and set their password
sudo useradd -m -G sudo -s /bin/bash mountdoom
sudo passwd mountdoom
Create a system user named morgul unable to login and without /home directory
sudo useradd -r -s /usr/sbin/nologin morgul
Delete users
Delete a regular user bombadil, along with their group and home directory
sudo userdel -r bombadil && sudo groupdel bombadil
SSH key authentification
Connect passwordless from a client to remote.ip.address in a terminal using key pairs as authentification
Creating and storing keys
On the client, create a pair of public/private named keys of high KDF rounds
ssh-keygen -t ed25519 -a 100 -f ~/.ssh/mordor
Copy this key to the remote device; mountdoom user must already exist on the remote
ssh-copy-id -i ~/.ssh/mordor.pub mountdoom@remote.ip.address
Connect to the remote
ssh -i ~/.ssh/mordor mountdoom@remote.ip.address
Creating a connection alias
On the client, open SSH config
nano ~/.ssh/config
And paste
Host mordor
HostName remote.ip.address
User mountdoom
IdentityFile ~/.ssh/mordor
Connect to the remote using
ssh mordor