OS version:Red Hat Enterprise Linux Server release 6.4
Kernel version:2.6.32-358.el6.x86_64
-------------------------------------------------------------------------
准备工作:
[root@Zhai ~]# tail -n 2 /etc/passwd
pam_test1:x:501:502::/home/pam_test1:/bin/csh pam_test2:x:502:503::/home/pam_test2:/bin/bash
[root@Zhai ~]# vi /etc/shells
/bin/sh /bin/bash /sbin/nologin /bin/dash /bin/tcsh
[root@Zhai ~]# service vsftpd start
[root@Zhai ~]# ifconfig | grep "inet addr"
inet addr:192.168.60.2 Bcast:192.168.60.255 Mask:255.255.255.0 inet addr:127.0.0.1 Mask:255.0.0.0
案例1:
[root@Zhai ~]# cat /etc/pam.d/vsftpd
#%PAM-1.0 auth required pam_shells.so account include password-auth
案例2:
[root@Zhai ~]# man pam_shells
RETURN VALUES PAM_AUTH_ERR Access to the system was denied. PAM_SUCCESS The users login shell was listed as valid shell in /etc/shells. PAM_SERVICE_ERR The module was not able to get the name of the user.
[root@Zhai ~]# cat /etc/pam.d/vsftpd
#%PAM-1.0 auth [success=ok default=die] pam_shells.so account include password-auth
-------------------------------------------------------------------------
The detailed information:man pam_shells