1, 配置/etc/ssh/sshd.conf为下列
RSAAuthentication yes
PubkeyAuthentication yes
ServerKeyBits 1024
PasswordAuthentication yes
PermitRootLogin yes
然后重启service sshd restart
2,生成公私匙
ssh-keygen生成公私匙,然后将在/root/.ssh/下将id_rsa.pub复制为authorized_keys
chmod 600 /root/.ssh/authorized_keys
chmod 700 /root/.ssh/
然后重启ssd :service sshd restart
然后将id_rsa.pub和id_rsa复制到本地windows的文件夹中。
3,使用secureCRT连接。
配置会话publickey的属性为下图所示:
[![1]][1]
4,然后无密码连接成功
[![2]][2]
参考链接:http://blog.csdn.net/qq_27446553/article/details/46409493
[1]: http://osa5nia8m.bkt.clouddn.com/20170929/1.png
[2]: http://osa5nia8m.bkt.clouddn.com/20170929/2.png