免费注册 查看新帖 |

ChinaUnix.net

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6798 | 回复: 8

(已解决)另一个ssh单向正常,另外一个方向不正常的问题 [复制链接]

论坛徽章:
0
发表于 2011-11-24 09:44 |显示全部楼层
本帖最后由 boylez 于 2011-11-24 10:44 编辑

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

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


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

论坛徽章:
28
ChinaUnix元老
日期:2015-02-02 08:55:392017金鸡报晓
日期:2017-01-10 15:13:29CU十四周年纪念徽章
日期:2018-08-29 22:12:2715-16赛季CBA联赛之深圳
日期:2018-09-20 12:21:09
发表于 2011-11-24 09:50 |显示全部楼层
把ssh的dns禁用一下试试
http://bbs.chinaunix.net/thread-1689869-1-1.html

论坛徽章:
0
发表于 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号机

论坛徽章:
0
发表于 2011-11-24 10:29 |显示全部楼层
[dbrg@CentOS-hdp3 ~]$
[dbrg@CentOS-hdp3 ~]$ hostname
CentOS-hdp3.hdp
[dbrg@CentOS-hdp3 ~]$ 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 [127.0.0.1] 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 [client-session]
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
[dbrg@CentOS-hdp3 ~]$ hostname
CentOS-hdp3.hdp
[dbrg@CentOS-hdp3 ~]$ 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
[dbrg@CentOS-hdp3 ~]$

论坛徽章:
0
发表于 2011-11-24 10:43 |显示全部楼层
搞定了,是我自己的问题,也是自己解决的

debug1: Connecting to CentOS-hdp1 [127.0.0.1] port 22.

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

论坛徽章:
28
ChinaUnix元老
日期:2015-02-02 08:55:392017金鸡报晓
日期:2017-01-10 15:13:29CU十四周年纪念徽章
日期:2018-08-29 22:12:2715-16赛季CBA联赛之深圳
日期:2018-09-20 12:21:09
发表于 2011-11-24 10:54 |显示全部楼层
回复 5# boylez


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

论坛徽章:
0
发表于 2011-11-24 10:59 |显示全部楼层
老兄,我不是故意地
1/2号机没问题
3号机的问题,3号机是我把1号机克隆的
anyway, 感谢!
回复  boylez


半个小时之前还在说hosts文件没问题
Shell_HAT 发表于 2011-11-24 10:54

论坛徽章:
0
发表于 2019-02-18 20:10 |显示全部楼层
所以hosts文件里是什么问题呢?  可否展示一下

论坛徽章:
0
发表于 2019-03-11 16:18 |显示全部楼层
回复 8# 妈妈说名字长才霸气我就是试试

克隆的1号机器, hostname 解析是按照1号机器本地 127.0.0.1解析的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

ITPUB技术栈

ITPUB技术栈是ITPUB企业打造的垂直于IT领域的知识社群平台,在这里,你既可以是创作者也可以是消费者。如果你的IT生涯丰富多彩,喷薄的个人价值尽可在小栈内体现;如果你渴望找到志同道合的伙伴,拓宽人脉,小栈比跑会场更快。 小栈特色:
1.极高的用户转化率,实现更直接的知识变现;
2.随时随地,刷个朋友圈的时间,实现更长效的信息沉淀;
3.戳痛、难点的专业咨询,更接近成功解决方案的时刻;
4.贴近意见领袖,个人高速成长,迈入更富有价值的人际圈。

----------------------------------------

技术小栈>>
  

北京盛拓优讯信息技术有限公司. 版权所有 16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122
中国互联网协会会员  联系我们:huangweiwei@it168.com
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP