September 2019
M T W T F S S
« Aug    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Categories

WordPress Quotes

Nothing can stop the man with the right mental attitude from achieving his goal; nothing on earth can help the man with the wrong mental attitude.
Thomas Jefferson
September 2019
M T W T F S S
« Aug    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (268)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (1)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

29 visitors online now
4 guests, 25 bots, 0 members

Hit Counter provided by dental implants orange county

CentOS 6.8 ftp service installation and configuration based on local users and virtual users

CentOS 6.8 ftp service installation and configuration based on local users and virtual users

First, install ftp services

1, check whether the installation

# rpm -qa | grep ftp

ftp-0.17-54.el6.x86_64

vsftpd-2.2.2-21.el6.x86_64

2, if not installed to install

# yum -y install vsftp

# yum -y install ftp

/ / If the offline environment on the Internet to go ahead to download ftp rpm package for manual installation

3, ftp service command

# /etc/init.d/vsftpd start      Start the ftp service manually

service vsftpd start

# chkconfig vsftpd on           set to boot from the start

# service vsftpd stop

# service vsftpd restart

# service vsftpd status

Second, the allocation of ftp

1, configure the vsftpd configuration file

# vi /etc/vsftpd/vsftpd.conf

# Disable anonymous user anonymous login

anonymous_enable=NO

# Enable the local user to log in

local_enable=YES

# Make the logged-in user have write permission (upload, delete)

write_enable=YES

# Default umask

local_umask=022

# Save the log of the transfer log to /var/log/vsftpd.log

xferlog_enable=YES

xferlog_file=/var/log/vsftpd.log

xferlog_std_format=NO

# Enable ASCII mode

ascii_upload_enable=YES

# Enable the ASCII mode download

ascii_download_enable=YES

# Use port 20 to transmit data

connect_from_port_20=YES

# Welcome slogan

ftpd_banner=Welcome to use my test ftp server.

# The next three configurations are important
# Chroot_local_user set YES, then all users will be chroot by default,

# Also the user directory is limited to their own home, can not change the directory up.

# Chroot_list_enable Set YES to enable the chroot user list.

# If chroot_local_user is set to YES, then chroot_list_file

# Set the file, the user is not chroot (you can change the directory up)

# If chroot_local_user is set to NO, then chroot_list_file

# Set the file, the user is chroot (can not change the directory up)

chroot_list_enable=YES

# touch /etc/vsftpd/chroot_list New

chroot_list_file=/etc/vsftpd/chroot_list

use_localtime=YES

# Run on ipv4 in standalone mode

listen=YES

# PAM authentication service name, here is the default vsftpd, when the installation has been created vsftpd the pam file,

# In /etc/pam.d/vsftpd, according to the pam file settings, / etc / vsftpd / ftpusers

# File users will be prohibited from logging in ftp server, such as root so sensitive to the user, so you want to prohibit other users

# Log in, you can also add the user to /etc/vsftpd/ftpusers

pam_service_name=vsftpd

* Reboot vsftpd

# service vsftpd restart

Third, create a local user

Create a user

# useradd -d /home/ftpuser/zzp -s /sbin/nologin -M zzp123

Set the user to the folder

# chown -R username /home/ftpuser/zzp

Setting permissions

# chown -R 777 /home/ftpuser/zzp

Add a password

# passwd zzp

Fourth, create a virtual user

Install the Generating Tool for file-based authentication databases based on common files

# rpm -qa | grep db4-utils

# yum -y install db4-utils

Edit the virtual user account and password file, the odd-line user name, and even-action passwords

# vi /etc/vsftpd/vu.txt

test

1234

usernameN

passwordN

File-based database generation for authentication

# db_load -T -t hash -f /etc/vsftpd/vu.txt /etc/vsftpd/vu.db

Modify permissions

# chmod 600 /etc/vsftpd/vu.*

Modify the default VSFTP authentication mode, based on just generated file-based database

# vi /etc/pam.d/vsftpd.vu

auth      required  /lib64/security/pam_userdb.so db=/etc/vsftpd/vu

account  required  /lib64/security/pam_userdb.so db=/etc/vsftpd/vu

**note**:

1. The system acquiescence to read the document is /etc/pam.d/vsftpd This can also be added directly to the above content

2. 64-bit system may not recognize the path of pam_userdb.so db, it is necessary to write the full path, otherwise the time will be logged in ftp login login incorrect error 530

Create a system user that maps virtual users

# useradd  -d /home/vsftp/ftp -s /sbin/nologin -M vsftp

Create a virtual user profile directory

# mkdir /etc/vsftpd/conf.vu

Modify the VSFTP configuration file

# vi /etc/vsftpd/vsftpd.conf
anon_umask=022                                # file 644, folder 755
anonymous_enable=NO                      # Turn off anonymous logins
pam_service_name=vsftpd.vu               Modify the PAM authentication module (the system default is vsftpd)
guest_enable=YES                                # Allow the virtual user to log in
guest_username=vsftp                        # The system user who mapped the virtual user
user_config_dir=/etc/vsftpd/conf.vu    # The virtual user profile directory
pasv_enable=YES                                 # Passive mode
pasv_max_port=20999                        # Maximum port
pasv_min_port=20000                          # minimum port
xferlog_enable=YES
xferlog_std_format=YES
xferlog_file=/var/log/xferlog                # Log: record upload, download, delete, create
dual_log_enable=YES
vsftpd_log_file=/var/log/vsftpd.log       # Log: Server transfer log

Create the virtual user’s directory and configuration file

# mkdir /home/vsftp/ftp/username
# chmod 700 /home/vsftp/ftp/username
# chown vsftp.vsftp /home/vsftp/ftp/username
# vi /etc/vsftpd/conf.vu/username
write_enable=YES                        # The current virtual user write permission
anon_world_readable_only=NO               # Current virtual user download permissions
anon_upload_enable=YES                  # The current virtual user upload privilege
anon_mkdir_write_enable=YES             # Create the directory permissions for the current virtual user
anon_other_write_enable=YES              # Delete and rename permissions for the current virtual user
local_root=/bigdisk/ftp/username1       # Current virtual home directory
# chmod 600 /etc/vsftpd/conf.vu/*

Finally restart vsftpd

# service vsftpd restart

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam