Currently, we are testing to set up a virtual host system. We need to log on via FTP because my system is Ubuntu. If we use useradd to add a user and modify the user's shell to false or nologin, in this way, you cannot use telnet or ssh, and you cannot log on to ftp. The following solution prevents Logon Through telnet or ssh, but you can use ftp to log on, take vsftpd as an example: 1. Modify/etc/pam. d/vsftpd verification module # Stand
Currently, we are testing to set up a virtual host system. We need to log on via FTP because my system is Ubuntu. If we use useradd to add a user and modify the user's shell to false or nologin, in this way, you cannot use telnet or ssh, and you cannot log on to ftp. The following solution prevents Logon Through telnet or ssh, but you can use ftp to log on, take vsftpd as an example:
1. Modify the verification module of/etc/pam. d/vsftpd.
# Standard behaviour for ftpd (8 ).
Auth required pam_listfile.so item = user sense = deny file =/etc/ftpusers onerr = succeed
# Note: vsftpd handles anonymous logins on its own. Do not enable
# Pam_ftp.so.
# Standard blurb.
@ Include common-account
@ Include common-session
@ Include common-auth
# Auth required pam_shells.so
Cancel auth required pam_sheels.so Verification
2. Modify the/etc/vsftpd. conf file and add check_shell = NO to the vsftpd file.
3. Modify the shell of/etc/passwd to false or nologin, and restart/etc/init. d/vsftpd.
Of course, you can also modify wp26: x: 1002: 1002:/home/vhost/wp26: at the end of/bin/false,/bin/false is/usr/bin/passwd, allowing users to only change their passwords when logging on to the system.