查看VSFTP Quick Start的源代码
←
VSFTP Quick Start
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== 添加新用户 == ;;Create the system user (workers) and the work directory (/home/work) to be used by the virtual users in vsftpd where they will upload their work in it: <source lang=bash> $ sudo useradd -d /home/work workers $ sudo mkdir /home/work $ sudo chown workers /home/work </source> ;;Create directories to save the virtual users definitions: <source lang=bash> $ sudo mkdir /etc/vsftpd $ sudo mkdir /etc/vsftpd/vusers </source> ;;Edit the default /etc/vsftpd.conf: <source lang=bash> # Disable anonymous_enable is optional. anonymous_enable=NO ... local_enable=YES ... pam_service_name=ftp </source> Enable TLS/SSL/FTPS: <source lang=bash> ssl_enable=YES allow_anon_ssl=NO force_local_data_ssl=YES force_local_logins_ssl=YES ssl_tlsv1=YES ssl_sslv2=YES ssl_sslv3=YES # Filezilla uses port 21 if you don't set any port # in Servertype "FTPES - FTP over explicit TLS/SSL" # Port 990 is the default used for FTPS protocol. # Uncomment it if you want/have to use port 990. #listen_port=990 </source> ;;In the end of the file and add: <source lang=bash> # Enable (only) guests. guest_enable=YES # This is not needed, it's the default. Just here for clarity. guest_username=ftp # Where the guests (virtual) usernames are set. user_config_dir=/etc/vsftpd/vusers </source> ;;Create the new file /etc/pam.d/ftp for the new authentication system: <source lang=bash> auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login </source> ;;Create a file with the virtual usernames and passwords that can login (one line for username, one line for password and so on for all the users) and call it "logins.txt": <source lang=bash> gump gump_password riffsolo riffsolo_password </source> ;;Install db-util, create the login database with the file logins.txt and restrict permissions to the database: <source lang=bash> sudo apt-get install db-util sudo db_load -T -t hash -f logins.txt /etc/vsftpd/vsftpd_login.db sudo chmod 600 /etc/vsftpd/vsftpd_login.db # This is not safe, you should delete this file. sudo chmod 600 logins.txt </source> ;;Create a file for the workers settings (gump and riffsolo on logins.txt): sudo nano /etc/vsftpd/workers Add the new definitions for this users (remember that virtual users are treated as anonymous users by default on vsftpd, default anonymous settings are set on /etc/vsftpd.conf): <source lang=bash> write_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES anon_upload_enable=YES local_root=/home/work chroot_local_user=YES dirlist_enable=YES download_enable=YES guest_username=workers </source> ;;Link this file to the workers usernames in /etc/vsftpd/vusers/, so that any change made at /etc/vsftpd/workers is applied to all workers (after you restart vsftpd). <source lang=bash> sudo ln -s /etc/vsftpd/workers /etc/vsftpd/vusers/gump sudo ln -s /etc/vsftpd/workers /etc/vsftpd/vusers/riffsolo </source> ;; Restart vsftpd <source lang=bash> $ sudo /etc/init.d/vsftpd restart </source> <br><br>
返回到
VSFTP Quick Start
。
个人工具
3.16.30.145
该IP地址的讨论
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面