vsftp限制FTP使用者在特定目錄

來源:互聯網
上載者:User

標籤:使用   檔案   art   for   伺服器   res   

使用者配置目錄:/etc/vsftpd/user.d
為每個使用者建立設定檔
比如:
#/etc/vsftpd/user.d/Tom
編輯Tom檔案,加入以下內容
local_root=/home/hyq/ftp/tom
#End

vi /etc/vsftpd/vsftpd.conf
加上以下幾行:
chroot_list_enable=YES
chroot_local_user=YES
chroot_list_file=/etc/vsftpd/chroot_list
user_config_dir=/etc/vsftpd/user.d

然後重啟VSFTPD服務service vsftpd restart

 

vsftp 出現500 OOPS: could not bind listening IPv4 socket 的解決方案
原因:因為同時指定了 inetd和standalone 兩種運行方式,連接埠衝突了.
解決方案:
1.使用XINET模式
去掉/etc/rc.local檔案中的vsftpd的啟動指令碼/usr/local/sbin/vsftp &
重啟xinetd服務,  service xinetd restart
運行service vsftpd restart命令啟動vsftpd

2.使用STANDALONE獨立模式
在伺服器的負擔比較重的情況下最好用這個模式
或者直接修改/etc/xinetd.d/vsftpd檔案,把disable=no改成disable=yes就行了!

service vsftpd start時出現Starting vsftpd for vsftpd: [ FAILED ]
修改/etc/logrotate.d/vsftpd.log
把 missingok 注釋掉

########################################################################
vsftpd伺服器串連失敗,錯誤提示:

500 OOPS: cannot change directory:/home/*******

解決方案:

在終端輸入命令:

setsebool ftpd_disable_trans 1

service vsftpd restart
這是因為SE設定的關閉了ftp的原因。 使用命令 getsebool ftpd_disable_trans 可以查看當前的狀態如果不是on ,
那麼輸入命令 setsebool ftpd_disable_trans 1 ,當然也可以加入-P參數,
以便不需要每次開機都輸入這個命令 setsebool -P ftpd_disable_trans 1

聯繫我們

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