CentOS配置vsftpd服务器

用vsftpd搭建内部一个FTP服务器,遇到的问题记录一下吧。
要求是,让匿名用户也可以上传和下载FTP中的文件。
最后使用的一个配置文件vsftpd.conf为:https://github.com/smilejay/other-code/blob/master/config/vsftpd.conf

1. 上传文件时遇到:550 Permission denied.
在/etc/vsftpd/vsftpd.conf中设置:write_enable=YES

2. 500 OOPS: vsftpd: refusing to run with writable anonymous root inside chroot ()
这是一个security方面的功能特性,用户的chroot的根目录不能是可写的。
我的原因是,我将/data/ftp 的user改为了ftp,我又将其改为root即可。(让设置的目录,对chroot的用户不具有可写权限,即可解决问题)。另外,如果目录是777这种所有用户的都有读写权限的,必然也会遇到这个问题。不过,可能一些其他版本的vsftpd没有这个问题的,没有做这样的安全限制。

3. 上传文件后不能下载的问题:可以正常上传文件、上传的文件却不能下载。
chown_upload_mode
The file mode to force for chown()ed anonymous uploads。 Default: 0600
anon_umask
The value that the umask for file creation is set to for anonymous users. NOTE! If you want to specify octal values, remember the "0" prefix otherwise the value will be treated as a base 10 integer! Default: 077
设置 anon_umask 改成 022。

参考资料:
'man vsftpd.conf' # man 手册很强大啊
http://manpages.ubuntu.com/manpages/lucid/man5/vsftpd.conf.5.html

Fixing 500 OOPS: vsftpd: refusing to run with writable root inside chroot ()

master

Stay hungry, stay foolish.

发表评论

邮箱地址不会被公开。 必填项已用*标注

*