Ubuntu FileZilla无法上传文件的常见原因及解决方法
上传文件时若目标目录无写入权限,会提示“open for write: permission denied”。需通过以下命令调整权限:
ls -l /path/to/target_directory(确认是否有w权限);sudo chmod 777 /path/to/target_directory(临时开放所有权限,生产环境建议限制为特定用户,如sudo chown your_username:your_group /path/to/directory && sudo chmod 755 /path/to/directory)。若使用FTP协议,需确保vsftpd(Ubuntu默认FTP服务)已启动;若使用SFTP协议,需确保openssh-server(SSH服务)运行:
sudo systemctl status vsftpd(FTP)或sudo systemctl status ssh(SFTP);sudo systemctl start vsftpd(FTP)或sudo systemctl start ssh(SFTP);sudo systemctl enable vsftpd(FTP)或sudo systemctl enable ssh(SFTP)。Ubuntu防火墙(ufw)或服务器防火墙可能阻止FTP(端口21)/SFTP(端口22)流量:
sudo ufw status;sudo ufw allow 21/tcp;sudo ufw allow 22/tcp;sudo ufw reload。FileZilla中的协议(FTP/SFTP)需与服务器配置一致:
openssh-server。服务器磁盘空间耗尽可能导致无法写入:
df -h(查看/分区使用情况);sudo apt autoremove(清理旧软件包)、sudo rm -rf /tmp/*(清理临时文件)。若目标文件正在被其他程序(如文本编辑器、下载工具)占用,无法上传:
若以上方法无效,可通过FileZilla日志查看具体错误: