• 乐贴资讯网
 
您的位置:首页 > 软件资讯

关于linux服务器下vsftpd的一些问题

2020-08-01 21:34:31  来源:乐贴资讯网
    前段时间碰到一位牛B的人物,帮我修正了vsftpd基于PAM认证的问题.今天又碰到N个问题,比如Access denied. 和403错误,无法上传文件等等之类的错误.于是,只好请这个高人再次出马,帮忙再次修正.很感谢这位牛B人物.在利益大于一切的这个X蛋的社会,还能为了咱们这群小菜鸟去分析N个文件..这种精神实在是值得佩服.

    针对我自己本身出现的问题,将高人与我的QQ聊天记录整理了一份,然后再加上实际的操作.终于让我大彻大悟.现在与大家狠狠的分享这位高人的成果.

    用户上传文件访问出现403或者Access denied.

    解答:这个主要是权限问题,在用户vsftpd.conf中加上:anon_umask=022或者anon_umask=133,022指755权限.133指644权限,再将给权限给该文件chmod 644 XX.php或者chmod 644 name

    用户无法上传文件,出现550或者是553错误

    可能是用户组有问题.比如你的网站用www这个用户来访问,那么就将vsftpd.conf中的guest_username=XXX改成www

    另外贴出来我的vsftpd的配置文件:

    复制代码 代码如下:

    # Example config file /etc/vsftpd/vsftpd.conf

    #

    # The default compiled in settings are fairly paranoid. This sample file

    # loosens things up a bit, to make the ftp daemon more usable.

    # Please see vsftpd.conf.5 for all compiled in defaults.

    #

    # READ THIS: This example file is NOT an exhaustive list of vsftpd options.

    # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's

    # capabilities.

    #

    # Allow anonymous FTP? (Beware - allowed by default if you comment this out).

    anonymous_enable=NO

    #

    # Uncomment this to allow local users to log in.

    local_enable=YES

    #

    # Uncomment this to enable any form of FTP write command.

    write_enable=YES

    #

    # Default umask for local users is 077. You may wish to change this to 022,

    # if your users expect that (022 is used by most other ftpd's)

    local_umask=022

    #

    # Uncomment this to allow the anonymous FTP user to upload files. This only

    # has an effect if the above global write enable is activated. Also, you will

    # obviously need to create a directory writable by the FTP user.

    #anon_upload_enable=YES

    #

    # Uncomment this if you want the anonymous FTP user to be able to create

    # new directories.

    #anon_mkdir_write_enable=YES

    #

    # Activate directory messages - messages given to remote users when they

    # go into a certain directory.

    dirmessage_enable=YES

    #

    # The target log file can be vsftpd_log_file or xferlog_file.

    # This depends on setting xferlog_std_format parameter

    xferlog_enable=YES

    #

    # Make sure PORT transfer connections originate from port 20 (ftp-data).

    connect_from_port_20=YES

    #

    # If you want, you can arrange for uploaded anonymous files to be owned by

    # a different user. Note! Using "root" for uploaded files is not

    # recommended!

    #chown_uploads=YES

    #chown_username=whoever

    #

    # The name of log file when xferlog_enable=YES and xferlog_std_format=YES