免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5949 | 回复: 13

2台CentOS6 ssh单向通的问题 [复制链接]

论坛徽章:
0
发表于 2011-11-23 15:35 |显示全部楼层
2台机器,CentOS-hdp1 /CentOS-hdp2

每台都用root 做了ssh-keygen -t rsa
把2台的pub都放在各自的.ssh/authorized_keys里
现在1->2不行(报错见下),2->1可以通!

2台的/etc/ssh/sshd_config都是就改了2处
PasswordAuthentication  no
AuthorizedKeyFile   .ssh/authorized_keys

而且我现在可以用secureCRT不用root用户名/密码连接1号机,但是2号机却不行!


[root@CentOS-hdp1 ~]$ssh -v CentOS-hdp2
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-hdp2 [192.168.233.12] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.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-hdp2' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
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_0' not found

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

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


debug1: Next authentication method: publickey
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Offering public key:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Offering public key:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
[root@CentOS-hdp1 ~]$




2->1的可通,但是我现在没法通过secureCRT连接他,记录copy不出来
就是从这几行开始不一样的
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Offering public key:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Offering public key:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_dsa
debug1: No more authentication methods to try.
gachoyi 该用户已被删除
发表于 2011-11-23 21:58 |显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
发表于 2011-11-24 09:41 |显示全部楼层
不行

论坛徽章:
33
ChinaUnix元老
日期:2015-02-02 08:55:39CU十四周年纪念徽章
日期:2019-08-20 08:30:3720周年集字徽章-周	
日期:2020-10-28 14:13:3020周年集字徽章-20	
日期:2020-10-28 14:04:3019周年集字徽章-CU
日期:2019-09-08 23:26:2519周年集字徽章-19
日期:2019-08-27 13:31:262016科比退役纪念章
日期:2022-04-24 14:33:24
发表于 2011-11-24 09:52 |显示全部楼层
把hostname加到对方的/etc/hosts文件里面试试

论坛徽章:
0
发表于 2011-11-24 10:04 |显示全部楼层
对比过了
没问题的
把hostname加到对方的/etc/hosts文件里面试试
Shell_HAT 发表于 2011-11-24 09:52

论坛徽章:
0
发表于 2011-11-24 10:51 |显示全部楼层
很多问题要server端的log才能看到问题
.ssh 和 authorized_keys权限有没有设对。

论坛徽章:
0
发表于 2011-11-24 10:59 |显示全部楼层
.ssh 是700
authorized_keys 是644

论坛徽章:
0
发表于 2011-11-24 11:43 |显示全部楼层
我把.ssh的目录底下全删了,重新配

还是那样
1/2/3->1,都可以
到2或者3都不行,2/3本机都不行

而且我可以用secureCRT不用用户名秘密登陆1号机,2/3也不行!
所以2/3的日志不好贴啊!

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
发表于 2011-11-24 11:50 |显示全部楼层
从来木有遇到这个问题。

论坛徽章:
33
ChinaUnix元老
日期:2015-02-02 08:55:39CU十四周年纪念徽章
日期:2019-08-20 08:30:3720周年集字徽章-周	
日期:2020-10-28 14:13:3020周年集字徽章-20	
日期:2020-10-28 14:04:3019周年集字徽章-CU
日期:2019-09-08 23:26:2519周年集字徽章-19
日期:2019-08-27 13:31:262016科比退役纪念章
日期:2022-04-24 14:33:24
发表于 2011-11-24 14:39 |显示全部楼层
回复 8# boylez


用户名+密码登陆上去拿日志啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP