Ways to allow FTP users to log in and disable shell logons

Source: Internet
Author: User
Tags ftp login

Recently installed VSFTPD to do FTP service, found that the system user login shell is set to/sbin/nologin, you cannot use the FTP service. Online data said that VSFTPD will be for each FTP login user to check the corresponding login shell in/etc/shells, so you need to add a line of/sbin/nologin. But I/etc/shells the document clearly has/sbin/nologin.

[Plain]View PlainCopy
  1. [Email protected] ~]# vsftpd-v
  2. Vsftpd:version 2.2.2
  3. [Email protected] ~]# Cat/etc/shells
  4. /bin/sh
  5. /bin/bash
  6. /sbin/nologin
  7. /bin/tcsh
  8. /bin/csh

However, the user set/sbin/nologin, will not login, error is as follows

[Plain]View PlainCopy
  1. Oops:cannot Change Directory:/home/xxx
  2. Oops:priv_sock_get_cmd
  3. The remote host shuts down the connection.

So look at the vsftpd generated by the FTP user Configuration, is also/sbin/nologin, why he can log in? (I allow anonymous users to log in), as follows

[Plain]View PlainCopy
  1. [Email protected] ~]# CAT/ETC/PASSWD | grep FTP
  2. Ftp:x:14:50:ftp User:/var/ftp/pub/:/sbin/nologin

Found the only difference is that the specified home directory is not the same, so I put the user's home directory/home/xxx replaced/var/ftp/pub/, sure enough to successfully login!

Resources:

1, http://www.linuxidc.com/Linux/2008-06/13712.htm




From for notes (Wiz)

Ways to allow FTP users to log in and disable shell logons

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.