admin管理员组文章数量:1657051
Server1与Server2在同一虚拟网络当中,在Server2中使用Server1的Hostname连接Server1,并且无需密码认证。
Server1, Hostname: hlmvmeast652 Internal IP: 192.168.0.5
Server2, Hostname: hlmvmeast653 Internal IP: 192.168.0.6
1.在Server1中生成密钥对
2.在Server2中创建/root/.ssh
3.将Server1中的公钥id_rsa.pub拷贝给Server2,Server2将这个文件放置在/root/.ssh下,改名为authorized_keys。
操作命令scp /root/.ssh/id_rsa.pub 192.168.0.6:/root/.ssh/authorized_keys
4. Server1连接server2,发现还需要密码
5.将Server2中selinux设置为Permissive的状态
6.再次在Server1中连接Server2,发现可以无密码成功连接
7.也可以使用主机名进行连接
原文:http://wwwblogs/stonehe/p/7486116.html
版权声明:本文标题:linux虚拟机的密钥,Linux虚拟机之间实现密钥登陆 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1729763498a1212189.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论