How Linux creates an FTP server-modifies the user's default directory

Source: Internet
Author: User

1, Environment:FTP for VSFTP. The user named Test is restricted. The restricted path is/home/test

2, build the User: under the root user:

useradd-d/home/test Test//Add user test and make test user's home directory as/home/test

If the directory already exists, there will be a prompt, but does not affect the user's permission to login
passwd test//Set a password for test

3, change the user's corresponding permission settings:

Usermod-s/sbin/nologin test//Limit user test cannot telnet, FTP only
Usermod-s/sbin/bash Test//user test returned to normal
usermod-d/test Test//change user test's home directory to/test

4, restrict the user to access only/home/test, cannot access other paths

Modify the/etc/vsftpd/vsftpd.conf as follows:

Chroot_list_enable=yes//Restrict access to own directory
# (default follows)
Chroot_list_file=/etc/vsftpd/vsftpd.chroot_list

Edit the Vsftpd.chroot_list file to add restricted users, one row per user name

Do not forget to restart the VSFTPD server after changing the configuration file
[Email protected] root]#/etc/init.d/vsftpd restart

5, if you need to allow users to change the password, but do not have Telnet login system permissions:

Usermod-s/usr/bin/passwd Test//user Telnet will go directly to the change interface

  • Finally, restart the services: Service VSFTPD start

    If a startup failure occurs, you can use:/etc/rc.d/init.d/vsftpd restart

  • Successfully linked on the FTP server.

  • How Linux creates an FTP server-modifies the user's default directory

    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.