步骤如下:
1. 进入目录/etc/vsftpd,创建文件myserver.conf,内容如下
pam_service_name=myserver
anonymous_enable=NO
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
virtual_use_local_privs=YES
chroot_local_user=YES
guest_enable=YES
guest_username=appache
listen=YES
listen_prot=5909
user_sub_token=$USER
local_root=/home/dir/$USER
pasv_min_port=30000
pasv_max_port=30999
xferlog_enable=YES
2.创建文件/etc/pam.d/myserver,内容如下:
auth required pam_userdb.so db=/etc/vsftpd/myserveruser
account required pam_userdb.so db=/etc/vsftpd/myserveruser
3.在目录/etc/vsftpd下创建用户名-密码映射文件
myserveruser_map.txt,内容为:
user1
password1
user2
password2
4.产生帐号数据库,供PAM读取,命令为:
db_load -T -t hash -f myserveruser_map.txt myserveruser.db
5.创建目录/home/dir/$USER,并执行命令:
chmod 777 /home/dir/$USER
6.重启vsftpd./etc/init.d/vsftpd restart
阅读(868) | 评论(0) | 转发(0) |