ssh-keygen -t rsa #-t means encryption method #The save path and short password confirmation will appear afterwards, just press Enter all the way

 

cd /root/.ssh

 

mv id_rsa.pub authorized_keys #renaming

 

Download id_rsa to local

 

Modify /etc/ssh/sshd_config

 

Disable password verification

 

PasswordAuthentication no

 

Enable key verification

 

RSAAuthentication yes

 

PubkeyAuthentication yes

 

Restart the SSH service

 

service sshd restart #centos system

 

service ssh restart #ubuntu system

 

/etc/init.d/ssh restart #debian system

這篇文章有幫助嗎? 268 Users Found This Useful (1132 Votes)