vsftp配置ftp服务
yum install -y vsftpd db4-utils
建立虚拟账号相关联的系统账号 useradd virftp -s /sbin/nologin
建立虚拟账户相关的文件 vim /etc/vsftpd/vsftpd_login //内容如下:
hishare
hishare
cgfae
cgfae
zhongjiangguoji
zhongjiangguoji
chmod 600 /etc/vsftpd/vsftpd_login
生成对应的库文件 db_load -T -t hash -f /etc/vsftpd/vsftpd_login /etc/vsftpd/vsftpd_login.db
建立虚拟账号相关的目录以及配置文件 mkdir /etc/vsftpd/vsftpd_user_conf
cd /etc/vsftpd/vsftpd_user_conf 创建和用户对应的配置文件
vim hishare 内容如下:
local_root=/home/exchangeftp/edmp/ftpdata/34400001
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=50000
-----------------------------------
vim cgfae 内容如下:
local_root=/home/exchangeftp/edmp/ftpdata/34100001
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=50000
---------------------
vim zhongjiangguoji 内容如下:
local_root=/home/exchangeftp/edmp/ftpdata/33500001
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=50000
mkdir -p /home/exchangeftp/edmp/ftpdata/34400001
mkdir -p /home/exchangeftp/edmp/ftpdata/34100001
mkdir -p /home/exchangeftp/edmp/ftpdata/33500001
修改权限: chown -R virftp:virftp /home/exchangeftp/edmp/ftpdata/*
chmod -R 777 /home/exchangeftp/edmp/ftpdata/
vim /etc/pam.d/vsftpd 在最开头添加两行
auth sufficient /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login //如果是64位系统,则改为/lib64/security/pam_userdb.so
account sufficient /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login //如果是64位系统,则改为/lib64/security/pam_userdb.so
再修改/etc/vsftpd.conf
vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES改为anonymous_enable=NO
#anon_upload_enable=YES 改为 anon_upload_enable=NO
#anon_mkdir_write_enable=YES 改为 anon_mkdir_write_enable=NO
再增加:
chroot_local_user=YES
guest_enable=YES
guest_username=virftp
virtual_use_local_privs=YES
user_config_dir=/etc/vsftpd/vsftpd_user_conf