How to set up ssh key pair with ubuntu
Jan 31, 2021
- Create your ssh key on your laptop -> ssh-keygen
- Create ~/.ssh/ folder on the server -> mkdir -p ~/.ssh/
- Make sure to do this on the server -> “echo public_key_string >> ~/.ssh/authorized_keys”
- Copy your pub key to ~/.ssh/authorized_keys on your server
- You need to little bit config to this on the server -> sudo nano /etc/ssh/sshd_config
- And enable on “PubkeyAuthentication yes” from “#PubkeyAuthentication yes”
- Restart the ssh on the server by “sudo systemctl restart ssh”
- The last one exit the server and “ssh user@host” again
Try to help to pangdev58@gmail.com