2020-05-14 11:08:32 工作备份
#使用想登陆的用户执行ssh-keygen -t rsacd /root/.ssh/cat id_rsa.pub >> authorized_keysvim /etc/ssh/sshd_config···#修改为yesPubkeyAuthentication yes#禁用密码登录(测试成功后修改)PasswordAuthentication no···systemctl restart sshd
#使用想登陆的用户执行
ssh-keygen -t rsa
cd /root/.ssh/
cat id_rsa.pub >> authorized_keys
vim /etc/ssh/sshd_config
···
#修改为yes
PubkeyAuthentication yes
#禁用密码登录(测试成功后修改)
PasswordAuthentication no
systemctl restart sshd
下载id_rsa私钥,本地使用即可