1.修改配置文件
vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PermitRootLogin no
PasswordAuthentication no
2.如果是第一次使用,touch /root/.ssh/authorized_keys
/root/.ssh/authorized_keys
拷貝本地public key到authorized_keys中即可
如果遇到什么問題,可以看系統日志
cat /var/log/secure