一、新建/root/.ssh目录 mkdir /root/.ssh 二、建立authorized_keys文件 vi /root/.ssh/authorized_keys 三、复制公钥内容保存 :wq 四、设置authorized_keys权限 /bin/chmod 600 /root/.ssh/authorized_keys 五、修改/etc/ssh/sshd_config vi /etc/ssh/sshd_config 原内容: #RSAAuthentication yes #PubkeyAuthentication yes PasswordAuthentication yes 更改成: RSAAuthentication yes PubkeyAuthentication yes PasswordAuthentication no 六、从新启动SSH /etc/init.d/sshd restart