技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> 系统运维 --> CentOS配置vsftpd服务器

CentOS配置vsftpd服务器

浏览:888次  出处信息

   用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

   http://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/


建议继续学习:

  1. CentOS vsftpd的安装与配置    (阅读:2264)
  2. 用vsftpd和mysql创建一个虚拟用户ftp服务器    (阅读:1817)
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1