ssh登陆不需要密码(配置信任有关系)
2012-10-09 14:06
274 查看
A:192.168.2.127
B:192.168.2.128
1、生成密钥对
使用默认值,一路回车
查看生成的密钥
3、配置需要同步的两台主机信任关系(避免ssh登陆需要密码)
分别从拷贝对方的id_rsa.pub到本机,
A主机:
scp root@192.168.2.128:/root/.ssh/id_rsa.pub /root
cat /root/id_rsa.pub >> /root/.ssh/authorized_keys
B主机:
scp root@192.168.2.127:/root/.ssh/id_rsa.pub /root
cat /root/id_rsa.pub >> /root/.ssh/authorized_keys
使用>>为了不影响原来可能存在和其它主机的信任关系
完成:
测试:
A主机:ssh 192.168.2.128看是否需要密码
本文出自 “notepad” 博客,请务必保留此出处http://sndapk.blog.51cto.com/5385144/1019679
B:192.168.2.128
1、生成密钥对
使用默认值,一路回车
[root@localhost ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: b1:5f:58:b4:cf:9c:f1:33:4a:cb:8a:e6:84:87:09:bc root@localhost.localdomain The key's randomart image is: +--[ RSA 2048]----+ | . | | . . | | . o . | | . o o + + | | o S . ..=o.| | o +. .o o o| | E + o. + | | o.. . | | oo . | +-----------------+
查看生成的密钥
[root@localhost ~]# ll .ssh/ total 8 -rw------- 1 root root 1675 Oct 9 11:59 id_rsa -rw-r--r-- 1 root root 408 Oct 9 11:59 id_rsa.pub
3、配置需要同步的两台主机信任关系(避免ssh登陆需要密码)
分别从拷贝对方的id_rsa.pub到本机,
A主机:
scp root@192.168.2.128:/root/.ssh/id_rsa.pub /root
cat /root/id_rsa.pub >> /root/.ssh/authorized_keys
B主机:
scp root@192.168.2.127:/root/.ssh/id_rsa.pub /root
cat /root/id_rsa.pub >> /root/.ssh/authorized_keys
使用>>为了不影响原来可能存在和其它主机的信任关系
完成:
测试:
A主机:ssh 192.168.2.128看是否需要密码
本文出自 “notepad” 博客,请务必保留此出处http://sndapk.blog.51cto.com/5385144/1019679
相关文章推荐
- linux如何配置双机SSH信任然后双向免密码登陆
- 如何在linux服务器中配置ssh互信(不需要密码即可ssh登陆)
- ssh免密码登陆配置及注意事项
- Jenkins进阶系列之——09配置Linux系统ssh免密码登陆
- SSH免密码登陆配置
- SSH免密码登陆配置
- hadoop 2.4.1配置ssh免密码登陆
- ssh建立信任关系无密码登陆
- hadoop安装配置之ssh无密码登陆
- ssh免密码登陆配置及注意事项
- ssh 无密码登陆配置
- linux 配置ssh免密码登陆本机
- jenkins配置ssh免密码登陆
- SSH免密码登陆配置
- SSH免密码登陆配置
- 正式生产环境下hadoop集群的DNS+NFS+ssh免密码登陆配置
- linux使用:配置SSH免密码登陆
- 配置SSH免密码登陆
- SSH建立信任关系实现免输密码登陆
- ssh无密码验证登陆配置