How Linux creates users and configures FTP permissions

Source: Internet
Author: User

Linux to create users is very easy things, but do not often to do these operations, a long time to easily forget, conveniently configure FTP. Disclaimer: Use Linux version release 5.6 and run as Super Administrator root.

1. Create a user and specify a group and home directory

useradd-d/home/lch-g Root LCH

You can also add other parameters, such as specifying the user to use the shell, etc., specific Google

2. Set the password

passwd LCH

3. View, change, add user groups

[Root@localhost ~]# groups LCH

Lch:root www

#-G Change grouping

[root@localhost ~]# usermod-g Root LCH

[Root@localhost ~]# groups LCH

Lch:root

# G New Group

[root@localhost ~]# usermod-g www lch

[Root@localhost ~]# groups LCH

Lch:www Root

4. Delete User

# Plus-r parameter, delete more thorough

Userdel-r LCH

To change the FTP configuration file

Modify the configuration file/etc/vsftpd/vsftpd.conf and set or delete the annotation:

Userlist_enable=no

Anonymous_enable=no

Chroot_list_enable=yes

Chroot_list_file=/etc/vsftpd/chroot_list

Open/etc/vsftpd/user_list and add one line:

Lch

Create a new file/etc/vsftpd/chroot_list and add a row

Lch

To configure user FTP permissions and access path limits:

At this time with Usertest login system FTP, can access? If it is not accessible, we have limited FTP. Open/etc/vsftpd/vsftpd.conf to find userlist_enable, Userlist_deny, Userlist_file. If Userlist_deny=no: Only allow users in Userlist_file files to access FTP, and if the users listed in Userlist_deny=yes:userlist_file files cannot access the system through FTP. Userlist_enable is the switch for this function. Our system configuration is as follows:

Userlist_enable=yes

Userlist_deny=no

Userlist_file=/etc/vsftpd/user_list

So you need to add users to the/etc/vsftpd/user_list file, one line per user.

Since the home directory is built by the MPSP user, Usertest is a member of the MPSP group, so usertest default has the ability to delete and modify permissions, and Usertest as a member of the MPSP group, has access to all paths under/HOME/MPSP (depending on the permissions set for each directory, By default, when you log on to FTP, you will find that usertest users have access to other directories and have MPSP group permissions, which is not allowed, and we need to control the access scope of usertest users in their home directory. The method is as follows:

1. CD/ETC/VSFTPD into FTP profile directory

2. VI vsftpd.conf edit this file, find the #chroot_list_enable=yes, delete the previous #, indicating that the limit function is turned on

Find Chroot_list_file:chroot_list_file=/etc/vsftpd/chroot_list

3. Edit the Chroot_list file, add the username you want to restrict, and a line of users.

If you have updated vsftpd.conf, be sure to restart the FTP command as follows:

[Root@linux sir001 root]#/etc/init.d/vsftpd Restart

Close vsftpd:[OK]

Start vsftpd:[OK for VSFTPD]

Start the FTP service

Service VSFTPD Start

There are two other parameters: stop, restart

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.