原文地址: http://blog.csdn.net/jianglei421/article/details/7173198
[root@localhost ~]# vi /etc/pam.d/sshd
#%PAM-1.0
auth required pam_stack.so service=system-auth
auth required pam_nologin.so
auth required pam_listfile.so item=user sense=allow file=/etc/sshusers onerr=fail
account required pam_stack.so service=system-auth
password required pam_stack.so service=system-auth
session required pam_stack.so service=system-auth
2)建立/etc/sshusers文件
[root@localhost ~]# touch /etc/sshusers
3)把允许登陆的用户加入到 /etc/sshusers
[root@localhost ~]#echo "root" >> /etc/sshusers
[root@localhost ~]#echo "admin" >> /etc/sshusers
...
这样 root 和admin就可以ssh到你的服务器上去了