修改vsftpd的默認根目錄/var/ftp/pub到其餘目錄

修改ftp的根目錄只要修改/etc/vsftpd/vsftpd.conf文件便可: html

加入以下幾行:linux

local_root=/var/www/html
chroot_local_user=YES
anon_root=/var/www/html

注:local_root 針對系統用戶;anon_root 針對匿名用戶。 bash

image

從新啓動服務:服務器

service vsftpd restart

任何一個用戶ftp登陸到這個服務器上都會chroot到/var/www/html目錄下。 rest

使用root用戶鏈接redhat ftp時,報以下錯誤code

500 OOPS:cannot change directory:/root

解決方法: htm

關閉selinux,修改/etc/selinux/config文件或/etc/syscofnig/selinux設置blog

SELINUX= disabled

而後重啓系統 get

重啓後登錄ftp到這個服務器就會在修改後的目錄it

相關文章
相關標籤/搜索