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