useradd -m USERNAME
passwd USERNAME
sudo usermod -a -G sudo USERNAME
Note: need to log out and back in for this to take effect.
For given user:
mkdir .ssh
chmod 0700 .ssh
Add public key to ~/.ssh/authorized_keys
On local machine add to ~/.ssh/config
:
Host <name>
HostName <remote host>
User USERNAME
IdentityFile /path/to/private/key
Then ssh in with:
$ ssh <name>
In /etc/ssh/sshd_config
:
PasswordAuthentication no
Reload config with:
$ kill -HUP <sshd pid>
$ sudo ufw allow openssh
$ sudo ufw allow 80
$ sudo ufw allow 443
$ sudo ufw enable