vsftpd安装配置说明

阅读更多

1. wget  ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.2.tar.gz
2. tar  -xvzf vsftpd-2.2.2.tar.gz
3. cd  vsftpd-2.2.2
4. make
5. make install
6. 根据情况将如下内容修改后,保存为/etc/vsftpd.conf

引用

# disables anonymous FTP
anonymous_enable=NO

# enables non-anonymous FTP
local_enable=YES

# activates virtual users
guest_enable=YES
#guest_username=ftp

# virtual users to use local privs, not anon privs
virtual_use_local_privs=YES

# enables uploads and new directories
write_enable=YES

# disable downloads
download_enable=NO

# the PAM file used by authentication of virtual uses
pam_service_name=vsftpd-virtual

# in conjunction with 'local_root',
# specifies a home directory for each virtual user
user_sub_token=$USER
local_root=/home/pub/uploads/$USER # ftp server的上传根目录在这儿指定

# the virtual user is restricted to the virtual FTP area
chroot_local_user=YES

# hides the FTP server user IDs and just display "ftp" in directory listings
hide_ids=YES

# runs vsftpd in standalone mode
listen=YES

# listens on this port for incoming FTP connections
listen_port=21

# the minimum port to allocate for PASV style data connections
pasv_min_port=62222

# the maximum port to allocate for PASV style data connections
pasv_max_port=63333

# controls whether PORT style data connections use port 20 (ftp-data)
connect_from_port_20=YES

# the umask for file creation
local_umask=022



7. yum install db4-utils
8. touch /etc/virtual-users.txt
9. db_load -T -t hash -f /etc/virtual-users.txt /etc/virtual-users.db
10. 将如下内容保存为/etc/pam.d/vsftpd-virtual

auth required pam_userdb.so db=/etc/virtual-users
account required pam_userdb.so db=/etc/virtual-users

11. vsftpd &


注:
1. virtual-users.txt的格式:第一行是用户名,第二行是密码,以此类推
2. 如果需要测试,可以在virtual-users.txt中添加虚拟用户,并使用第9步中的命令生成新的virtual-users.db

你可能感兴趣的:(F#)