Linux FTP Create virtual users and Change permissions

Source: Internet
Author: User

1th Step
Go to Catalog

Cd/etc/vsftpd/vim vuser.list

Singular behavior account number, dual-action password.

111111111222222222

Using the Db_load command to generate FTP user database files with hash algorithm

Vuser.db:dbload-t-T hash-f vuser.list vuser.db

To view files:

File vuser.db

FTP Grants permissions:

chmod vuser.db

2nd Step
Create the user virtual and set it to not allow logging on to the system and define the user's home directory:

useradd-d/var/ftproot-s/sbin/nologin Virtual

To ensure that other users can access, give Rwxr-xr-x permissions:

CHMOD-RF 755/var/ftproot/

3rd Step: Establish a PAM authentication file that supports virtual users.

Vim/etc/pam.d/vsftpd.vu

The parameter db is used to point to the vuser.db file that was just generated

auth       required     pam_userdb.so db=/etc/vsftpd/vuseraccount    required     pam_userdb.so db=/etc/vsftpd/vuser

4th Step: Add the support configuration in the vsftpd.conf file.

Vi/etc/vsftpd/vsftpd.conf

Anonymous_enable=no
Local_enable=yes
Guest_enable=yes
Guest_username=virtual
Pam_service_name=vsftpd.vu
Allow_writeable_chroot=yes

Write_enable=yes
local_umask=022
Dirmessage_enable=yes
Xferlog_enable=yes
Connect_from_port_20=yes
Xferlog_std_format=yes
Listen=no
Listen_ipv6=yes
Userlist_enable=yes
Tcp_wrappers=yes

User_config_dir=/etc/vsftpd/vusers_dir

5th step: Set different permissions for the virtual user.

Specify the directory where the user independent permission profile resides:

Vim/etc/vsftpd/vsftpd.conf (User_config_dir=/etc/vsftpd/vusers_dir)

Create a directory where the user-independent permission profile resides:

mkdir/etc/vsftpd/vusers_dir/

Switch to enter the directory:

cd/etc/vsftpd/vusers_dir/

Create a blank 111

The configuration file:

Touch 111

Specify specific permissions for 222 users:

Vim 222

Anon_mkdir_write_enable=yes
Anon_other_write_enable=yes
6th step: Restart the VSFTPD service to verify the experimental results.
Systemctl Start VSFTPD
Systemctl Enable VSFTPD
Verify the permissions of the above two users on the client.
111 users cannot create folders, 222 users can create folders

~~

Linux FTP Create virtual users and Change permissions

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.