在Debian上,您可以使用vsftpd作为FTP服务器。要自定义错误页面,请按照以下步骤操作:
sudo apt-get update
sudo apt-get install vsftpd
/etc/vsftpd/
目录下创建一个名为error.html
的文件。使用文本编辑器打开它,例如:sudo nano /etc/vsftpd/error.html
将您的自定义HTML代码粘贴到此文件中,然后保存并关闭文件。
/etc/vsftpd.conf
文件:sudo nano /etc/vsftpd.conf
找到以下行(如果找不到,请添加它们):
#custom_error=NO
ftp_error_message_enable=YES
取消注释custom_error=NO
(删除行首的#号),并将其更改为custom_error=YES
。这将启用自定义错误页面。
保存并关闭配置文件。
重启vsftpd服务以应用更改:
sudo systemctl restart vsftpd
现在,当用户遇到FTP错误时,他们将看到您在error.html
文件中定义的自定义错误页面。