boylez 发表于 2011-11-24 09:44

(已解决)另一个ssh单向正常,另外一个方向不正常的问题

本帖最后由 boylez 于 2011-11-24 10:44 编辑

从1号机ssh到3号机正常
从3号机ssh到1号机异常!

也没说连接失败,就是一直还是在3号机上,没出去
$
$ ssh CentOS-hdp1
Last login: Thu Nov 24 09:37:17 2011
hdp3 ~]$
$ hostname
CentOS-hdp3.hdp
$ exit
logout
Connection to CentOS-hdp1 closed.
$


====================================
正常:
$ssh CentOS-hdp3
Last login: Thu Nov 24 09:37:29 2011 from centos-hdp1.hdp
$ hostname
CentOS-hdp3.hdp
$ exit
logout
Connection to CentOS-hdp3 closed.
$

Shell_HAT 发表于 2011-11-24 09:50

把ssh的dns禁用一下试试
http://bbs.chinaunix.net/thread-1689869-1-1.html

boylez 发表于 2011-11-24 09:58

不行,只增加了127.0.0.1的ip地址
Last login: Thu Nov 24 09:57:35 2011 from 127.0.0.1
还是显示3号机

boylez 发表于 2011-11-24 10:29

$
$ hostname
CentOS-hdp3.hdp
$ ssh -v CentOS-hdp1
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to CentOS-hdp1 port 22.
debug1: Connection established.
debug1: identity file /home/dbrg/.ssh/identity type -1
debug1: identity file /home/dbrg/.ssh/id_rsa type 1
debug1: identity file /home/dbrg/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'centos-hdp1' is known and matches the RSA host key.
debug1: Found key in /home/dbrg/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.Minor code may provide more information
Credentials cache file '/tmp/krb5cc_501' not found

debug1: Unspecified GSS failure.Minor code may provide more information
Credentials cache file '/tmp/krb5cc_501' not found

debug1: Unspecified GSS failure.Minor code may provide more information


debug1: Next authentication method: publickey
debug1: Trying private key: /home/dbrg/.ssh/identity
debug1: Offering public key: /home/dbrg/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = zh_CN.UTF-8
Last login: Thu Nov 24 10:27:25 2011 from 192.168.233.11
$ hostname
CentOS-hdp3.hdp
$ exitdebug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0

logout
debug1: channel 0: free: client-session, nchannels 1
Connection to CentOS-hdp1 closed.
Transferred: sent 3040, received 2936 bytes, in 22.6 seconds
Bytes per second: sent 134.6, received 130.0
debug1: Exit status 0
$

boylez 发表于 2011-11-24 10:43

搞定了,是我自己的问题,也是自己解决的

debug1: Connecting to CentOS-hdp1 port 22.

3号机的hosts文件问题,谢谢各位

Shell_HAT 发表于 2011-11-24 10:54

回复 5# boylez


半个小时之前还在说hosts文件没问题http://bbs.chinaunix.net/images/smilies/default/icon_mrgreen.gif
http://bbs.chinaunix.net/thread-3622250-1-1.html

boylez 发表于 2011-11-24 10:59

老兄,我不是故意地
1/2号机没问题
3号机的问题,3号机是我把1号机克隆的
anyway, 感谢!
回复boylez


半个小时之前还在说hosts文件没问题
Shell_HAT 发表于 2011-11-24 10:54 http://bbs.chinaunix.net/images/common/back.gif

妈妈说名字长才霸气我就是试试 发表于 2019-02-18 20:10

所以hosts文件里是什么问题呢?可否展示一下

海棠晃 发表于 2019-03-11 16:18

回复 8# 妈妈说名字长才霸气我就是试试

克隆的1号机器, hostname 解析是按照1号机器本地 127.0.0.1解析的
页: [1]
查看完整版本: (已解决)另一个ssh单向正常,另外一个方向不正常的问题