CentOS vsftpd搭建快速流程

來源:互聯網
上載者:User

標籤:bin   art   伺服器   連接埠   chroot   限制   install   setsebool   yum   

1.yum install vsftpd

2.chkconfig vsftpd on

3.service vsftpd start

4.adduser -d /home/bp -g ftp -s /sbin/nologin bps, 並輸入命令:passwd bps 給賬戶添加密碼。

   (/home/bp為自己的FTP目錄,bps為自己建立的FTP帳號)

5.vi /etc/vsftpd/chroot_list  將bps添加到裡面,一個帳號佔一行,可添加多個。

6.編輯vi /etc/vsftpd/vsftpd.conf

修改和添加如下內容:

(1).禁止匿名訪問:anonymous_enable=NO

(2).限制ftp使用者訪問主目錄以外的目錄:chroot_list_enable=YES

(3).限制ftp使用者訪問主目錄以外的目錄使用者列表:chroot_list_file=/etc/vsftpd/chroot_list

(4).開啟被動模式,更好支援FlashFxp等Ftp工具,在最下面添加:

pasv_enable=YES

pasv_min_port=20000  #開放的連接埠

pasv_max_port=20100

7.開啟防火牆:/etc/sysconfig/iptables

添加以下內容:

(1).開放21連接埠:-A INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT

(2).開發20000-20100連接埠:-A INPUT -p tcp --dport 20000:20100 -j ACCEPT

8.重啟防火牆:service iptables restart  重啟vsftpd伺服器:service vsftpd restart

9.輸入命令:setsebool -P ftp_home_dir on

10.使用工具登入FTP。

 

CentOS vsftpd搭建快速流程

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.