首页 > 其他 > 详细

SSH互信

时间:2016-03-30 16:35:59      阅读:176      评论:0      收藏:0      [点我收藏+]

配置SSH免密码登录:

需要先关闭selinux,否则会互信失败

[root@rhel-1 ~]# 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:
95:77:9d:9b:1d:43:5d:19:32:f2:7e:ad:97:f5:56:be root@rhel-1
[root@rhel-1 ~]#

此时还需要输入密码

[root@rhel-1 ~]# scp .ssh/id_rsa.pub root@192.168.100.249:/root
[root@rhel-2 ~]# cat id_rsa.pub >> .ssh/authorized_keys
[root@rhel-2 ~]# chmod 600 .ssh/authorized_keys
[root@rhel-1 ~]# ssh 192.168.100.249
Last login: Fri Jun 12 09:27:00 2015 from 192.168.100.251
[root@rhel-2 ~]#


本文出自 “鹏城-酱油瓶” 博客,请务必保留此出处http://yfshare.blog.51cto.com/8611708/1758386

SSH互信

原文:http://yfshare.blog.51cto.com/8611708/1758386

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!