linux ssh 多台机器无密码相互登陆方法一

# 1.删除已有公钥
rm /root/.ssh -fr
#2.创建公钥
ssh-keygen -t rsa
一路直接【回车】就可以了
#3.查看是否创建成功钥匙
ls /root/.ssh/
id_rsa(密钥)  id_rsa.pub(公钥)  known_hosts
#4.把公钥 id_rsa.pub 复制到需要从自身远程登录的机器(192.168.75.134)上:
scp /root/.ssh/id_rsa.pub [email protected]:/root/.ssh/authorized_keys_tmp
ssh [email protected] 'cat /root/.ssh/authorized_keys_tmp >> /root/.ssh/authorized_keys'
ssh [email protected] 'rm -fr /root/.ssh/authorized_keys_tmp'
#5.无密码远程登陆(192.168.75.134)了
ssh 192.168.75.134


你可能感兴趣的:(linux,ssh,无密码)