Build an FTP server on Linux and set up local users to log on.

Source: Internet
Author: User
Tags ftp login

Reprint statement: If reproduced please indicate the source, otherwise will be held accountable.


    • First search for the presence of RPM packages: Rpm-qa|grep vsftpd

[Email protected] ~]# Rpm-qa|grep vsftpd

Vsftpd-2.2.2-21.el6.x86_64

    • Yum Installation


Yum Install vsftpd #如果出现错误有可能是python版本不对应导致,

Confirm/usr/bin/python Next version is how much, then Vim/usr/bin/yum will! #/usr/bin/python2.6 plus the version number, then the Yum installation.

    • [[email protected] ~]#/ETC/INIT.D/VSFTPD Restart restart FTP service


    • Modify the FTP configuration file

[[Email protected] ~] #vim/etc/vsftpd/vsftpd.conf

      • Anonymous_enable=no default is yes, modified to No, anonymous access forbidden

      • Local_enable=yes

      • Write_enable=yes

      • local_umask=022

      • Dirmessage_enable=yes

      • Xferlog_enable=yes

      • Connect_from_port_20=yes

      • Chown_uploads=yes

      • Ftpd_banner=welcome to blah FTP service.

      • Chroot_local_user=yes Remove comments, only access your home directory files

      • Chroot_list_enable=yes Remove Annotations

      • Chroot_list_file=/etc/vsftpd/chroot_list Remove Annotations

      • Listen=yes

      • listen_port=8899 listening port, can be modified according to their own needs, for security purposes to customize as well

      • Pam_service_name=vsftpd

      • Userlist_enable=yes

      • Tcp_wrappers=yes


      • max_clients=100

      • Max_per_ip=4

      • Userlist_deny=no Add this row non-userlist user not allowed to login

  • Create an FTP directory and give permissions

    [[Email protected] ~] #mkdir-P/var/ftp

[[Email protected] ~] #chmod 775/var/ftp

    • Create a user and set a password

        • [[Email protected] ~] #useradd-S/sbin/nologin-d/var/ftp/yunwei disable FTP login system

        • [[Email protected] ~] #passwd Yunwei

    • [[Email protected] ~] #sestatus-B | grep FTP View context to prevent home directories from being opened

    • [[Email protected] ~] #setsebool-P ftp_home_dir on


  1. Note: User_list users are not allowed to log in when Userlist_enable=yes Userist_deny=yes

  2. Userlist_enable=yes Userist_deny=no, user_list users can login browser, can not explorer login.

  3. All users in the Ftpuser file are not logged in, the FTP system is default and there is no switch control.

  4. Turn off the firewall or open the port


  5. Chroot_local_user=yes
    Chroot_local_user=no
    chroot_list_enable=yes 1. All users are limited to their home directory 2. Use the Chroot_list_file specified list of users as "exceptions", unrestricted 1. All users are not restricted to their home directory under 2. Use the user list specified by Chroot_list_file, which are restricted as "exceptions"
    Chroot_list_enable=no 1. All users are limited to their home directory 2. Do not use the user list specified by chroot_list_file, no "exception" users 1. All users are not restricted to their home directory under 2. Do not use the user list specified by chroot_list_file, no "exception" users


This article is from "You 70 years" blog, please be sure to keep this source http://chavaz.blog.51cto.com/6876806/1868384

Build an FTP server on Linux and set up local users to log on.

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.