新建的用户的方式
[root@centos2 /var/ftp]# useradd -s /sbin/nologin user1
出错原因:
/etc/pam.d/vsftp文件作了限制
[root@centos2 /etc/pam.d]# vim vsftpd #%PAM-1.0 session optional pam_keyinit.so force revoke auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed auth required pam_shells.so auth include password-auth account include password-auth session required pam_loginuid.so session include password-auth
将 auth required pam_shells.so 注释掉即可