Linux实现SSH免密码登录
参考:https://www.linuxidc.com/Linux/2017-05/144165.htm
1)生成秘钥对
ssh
-keygen -t rsa -b 2048
2)上传公钥到服务器
scp
.
ssh
/id_rsa
.pub
3)公钥添加到.ssh/authorized_keys
cat id_rsa.pub >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
vim /etc/ssh/sshd_config 把PubkeyAuthentication no改为PubkeyAuthentication
yes