centos7 ssh 设置key认证

vi /etc/ssh/sshd_config

查找RSAAuthentication、StrictModes、PubkeyAuthentication、AuthorizedKeysFile把所在行修改为:

RSAAuthentication yes
StrictModes no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

重启SSH服务

systemctl restart sshd.service


然后用xshell或者linux自己的keygen生成私钥和公钥,把公钥拷贝到/root/.ssh/authorized_keys即可
posted @ 2016-06-01 00:41  juandx  阅读(5260)  评论(0编辑  收藏  举报