CentOS安裝vsftpd

來源:互聯網
上載者:User

標籤:

版本:vsftpd-3.0.2-9.el7.x86_64(CentOS是64位的)。

 1.安裝vsftpd

yum -y install vsftpd

2.配置vsftpd

修改配置前把原始設定檔備份一下:

cp /etc/vsftpd/vsftpd.conf  /etc/vsftpd/vsftpd.conf.backup

修改設定檔:

vim /etc/vsftpd/vsftpd.conf

修改的地方:

1)把下面的開頭的注釋去掉,限制所有的使用者均不能切換到其他目錄

chroot_local_user=YES

2)允許根目錄可寫

Allow_writeable_chroot=YES

FTP的工作模式有兩種,一種是被動模式,一種是主動模式,這裡我們使用主動模式:

在檔案末尾加上:

port_enable=YES

如果要使用被動模式,則如下配置:

pasv_enable=Yespasv_min_port=40000    #pasv串連模式時可以使用port 範圍的上界,0 表示任意pasv_max_port=40100    #pasv串連模式時可以使用port 範圍的下界。

3.重啟服務

systemctl restart vsftpd

設定vsftpd服務開機後自啟動:

systemctl enable vsftpd   

4.建立一個使用者

useradd -d /ftp image -s /sbin/nologin

其中,-d指定使用者登入時的目錄,-s指定使用者登入後所使用的shell,然後設定密碼 

passwd image 

 最後給/ftp授權:

chmod -R 755 /ftp

說明:因為之前已經關了了防火牆和SELinux,所以在這裡就不需要額外設定了。

 

 

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.