touch /etc/vsftpd.chroot_list,編輯加入用戶名(如beinan)。/etc/vsftpd/vsftpd.conf,啟用兩行:
chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list
/etc/init.d/vsftpd restart。/home/用戶名adduser -d /指定路徑 指定位置/var/ftpftp IP 命令列操作。ftp://192.168.0.1ftp://beinan@192.168.0.1(彈窗輸入密碼)。ADSL撥號上網查公網IP:
[root@linuxsir001 root]# ifconfig ppp0 inet addr:218.61.7.23 ← 此為公網IP
外網用戶用此IP訪問,前提是路由器做端口映射(21端口)且防火牆允許。
listen_address=192.168.0.2(僅內網該IP可訪問)。max_clients=100(總上限)、max_per_ip=5(單IP上限)。anon_max_rate=81920(匿名80KB/s)、local_max_rate=81920(本地用戶80KB/s),單位Bytes。userdel -r ftp adduser -d /mnt/LinG/ftp -g ftp -s /sbin/nologin ftp chmod 755 /mnt/LinG/ftp chown -R root.root /mnt/LinG/ftp
掌握這些進階技巧,可構建安全、可控、高效能的局域網FTP服務。