Home Add ssh key to remote server
Post
Cancel

Add ssh key to remote server

1. Copy ssh key to server

1
ssh-copy-id -i ~/.ssh/id_rsa.pub root@1.2.3.4

It will ask your password. Please input it

2. (Optional) Disable password authentication for SSH

Find PasswordAuthentication in file /etc/ssh/sshd_config and change value from yes to no

1
PasswordAuthentication no
1
service ssh restart
This post is licensed under CC BY 4.0 by the author.