如何在 debian 上设置用户的 ssh 访问权限?

如何在 debian 上设置用户的 ssh 访问权限?

我设置组:

usermod -G ssh username

然后我检查了帐户信息:

id username

结果是:

uid=1000(username) gid=1001(username) groups=100(username)

无论如何,如果我尝试使用 ssh 登录,我会收到错误:权限被拒绝,请重试。

我做错了什么?

更新1: 如果我运行 /usr/sbin/sshd -d 结果是:

debug1: sshd version OpenSSH_5.5p1 Debian-6+squeeze1
debug1: read PEM private key done: type RSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
Set /proc/self/oom_adj from 0 to -17
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
debug1: Bind to port 22 on ::.
Bind to port 22 on :: failed: Address already in use.
Cannot bind any address.

更新2: 日志是:

Dec 29 22:06:44 p148401 sshd[32456]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=changed_host  user=username
Dec 29 22:06:47 p148401 sshd[32456]: Failed password for username from 8*.*.*.* port 52765 ssh2

更新3:

root@p148401:/etc/init.d# sudo service ssh stop
Stopping OpenBSD Secure Shell server: sshd.
root@p148401:/etc/init.d# /usr/sbin/sshd -d
debug1: sshd version OpenSSH_5.5p1 Debian-6+squeeze1
debug1: read PEM private key done: type RSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
Set /proc/self/oom_adj from 0 to -17
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Bind to port 22 on ::.
Server listening on :: port 22.

并且不再响应...需要重新启动

..ssh 配置在这里http://codepad.org/8bynXZQC

相关内容