在 Ubuntu 上配置 FTP 服务器
1. 安装 FTP 服务器软件
sudo apt install proftpd
2. 配置 FTP 服务器
#编辑配置文件 /etc/proftpd/proftpd.conf:
sudo vi /etc/proftpd/proftpd.conf
#在配置文件中,找到以下部分并进行修改:
ServerName "My FTP Server" #将 ServerName 修改为您的 FTP 服务器名称。
Port 21 #将 Port 修改为 FTP 服务器端口号。
DefaultRoot /home/%u #将 DefaultRoot 修改为 FTP 用户的默认根目录。
RequireValidShell off #将 RequireValidShell 修改为 off,允许用户即使没有有效的 shell 也能访问 FTP 服务器。
MasqueradeAddress off #将 MasqueradeAddress 修改为 off,使用 FTP 服务器的真实 IP 地址而不是伪造的 IP 地址。
Port 21
DefaultRoot /home/%u
RequireValidShell off
MasqueradeAddress off
3. 创建 FTP 用户
1.创建 FTP 用户并设置密码:
sudo adduser <username> #将 <username> 替换为您的 FTP 用户名。
4. 重启 FTP 服务器
sudo systemctl restart proftpd
评论区