ftp server setup

vsftpd installation configuration
############################################## #######3
yum install vsftpd
rpm -qa |grep vsftpd
yum -y install vsftpd
chkconfig vsftpd on
/etc/init.d/vsftpd start
################ ######################################
Configuration file
vim /etc/vsftpd/vsftpd.conf

anonymous_enable =NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
xferlog_file=/var/log/
xferlog dual_log_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
connect_from_port_20=YES
xferlog_std_format=YES
ascii_upload_enable=YES
ascii_download_enable=YES
listen=YES
pasv_enable =YES
pasv_min_port=40000
pasv_max_port=
40080 pasv_promiscuous=YES
pam_service_name=vsftpd.vu
guest_enable=YES
guest_username=evtadmin
user_config_dir=/etc/vsftpd/user_conf
chroot_list_enable=NO
chroot_local_user=YES
#deny_file={*.png,*.bmp,. private}
deny_file={*.bmp,.private}

for authentication First, install the Berkeley DB tool. The problem that many people can't find db_load is that this package is not installed.
yum install db4 db4-utils
creates a password file /etc/vsftpd/vuser_passwd.txt (odd lines are accounts, even lines are passwords)
always
123456
generates a db password file with a file permission of 600
db_load -T -t hash -f /etc/ vsftpd/vuser_passwd.txt /etc/vsftpd/vuser_passwd.db

Then, edit the authentication file /etc/pam.d/vsftpd, comment out all the original sentences, and add the following two sentences:
auth required pam_userdb.so db=/etc/vsftpd/vuser_passwd
account required pam_userdb.so db=/etc/vsftpd/vuser_passwd

Finally create a directory file for virtual users
mkdir /etc/vsftpd/vuser_conf/
touch always local_root
=/data/work/ web/links
write_enable=YES
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
virtual_use_local_privs=YES
/data/work/web/ directory can be given 755 permissions
/data/work/web/links directory can be given 777 permissions











































Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324457351&siteId=291194637