Add an FTP user in Linux and set the permissions to add an ftp user in linux, and set the corresponding permissions as follows:
1. Environment: ftp is vsftp. The Restricted User Name is test. The restricted path is/home/test2. Create a user: Under the root user, add useradd-d/home/test/to add the user test, set/home/testpasswd test // as the main directory of the test user. 3. Change the user's permission settings:
Usermod-s/sbin/nologin test // user test cannot be telnet, only ftpusermod-s/sbin/bash test // user test can be restored to normal usermod-d/test // change the main directory of user test to/test
4. restrict user access to/home/test only. Do not access other paths. Modify/etc/vsftpd. conf: www.2cto.com chroot_list_enable = YES // restrict access to its own directory # (default follows) chroot_list_file =/etc/vsftpd. chroot_list edit vsftpd. add the Restricted Users to the chroot_list file. Change the configuration file for each user name line. Do not forget to restart the vsFTPd server [root @ linuxsir001 root] #/etc/init. d/vsftpd restart5. If you need to allow the user to change the password, but do not have the permission to log on to the system via telnet: usermod-s/usr/bin/passwd test // After user telnet, the password change interface is directly displayed.
Author aking21alinjuju