在Linux上管理FTP用戶可以通過多種方式實現,具體取決于你使用的FTP服務器軟件。以下是一些常見的FTP服務器軟件及其用戶管理方法:
sudo apt-get update
sudo apt-get install vsftpd
編輯配置文件 /etc/vsftpd.conf
:
sudo nano /etc/vsftpd.conf
確保以下配置項正確設置:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
sudo adduser ftpuser
sudo passwd ftpuser
sudo systemctl restart vsftpd
sudo apt-get update
sudo apt-get install proftpd
編輯配置文件 /etc/proftpd/proftpd.conf
:
sudo nano /etc/proftpd/proftpd.conf
確保以下配置項正確設置:
ServerName "ProFTPD Server"
ServerIdent on "FTP Server ready."
DefaultAddress *
Port 21
RequireValidShell off
User nobody
Group nogroup
sudo adduser ftpuser
sudo passwd ftpuser
sudo systemctl restart proftpd
sudo apt-get update
sudo apt-get install pure-ftpd-common pure-ftpd
編輯配置文件 /etc/pure-ftpd/pure-ftpd.conf
:
sudo nano /etc/pure-ftpd/pure-ftpd.conf
確保以下配置項正確設置:
ChrootEveryone yes
NoAnonymous yes
sudo adduser ftpuser
sudo passwd ftpuser
sudo systemctl restart pure-ftpd
FileZilla Server是一個跨平臺的FTP服務器軟件,安裝和管理相對簡單。
從FileZilla官網下載并安裝適用于Linux的版本。
運行FileZilla Server Manager,添加新用戶并設置密碼。
在FileZilla Server Manager中啟動服務器。
無論使用哪種FTP服務器軟件,基本步驟包括安裝、配置、創建用戶和重啟服務。確保在配置文件中正確設置用戶權限和安全性選項,以保護你的FTP服務器。