FTP Service setup in Linux--3. Virtual users

Source: Internet
Author: User

Operating Environment

1 Operating system: Redhat 6.5

IP Address: 192.168.10.128

Host Name: zred

2 Operating system: Win 7

IP Address: 192.168.10.10

Verify that two hosts are interconnected.

Requirement: Add a virtual user to access FTP.

First, we restart the service.

Add a virtual account

Edit a file VUser

[Email protected] vsftpd]# Vim/etc/vsftpd/vuser

Write two users in

Convert the VUser into a database file for Pam identification

[Email protected] vsftpd]# db_load-t-t hash-f vuser vuser.db

Then modify the file permissions, you can enhance security, so as not to be seen by others.

Create a user to specify home directory for VUser/opt/vuser do not use shell login

[Email protected] vsftpd]# useradd-d/opt/vuser-s/sbin/nologin vuser

Edit Pam authentication module to support virtual user login

[Email protected] vsftpd]# Vi/etc/pam.d/vsftpd.vu

Add two sentences to go in

Auth Required pam_userdb.so Db=/etc/vsftpd/vuser//a will be lost
Account Required Pam_userdb.so db=/etc/vsftpd/vuser/* Here two files VUser is not a normal file but the Vuser.db database file that you just created, you must omit the do not write */

Edit Master profile, add Guest user's permission statement at last line

Guest_enable=yes
Guest_username=vuser
Pam_service_name=vsftpd.vu

Restart service, try to login

We can also specify a separate configuration folder

Insert at the end of the main configuration file:

User_config_dir=/etc/vsftpd/vu_dir/* Individual User Configuration folder */

Creating a configuration file

mkdir Vu_dir
Vi/etc/vsftpd/vu_dir/tom/* Create a user profile in the configuration folder */

anon_umask=022/* Specify permissions to upload files */

FTP Service setup in Linux--3. Virtual users

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.