Add SSHkey to VPS

https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-2

Create .ssh folder in root foder

mkdir -p ~/.ssh

touch ~/.ssh/authorized_keys
echo public_key_string >> ~/.ssh/authorized_keys

Phần quyền, chỉ root account mới có thể access.

chmod -R go= ~/.ssh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Disabling Password Authentication on your Server

sudo nano /etc/ssh/sshd_config
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
Ubuntu
sudo systemctl restart ssh

CentOS
sudo systemctl restart sshd

Use SSH Keys With PuTTY On Windows

https://devops.ionos.com/tutorials/use-ssh-keys-with-putty-on-windows/

Leave a Comment

Your email address will not be published. Required fields are marked *