免费注册 查看新帖 |

Chinaunix

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

请教关于ssh无密码登陆的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-01-11 09:29 |只看该作者 |倒序浏览
5可用积分
我想在windows系统下采用key认证方式,实现centos系统的无密码登陆,用f-secure-ssh和securecrt都试过了,可怎么都不成功,请各位大虾帮忙看看
我用-secure-ssh和securecrt生成密钥对,生成的公钥上传至/home/xxx/.ssh下,并执行ssh-keygen -X -f mykey.pub > authorized_keys,sshd_config文件配置如下:
#       $OpenBSD: sshd_config,v 1.69 2004/05/23 23:59:53 dtucker Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options change a
# default value.

#Port 22
#Protocol 2,1
#ListenAddress 0.0.0.0
#ListenAddress ::

# HostKey for protocol version 1
#HostKey /etc/ssh/ssh_host_key
# HostKeys for protocol version 2
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
#KeyRegenerationInterval 1h
#ServerKeyBits 768

# Logging
#obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH
SyslogFacility AUTHPRIV
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6

#RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes

# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting of
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes

#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
#Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#ShowPatchLevel no

# no default banner path
#Banner /some/path

# override default of no subsystems
Subsystem       sftp    /usr/libexec/openssh/sftp-server


请问问题出在什么地方?

[ 本帖最后由 kelly_sh 于 2007-1-11 15:46 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-01-11 10:33 |只看该作者
没人知道吗?

论坛徽章:
0
3 [报告]
发表于 2007-01-11 11:56 |只看该作者
客户端和服务器端的错误信息有没有呢??

论坛徽章:
0
4 [报告]
发表于 2007-01-11 13:30 |只看该作者
server responsed "no further authentication methods availabale."

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
5 [报告]
发表于 2007-01-11 13:42 |只看该作者
Key可以这样生成:
在BSD上,用ssh-keygen生成~/.ssh/id_rsa及~/.ssh/id_rsa.pub,
直接把id_rsa.pub改名成authorized_keys,把id_rsa下载到M$,用putty的puttygen.exe导入id_rsa,再导出成putty格式(*.ppk)即可.
该导出的文件起码可以在putty及pietty上使用.
在linux上也差不多吧,lz可以试试.

论坛徽章:
0
6 [报告]
发表于 2007-01-11 13:44 |只看该作者
Disconnected; Authentication Error

The error message "Disconnected; Authentication Error (No further authentication methods available.)" indicates that any of the methods that have been used to authenticate you to the server have not been successful.

A relatively common situation is one where the remote host computer is expecting public-key authentication to be used and you have not sent your public key to the host. You can do this by following the instructions in section Uploading Your Public Key.

This error is also produced if the system's name server is not doing reverse lookups correctly. Ask your system administrator to configure the name server so that it does reverse lookups properly.

If this is not possible, the system administrator has to edit the file /etc/ssh2/sshd2_config on the Secure Shell server and change the RequireReverseMapping setting to no.

This is a common problem for modem connections. Typical modem connections use dynamic IP addresses. This means that the IP address changes from one connection to another, and these dynamic IP addresses have no permanent name server entries in the Domain Name System (DNS). If this is the case, you will have to ask your service provider to edit the sshd2_config file on the SSH server.

论坛徽章:
0
7 [报告]
发表于 2007-01-11 14:05 |只看该作者
我也试过的,没用呀,导入不能成功

论坛徽章:
0
8 [报告]
发表于 2007-01-11 15:45 |只看该作者
没人理我?大家都不知道?

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
9 [报告]
发表于 2007-01-11 17:06 |只看该作者
原帖由 kelly_sh 于 2007-1-11 14:05 发表
我也试过的,没用呀,导入不能成功

正在使用中.

没用? 操作问题吧.

论坛徽章:
0
10 [报告]
发表于 2007-01-12 09:29 |只看该作者
试试这个命令:
shell> ssh-keygen -i -f 'uploaded public key file' >> authorized_keys

Good luck!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP