FileZilla有两种使用模式:客户端(连接远程FTP服务器)和服务端(搭建FTP服务供他人连接)。权限设置需根据角色调整:
若仅需用FileZilla客户端连接远程FTP服务器(如服务器已搭建好),只需完成以下步骤:
sudo apt update && sudo apt install filezillasudo yum install epel-release && sudo yum install filezilla若需用FileZilla搭建FTP服务,需通过FileZilla Server Interface配置用户权限,步骤如下:
.deb或.rpm),通过包管理器安装:# Debian/Ubuntu示例
wget https://dl3.cdn.filezilla-project.org/server/FileZilla_Server_xxx_x86_64-linux-gnu.deb
sudo dpkg -i FileZilla_Server_xxx_x86_64-linux-gnu.deb
sudo systemctl start filezilla-server.service # 启动服务
sudo systemctl enable filezilla-server.service # 设置开机自启
ftpuser)和密码;/home/ftpuser),并设置权限:
/home/ftpuser/uploads)。sudo chown -R ftpuser:ftpuser /home/ftpuser # 将主目录所有者设为用户自身
sudo chmod -R 755 /home/ftpuser # 允许所有者读写执行,其他用户只读执行
注:若需更严格的权限(如禁止用户删除文件),可将目录权限设为
750(移除其他用户的执行权限)。
sudo systemctl restart filezilla-server.service
/sbin/nologin,防止其通过SSH登录服务器:sudo usermod -s /sbin/nologin ftpuser
~/.ssh/id_rsa.pub)添加到服务器用户~/.ssh/authorized_keys文件中。通过以上步骤,可完成Linux环境下FileZilla用户权限的设置,满足不同场景的需求。需根据实际业务调整权限(如限制写入权限以防止误操作),确保服务器数据安全。