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