忘记密码   免费注册 查看新帖 | 论坛精华区
ChinaUnix.net
  平台论坛 博客 微博 读书 人才 精华 文库 自测 | 频道操作系统 开发 数据库 存储 服务器 网络 IT新闻 Linux 下载 Power用户组
最近访问板块 发新帖
查看: 2760 | 回复: 22

ssh无法登录 [复制链接]
更多

Rank: 1

帖子
213
主题
47
精华
0
可用积分
315
专家积分
0
在线时间
13 小时
注册时间
2007-12-13
最后登录
2009-06-07
论坛徽章:
0
发表于 2008-11-18 08:55:13 |显示全部楼层
请教朋友们一个问题:
以前在WIN下用putty工具的SSH登录linux服务器,用户名是root,登录使用正常;
现在想再添加一个普通用户,用户名为qks,现在samba服务可以用此用户名进行登录了,但是putty根据的ssh却无法用此用户名登录,
输入密码后提示"Access denied";请朋友们帮忙分析下是什么原因引起的;

thanks in advance

帖子
71
主题
26
精华
0
可用积分
81
专家积分
0
在线时间
0 小时
注册时间
2006-05-24
最后登录
2010-09-28
论坛徽章:
0
发表于 2008-11-19 10:46:12 |显示全部楼层
貌似是默认被拒绝了吧!!

Rank: 1

帖子
213
主题
47
精华
0
可用积分
315
专家积分
0
在线时间
13 小时
注册时间
2007-12-13
最后登录
2009-06-07
论坛徽章:
0
发表于 2008-11-19 12:15:26 |显示全部楼层

回复 #2 聆听风雨 的帖子

那怎么解决呢?
言多必失

Rank: 8Rank: 8

帖子
5585
主题
214
精华
38
可用积分
18873
专家积分
80
在线时间
2940 小时
注册时间
2007-05-11
最后登录
2012-02-10
论坛徽章:
0
发表于 2008-11-19 16:56:16 |显示全部楼层
原帖由 qks5201314 于 2008-11-19 12:15 发表
那怎么解决呢?


改一下/etc/ssh/sshd_config这个文件:

现在说不清楚,你把你这个文件的内容贴出来我看看
Nothing is impossible!

Nginx源码分析交流群:120388348
微博地址:http://weibo.com/u/1847971765

Rank: 1

帖子
213
主题
47
精华
0
可用积分
315
专家积分
0
在线时间
13 小时
注册时间
2007-12-13
最后登录
2009-06-07
论坛徽章:
0
发表于 2008-11-19 17:18:48 |显示全部楼层

回复 #4 dreamice 的帖子

#       $OpenBSD: sshd_config,v 1.75 2007/03/19 01:01:29 djm 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
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

# Disable legacy (protocol version 1) support in the server for new
# installations. In future the default will change to require explicit
# activation of protocol 1
Protocol 2

# 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 and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
#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 delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
#PermitTunnel no
# no default banner path
#Banner /some/path

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

# Example of overriding settings on a per-user basis
#Match User anoncvs
#       X11Forwarding no
#       AllowTcpForwarding no
#       ForceCommand cvs server

就是那么多的
言多必失

Rank: 8Rank: 8

帖子
5585
主题
214
精华
38
可用积分
18873
专家积分
80
在线时间
2940 小时
注册时间
2007-05-11
最后登录
2012-02-10
论坛徽章:
0
发表于 2008-11-19 17:29:52 |显示全部楼层
# Logging
# obsoletes QuietMode and FascistLogging
#SyslogFacility AUTH  
SyslogFacility AUTHPRIV
#LogLevel INFO

改成====》
# Logging
# obsoletes QuietMode and FascistLogging
SyslogFacility AUTH
#SyslogFacility AUTHPRIV
LogLevel INFO

试一下。
已有 1 人评分可用积分 收起 理由
bitmilong + 15 鼓励

总评分: 可用积分 + 15   查看全部评分

Nothing is impossible!

Nginx源码分析交流群:120388348
微博地址:http://weibo.com/u/1847971765
言多必失

Rank: 8Rank: 8

帖子
5585
主题
214
精华
38
可用积分
18873
专家积分
80
在线时间
2940 小时
注册时间
2007-05-11
最后登录
2012-02-10
论坛徽章:
0
发表于 2008-11-19 17:50:34 |显示全部楼层
搞定了没有,拿烟的兄弟
Nothing is impossible!

Nginx源码分析交流群:120388348
微博地址:http://weibo.com/u/1847971765

Rank: 1

帖子
213
主题
47
精华
0
可用积分
315
专家积分
0
在线时间
13 小时
注册时间
2007-12-13
最后登录
2009-06-07
论坛徽章:
0
发表于 2008-11-19 18:40:33 |显示全部楼层

回复 #7 dreamice 的帖子

不好意思,刚回家吃饭了,我把那几句改了下,然后在终端上执行service sshd restart 重新启动此服务成功后,
用putty的ssh,后添加的用户名登录还提示"Access denied";:(
言多必失

Rank: 8Rank: 8

帖子
5585
主题
214
精华
38
可用积分
18873
专家积分
80
在线时间
2940 小时
注册时间
2007-05-11
最后登录
2012-02-10
论坛徽章:
0
发表于 2008-11-19 20:54:49 |显示全部楼层
你把这几个都注释掉:
#PasswordAuthentication yes
#GSSAPIAuthentication yes
#GSSAPICleanupCredentials yes
#X11Forwarding yes

另外,把这个打开:
ListenAddress 0.0.0.0
Nothing is impossible!

Nginx源码分析交流群:120388348
微博地址:http://weibo.com/u/1847971765

Rank: 8Rank: 8

帖子
12993
主题
156
精华
0
可用积分
57437
专家积分
83
在线时间
1642 小时
注册时间
2008-02-15
最后登录
2012-02-04
论坛徽章:
0
发表于 2008-11-20 00:42:24 |显示全部楼层
/etc/hosts.deny
大梦谁先觉?平生我自知,草堂春睡足,窗外日迟迟。
.
您需要登录后才可以回帖 登录 | 注册

北京皓辰网域网络信息技术有限公司. 版权所有 京ICP证:060528号 北京市公安局海淀分局网监中心备案编号:1101082001
广播电视节目制作经营许可证(京) 字第1234号 中国互联网协会会员  联系我们:
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP