- Login with account user (not root)
mkdir pem
cd pem
ssh-keygen -b 2048 -f identity -t rsa
- Copy public key contents to authorized_keys
cat identity.pub >> ~/.ssh/authorized_keys
- Disable Password Authentication
sudo nano /etc/ssh/sshd_config
Change to no to disable tunnelled clear text passwords
PasswordAuthentication no
- Restart SSH
sudo service ssh restart
- Download your private key to client side
cat ~/.ssh/pem/identity
- Set permission for pem on your local
sudo chmod 600 identity.pem
- Test login
ssh -i identity.pem user@vps-ip