两台机器 linux1 linux2
linux1执行
#cd ~
#ssh-keygen -t rsa
#scp .ssh/id_rsa.pub linux2:~/.ssh/
到linux2执行
#cd ~/.ssh
#cat id_rsa.pub >>.ssh/authorized_keys
#chmod 644 authorized_keys
#ssh-keygen -t rsa
#mv id_rsa.pub id_rsa.pub2
#scp .ssh/id_rsa.pub2 linux1:~/.ssh/
再回到linux1执行
#cd ~/.ssh
#cat id_rsa.pub2 >>.ssh/authorized_keys
这样两台机器的ssh信任就配置好了,互相访问就不需要输入密码了
阅读(1138) | 评论(0) | 转发(0) |