Ubuntu prohibits users from using telnet and ssh to log on to allow FTP

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.