1、ssh-keygen -t rsa 一路回车,当然可以设置key密码
2、cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
3、chmod 600 /root/.ssh/authorized_keys
4、chmod 700 /root/.ssh/
5、编辑/etc/ssh/sshd_config,关闭密码认证,开启key认证
6、重启sshd服务
7、使用客户端验证key登录
posted on 2018-11-05 17:49 狄成 阅读(423) 评论(0) 编辑 收藏 举报