Ubuntu users disable shell logon and allow ftp Logon

Source: Internet
Author: User
Tags ftp login
A Ubuntu server has been installed recently and a dedicated ftp user needs to be created. To ensure security, ftp users are prohibited from logging on to the shell. According to freebsd's operating habits, I set the ftp user's shell to/usr/bin/nologin. Unexpectedly, the user could not log on to ftp. After changing the shell to/bin/bash, the ftp could log on again. Login cannot be disabled. There are many solutions, including disabling port 22, setting/etc/hosts. deny, or/etc/h.

A Ubuntu server has been installed recently and a dedicated ftp user needs to be created. To ensure security, ftp users are prohibited from logging on to the shell. According to freebsd's operating habits, I set the ftp user's shell to/usr/bin/nologin. Unexpectedly, the user could not log on to ftp. After changing the shell to/bin/bash, the ftp could log on again. Login cannot be disabled. There are many solutions, including disabling port 22, setting/etc/hosts. deny or/etc/hosts. allow. However, these methods have many limitations. The final reason is that/usr/bin/nologin is not in the/etc/shells list. During ftp login, check whether the user's shell settings are correct, I forcibly changed the shell to a non-existent/usr/bin/nologin, and an error occurred.

Solution: Modify/etc/shells and add a line/usr/bin/nologin to the shell list. Change the ftp user's shell to/usr/bin/nologin.

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.