yum install db4 db4-utils
---------------------------------------------------
yum install vsftpd
---------------------------------------------------
vim /etc/pam.d/vsftpd.vu
auth required pam_userdb.so db=/etc/vsftpd/login
account required pam_userdb.so db=/etc/vsftpd/login
---------------------------------------------------
touch /etc/vsftpd/login.db
---------------------------------------------------
vim /etc/vsftpd/vsftpd.conf
#Add
#mima de pei zhi wen jian
pam_service_name=vsftpd.vu
userlist_enable=YES
tcp_wrappers=YES
#mo ren duan kou hao
listen_port=21
max_clients=500
chroot_local_user=YES
guest_enable=YES
#yonghu zu
guest_username=www
anon_world_readable_only=NO
download_enable=NO
#yonghu guan li de wen jian
user_config_dir=/etc/vsftpd/vuuser/
pasv_enable=yes
pasv_min_port=50000
pasv_max_port=60000
--------------------------------------
cd
vim login.txt
niuxiaosaiusername
niuxiaosaipassword
-------------------------------------------------------
mkdir /etc/vsftpd/vuuser/
vi niuxiaosaiusername
download_enable=YES
anon_max_rate=100000000
max_per_ip=5
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
anon_mkdir_write_enable=YES
local_root=/www
-------------------------------------
db_load -T -t hash -f login.txt /etc/vsftpd/login.db
-------------------------------------------------------
getsebool -a | grep ftp (查看当前selinux与vsftpd相关的状态)
setsebool ftpd_disable_trans 1 (vsftpd 6.2可以使用这个命令,新版本的vsftpd 不好用)
setsebool allow_ftpd_full_access 1
setsebool ftp_home_dir 1
setsebool ftpd_connect_db 1
setsebool ftpd_use_fusefs 1
setsebool ftpd_use_passive_mode 1
service vsftpd restart
操作命令
-------------------------------------------------------
vim ~/login.txt
#首先在login.txt 文件中添加ftp账号的用户名和密码,奇数行为账号,偶数行为密码。
-------------------------------------------------------
db_load -T -t hash -f ~/login.txt /etc/vsftpd/login.db
#将login.txt 文件中的账号和密码加载的login.db库中
-------------------------------------------------------
cd /etc/vsftpd/vuuser/
#打开这个目录,设定账号的ftp权限等设置
-------------------------------------------------------
vim username
#创建和ftp账号名相同的文件冰填入以下代码
download_enable=YES
anon_max_rate=100000000
max_per_ip=5
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
anon_mkdir_write_enable=YES
local_root=/www #权限目录
-------------------------------------------------------
c3949ba59abbe56e057f
--------------------------------------------------------------
更新小丁新的FTP配置, 可提升FTP速度
rm -f /etc/vsftpd/vsftpd.conf
vim /etc/vsftpd/vsftpd.conf
listen=YES
listen_port=21
anonymous_enable=NO
use_localtime=YES
local_enable=YES
write_enable=YES
local_umask=022
#anon_umask=022
dirmessage_enable=NO
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=NO
idle_session_timeout=180
data_connection_timeout=120
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to XiAo'D FTP service.
userlist_enable=YES
tcp_wrappers=YES
log_ftp_protocol=YES
guest_enable=YES
guest_username=www
anon_world_readable_only=NO
download_enable=NO
pam_service_name=vsftpd.vu
user_config_dir=/etc/vsftpd/vuuser/
chroot_local_user=YES
pasv_enable=YES
pasv_min_port=50000
pasv_max_port=60000
---------------------------------------------------
yum install vsftpd
---------------------------------------------------
vim /etc/pam.d/vsftpd.vu
auth required pam_userdb.so db=/etc/vsftpd/login
account required pam_userdb.so db=/etc/vsftpd/login
---------------------------------------------------
touch /etc/vsftpd/login.db
---------------------------------------------------
vim /etc/vsftpd/vsftpd.conf
#Add
#mima de pei zhi wen jian
pam_service_name=vsftpd.vu
userlist_enable=YES
tcp_wrappers=YES
#mo ren duan kou hao
listen_port=21
max_clients=500
chroot_local_user=YES
guest_enable=YES
#yonghu zu
guest_username=www
anon_world_readable_only=NO
download_enable=NO
#yonghu guan li de wen jian
user_config_dir=/etc/vsftpd/vuuser/
pasv_enable=yes
pasv_min_port=50000
pasv_max_port=60000
--------------------------------------
cd
vim login.txt
niuxiaosaiusername
niuxiaosaipassword
-------------------------------------------------------
mkdir /etc/vsftpd/vuuser/
vi niuxiaosaiusername
download_enable=YES
anon_max_rate=100000000
max_per_ip=5
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
anon_mkdir_write_enable=YES
local_root=/www
-------------------------------------
db_load -T -t hash -f login.txt /etc/vsftpd/login.db
-------------------------------------------------------
getsebool -a | grep ftp (查看当前selinux与vsftpd相关的状态)
setsebool ftpd_disable_trans 1 (vsftpd 6.2可以使用这个命令,新版本的vsftpd 不好用)
setsebool allow_ftpd_full_access 1
setsebool ftp_home_dir 1
setsebool ftpd_connect_db 1
setsebool ftpd_use_fusefs 1
setsebool ftpd_use_passive_mode 1
service vsftpd restart
操作命令
-------------------------------------------------------
vim ~/login.txt
#首先在login.txt 文件中添加ftp账号的用户名和密码,奇数行为账号,偶数行为密码。
-------------------------------------------------------
db_load -T -t hash -f ~/login.txt /etc/vsftpd/login.db
#将login.txt 文件中的账号和密码加载的login.db库中
-------------------------------------------------------
cd /etc/vsftpd/vuuser/
#打开这个目录,设定账号的ftp权限等设置
-------------------------------------------------------
vim username
#创建和ftp账号名相同的文件冰填入以下代码
download_enable=YES
anon_max_rate=100000000
max_per_ip=5
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
anon_mkdir_write_enable=YES
local_root=/www #权限目录
-------------------------------------------------------
c3949ba59abbe56e057f
--------------------------------------------------------------
更新小丁新的FTP配置, 可提升FTP速度
rm -f /etc/vsftpd/vsftpd.conf
vim /etc/vsftpd/vsftpd.conf
listen=YES
listen_port=21
anonymous_enable=NO
use_localtime=YES
local_enable=YES
write_enable=YES
local_umask=022
#anon_umask=022
dirmessage_enable=NO
xferlog_enable=YES
connect_from_port_20=YES
xferlog_file=/var/log/vsftpd.log
xferlog_std_format=NO
idle_session_timeout=180
data_connection_timeout=120
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to XiAo'D FTP service.
userlist_enable=YES
tcp_wrappers=YES
log_ftp_protocol=YES
guest_enable=YES
guest_username=www
anon_world_readable_only=NO
download_enable=NO
pam_service_name=vsftpd.vu
user_config_dir=/etc/vsftpd/vuuser/
chroot_local_user=YES
pasv_enable=YES
pasv_min_port=50000
pasv_max_port=60000