免费注册 查看新帖 |

Chinaunix

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

请教用openssh登录时出现的:Permission denied (publickey) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-05-24 22:18 |只看该作者 |倒序浏览
我的openssh版本号:

[root@localhost ssh]# rpm -qa openssh
openssh-3.5p1-6

[root@localhost ssh]# rpm -qa |grep openssh
openssh-3.5p1-6
openssh-server-3.5p1-6
openssh-askpass-gnome-3.5p1-6
openssh-clients-3.5p1-6
openssh-askpass-3.5p1-6

我实验中的环境: 服务端和客户端都是同一台pc.

下面是我做的东西和出现的问题:

[root@localhost .ssh]# ssh-keygen -d
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): /home/admin/.ssh/id_dsaEnter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/admin/.ssh/id_dsa.
Your public key has been saved in /home/admin/.ssh/id_dsa.pub.
The key fingerprint is:
5c:70:4f:b5:06:b2:b3:25:d0:e9:91:b3:00:4a:c1:63 root@localhost.localdomain
[root@localhost .ssh]# ls
id_dsa  id_dsa.pub
[root@localhost .ssh]# mv id_dsa.pub authorized_key
[root@localhost .ssh]# chmod 644 authorized_key
[root@localhost .ssh]# /etc/rc.d/init.d/sshd restart
停止 sshd:                                                [  确定  ]
启动 sshd                                                  [  确定  ]
[root@localhost .ssh]# ssh -l admin localhost
Permission denied (publickey).

我在/etc/ssh/sshd_config所做的修改:
PasswordAuthentication no
ChallengeResponseAuthentication no

请高手们指点, 小弟正在做毕业设计, 希望得到好心人士的帮忙, 谢谢!

论坛徽章:
0
2 [报告]
发表于 2004-05-25 09:59 |只看该作者

请教用openssh登录时出现的:Permission denied (publickey)

顶一下,希望有人懂可以回答我, 搞了几天了, 今天得到的结果是Permission denied (). 然后跑到 www.openssh.com去查找了一下, 看到类似的东西, 按着提示的东西弄了一下, 结果滔声依旧.

3.14 - I copied my public key to authorized_keys but public-key authentication still doesn't work.

Typically this is caused by the file permissions on $HOME, $HOME/.ssh or $HOME/.ssh/authorized_keys being more permissive than sshd allows by default.

In this case, it can be solved by executing the following on the server.

    $ chmod go-w $HOME $HOME/.ssh
    $ chmod 600 $HOME/.ssh/authorized_keys

If this is not possible for some reason, an alternative is to set StrictModes no in sshd_config, however this is not recommended.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP