Linux/CentOS add/remove FTP users and set permissions

  
 

Add ftp user in linux, and set the corresponding permissions, the operation steps are as follows:

1. Environment: ftp is vsftp. The user name is set to test. The restricted path is /alidata/www/test

2. Create user: under root user:

useradd -d /alidata/www/test test //Add user test and make The test user's home directory is /alidata/www/test

passwd test Set the password for the test user

3. Change the user's corresponding permission settings:

usermod -s /Sbin/nologin test //Limit user test can not telnet, only ftp

usermod -s /sbin/bash test //User test returns to normal

usermod -d /test test //Change The home directory of the user test is /test

4. Restrict users from accessing /home/test and cannot access other paths

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

chroot_list_enable=YES //Restrict access to its own directory

# (default follows)

chroot_list_file=/etc/vsftpd/vsftpd.chroot_list

Edit vsftpd.chroot_list file , add restricted users, one line per user name

Change the configuration file, don't forget to restart the vsFTPd server

[root@localhost]# /etc/init.d/vsftpd Restart

5. If you need to allow the user to change the password, but Have telnet login system permissions:

usermod -s /usr/bin/passwd test //Users will go directly to the modified interface after telnet

6. If you want to delete the user, use the following code :

userdel test //userdel + Users can delete ftp users

Copyright © Windows knowledge All Rights Reserved