您的位置:首页 > 其它

ssh连接遇到的问题

2013-02-20 14:59 134 查看
以下是在CentOS下使用SSH的时遇到的一些问题以及解决方法

一、要想通过主机名进行连接需要进行以下设置

    1、编辑/etc/sysconfig/network

         将HOSTNAME的值改为你想要的名字如master。注:此名字为在网络上使用的名字

     2、编辑/etc/hosts

         在此文件后边添加同网下的一些信息如以下所示。注:此信息需要在每一台机器上进行相同的设置

         

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.253.133 master
192.168.253.135 slave1
192.168.253.136 slave2


 

     3、配置完成之后重启生效

二、连接过程中的问题

     如果提示以下信息

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for master has changed,
and the key for the corresponding IP address 192.168.253.133
is unchanged. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
Offending key for IP in /root/.ssh/known_hosts:2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
90:95:df:11:d3:50:43:98:58:ed:f1:95:c7:c3:58:c3.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:3
RSA host key for master has changed and you have requested strict checking.
Host key verification failed.

只需把用户目录下的.ssh目录下的known_hosts删除及可

rm -f known_hosts


 

此时重新连接及可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: