vsftp2.2.2 deployment steps

A, vsftp Profile

  vsftpd is a Linux distribution in the most respected FTP server program, vsftpd name stands for "very secure FTP daemon"; is a name-based server running on the GPL release of UNIX-like operating system (a guardian process), you can run, such as Linux, BSD, Solaris, HP-UX, and Irix systems above.
#basic needs:

 Setting up an ftp (each individual account)

2. Deploy the web service (nginx not installed here explained), access ftp upload directory
3. To achieve access tour ftp upload directory static files

Second, the installation vsftp

FTP login generally three ways:

1. anonymous user form: the case of a default installation, the system only provides access to anonymous users only need to enter a user anonymous / ftp, and Email as their password to log in.

2. Local User form: in / etc / passwd called user authentication.

3. The virtual user form: Supports user name and password stored in a file or database, mapped to the logged-on user specified system account (/ sbin / nologin) to access resources, where these users are virtual FTP users

This article take the third way: the user in the form of a virtual installation vsftp

1. Installation vsftp, the authentication module and the database

yum install vsftpd pam* db4* -y

2. The establishment of virtual users, set the directory to be accessed by the user, and set permissions for the virtual user access:

#useradd -d /home/ftpsite virtual_user
#chmod 700 /home/ftpsite
After setting this step, / home / ftpsite is virtual_user the user's home directory, the user is also ftpsite owner of the directory. In addition to the root user, the user has only to read the directory, write, and execute permissions.

3. Create a virtual user of PAM file. Add the following two lines:

#vi /etc/pam.d/ vsftp.vu
auth required /lib64/security/ pam_userdb.so db=/etc/vsftpd/account
account required /lib64/security/ pam_userdb.so db=/etc/vsftpd/account

4. /etc/vsftpd/vsftpd.conf backup, the backup is complete, the file editing /etc/vsftpd/vsftpd.conf, so the entire file contents are as follows (Note contents removed):

anonymous_enable=NO
local_enable=YES
local_umask=022
anon_umask=022
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
xferlog_file=/var/log/xferlog
dual_log_enable=YES
vsftpd_log_file=/var/log/vsftpd.log

 

listen=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
one_process_model=NO
chroot_local_user=YES
ftpd_banner=Welcom to my FTP server.
anon_world_readable_only=NO
guest_enable=YES
guest_username=virtual_user
pam_service_name= vsftp.vu
user_config_dir=/etc/vsftpd/vconf
use_localtime=YES
The above code, guest_enable = YES representation to enable virtual users; guest_username = virtual sucked virtual user mapped to a local user, after the user logs in order to enter this virtual user virtual local directory / ftpsite; pam_service_name = vsftp.vu designated PAM configuration file as vsftp.vu .

The virtual user's personal directory settings

Add a name to the virtual user name in the / etc / vsftpd / vconf directory files are as follows
#vi dk_cuishou

 

local_root=/home/jyapp/localCase
anonymous_enable=NO
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
idle_session_timeout=600
data_connection_timeout=120
max_clients=10
max_per_ip=5
local_max_rate=5000
Description: local_root = / home / jyapp / localCase this directory must exist, if there is no need to create too, need to change the directory after the completion of the new user belongs to virtual_user, execute the following command:
# chown virtual_user:virtual_user /home/jyapp/localCase

6. Generate virtual library user password file. In order to establish this password database file, first generate a text file. The format of this file is as follows, the singular behavior of the user name, password even number of acts:

New File account.txt in the / etc / vsftpd directory
#vi account.txt
 
dk_cuishou
4321dk
Consistent user names here, and be sure to add step 5 Username: explanation! ! !

7. Generate password database file, and modify its permissions:

#db_load -T -t hash -f /etc/vsftpd/account.txt /etc/vsftpd/account.db
#chmod 600 /etc/vsftpd/account.db

8. Restart VSFTP:

#service vsftpd restart
 

note

Third, add an FTP user steps

Repeat steps 5-7 to use, without having to restart vsftp service, after completion of the addition can use the account to log about

Guess you like

Origin www.cnblogs.com/pigonthetree/p/12410419.html