|
[iyunv@iZ28ldgf0u6Z ~]#useradd -d /home/ftp yunwei2
[iyunv@iZ28ldgf0u6Z ~]#vim passwd.txt
[iyunv@iZ28ldgf0u6Z ~]#db_load -T -t hash -f ./passwd.txt /etc/vsftpd/passwd.db
[iyunv@iZ28ldgf0u6Z ~]#chmod 600 passwd.db 赋予权限
- 更改pam.d文件,默认其下已有vsftpd文件直接编辑更改
[iyunv@iZ28ldgf0u6Z ~]#vim /etc/pam.d/vsftpd 注释掉内的所有行添加如下两行
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/passwd
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/passwd
##确认是lib下还是lib64下,根据实际情况确定,中间是tab而非空格##
- anonymous_enable=NO
- local_enable=YES
- write_enable=YES
- local_umask=022
- dirmessage_enable=YES
- xferlog_enable=YES
- connect_from_port_20=YES
- chown_uploads=YES
- ftpd_banner=Welcome to blah FTP service.
- chroot_local_user=YES
- chroot_list_enable=YES
- chroot_list_file=/etc/vsftpd/chroot_list
- listen=YES
- pam_service_name=vsftpd pam文件名称要一致
- userlist_enable=YES
- tcp_wrappers=YES
- guest_enable=YES 开启虚拟用户
- guest_username=yunwei2 将虚拟用户映射到本地用户,和之上创建用户一致
- user_config_dir=/etc/vsftp/aaa 虚拟用户配置文件目录
- max_clients=100
- max_per_ip=4
- userlist_deny=YES
[iyunv@iZ28ldgf0u6Z ~]#cd /etc/vsftp/aaa && vim aaa
- local_root=/home/ftp
- write_enable=YES
- anon_umask=022
- anon_world_readable_only=NO
- anon_upload_enable=YES
- anon_mkdir_write_enable=YES
- anon_other_write_enable=YES
打开浏览器输入地址输入虚拟用户和密码即可
注意:此时无法使用资源管理器登陆
|
|