CentOS系統vsftpd快速配置詳解教程

來源:互聯網
上載者:User


說明:基於本機使用者 nginx 的虛擬FTP使用者的 vsftpd 配置。

yum install vsftpd 之後:

清空 vsftpd.conf,寫入以下內容:

listen=YES
ftpd_banner=Technical-Support:QQ:252872160 Email:root@upall.cn
anonymous_enable=NO
local_enable=YES
local_umask=022
guest_enable=YES
guest_username=nginx
userlist_enable=YES
user_config_dir=/etc/vsftpd/vusers
dirmessage_enable=YES
xferlog_enable=YES
xferlog_std_format=YES
pam_service_name=vsftpd
connect_from_port_20=YES
tcp_wrappers=YES
pasv_enable=YES
pasv_min_port=5000
pasv_max_port=5500

FTP帳號的許可權,檔案名稱是FTP帳號:/etc/vsftpd/vusers/ftpUser

local_root=/data/web/ftpUser

anon_umask=077
write_enable=YES
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES

FTP帳號:/etc/vsftpd/vusers.txt


ftpUser

ftpPassword

用於添加FTP帳號的指令碼:/etc/vsftpd/makeFtpDb.sh

#!/bin/bash
db_load -T -t hash -f /etc/vsftpd/vusers.txt /etc/vsftpd/vusers.db
chmod 600 /etc/vsftpd/vusers.db
./makeFtpDb.sh 執行後會產生 vusers.db

全部注釋,只添加下邊的兩行:/etc/pam.d/vsftpd

##%PAM-1.0
#session    optional     pam_keyinit.so    force revoke
#auth       required pam_listfile.so item=user sense=deny file=/etc/vsftpd
#auth       required pam_shells.so
#auth       include  password-auth
#account    include  password-auth
#session    required     pam_loginuid.so
#session    include  password-auth
auth    required /lib/security/pam_userdb.so db=/etc/vsftpd/vusers
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vusers

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.