客户端生成key密钥对
-
securecrt
image.png
- centos
ssh-keygen -t rsa
服务器端配置
修改SSH配置文件vi /etc/ssh/sshd_config
查找RSAAuthentication、StrictModes、PubkeyAuthentication、AuthorizedKeysFile把所在行修改为:
RSAAuthentication yes
StrictModes no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
把生成的pub key内容拷到~/.ssh/authorized_keys
重启SSH服务:
systemctl restart sshd.service
网友评论