免费注册 查看新帖 |

Chinaunix

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

大神们,ssh登录问题求解啊~ [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-23 08:57 |只看该作者 |倒序浏览
本帖最后由 jiwang1980 于 2011-12-23 09:31 编辑

关于ssh配置登录不需要密码

步骤如下:
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

然后ssh localhost
结果还是让我输入密码

调试信息:
1,
[root@hadoop .ssh]# ssh -v localhost
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 localhost [::1] 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 'localhost' is known and matches the RSA host key.
debug1: Found key in /root/.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,password
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: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
root@localhost's password:


2,tail -f /var/log/secure
没有输出,所以不是认证文件的权限问题

求思路

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2011-12-23 09:00 |只看该作者
本帖最后由 chenyx 于 2011-12-23 09:00 编辑

你看下/var/log/messages日志,看看有没有错误

论坛徽章:
0
3 [报告]
发表于 2011-12-23 09:19 |只看该作者
蝈蝈,木有任何消息提示

论坛徽章:
0
4 [报告]
发表于 2011-12-23 09:38 |只看该作者
log/secure

顺便看相关目录文件查权限

论坛徽章:
0
5 [报告]
发表于 2011-12-23 09:49 |只看该作者
不是权限问题,secure没有错误输出,3ks

论坛徽章:
2
技术图书徽章
日期:2013-10-30 14:37:252015年亚洲杯之伊朗
日期:2015-04-30 13:37:02
6 [报告]
发表于 2011-12-23 10:17 |只看该作者
不要用local,用ssh serv_ip

论坛徽章:
0
7 [报告]
发表于 2011-12-23 10:52 |只看该作者
这不是问题的原因,3ks

论坛徽章:
17
CU大牛徽章
日期:2013-03-13 15:32:35午马
日期:2014-07-29 13:09:18未羊
日期:2014-09-19 16:21:07巳蛇
日期:2014-09-29 16:17:06巳蛇
日期:2014-10-16 08:33:00白羊座
日期:2014-10-16 09:10:24申猴
日期:2015-01-09 11:36:332015年亚洲杯之澳大利亚
日期:2015-03-03 13:57:302015年辞旧岁徽章
日期:2015-03-03 16:54:152015年亚洲杯之沙特阿拉伯
日期:2015-03-27 11:24:282015亚冠之阿尔纳斯尔
日期:2015-06-16 11:50:23CU大牛徽章
日期:2013-03-13 15:38:15
8 [报告]
发表于 2011-12-23 14:43 |只看该作者
/etc/ssh/sshd_config文件修改了吗?下面几行注释去掉
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

重启sshd服务,/etc/init.d/sshd restart

论坛徽章:
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
9 [报告]
发表于 2011-12-23 23:18 |只看该作者
本地.ssh 700
远程.ssh 755

论坛徽章:
0
10 [报告]
发表于 2011-12-24 08:45 |只看该作者
试了,一样的错误,3ks
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP