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

前段时间碰到一位牛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
# WARNING - changing this filename affects /etc/logrotate.d/vsftpd.log
#xferlog_file=/var/log/xferlog
#
# Switches between logging into vsftpd_log_file and xferlog_file files.
# NO writes to vsftpd_log_file, YES to xferlog_file
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6
# sockets, you must run two copies of vsftpd whith two configuration files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES
pam_service_name=vsftpd
<strong>user_config_dir=/etc/vsftpd/user_config_dir /*基于PAM认证用到的*/
userlist_enable=YES
tcp_wrappers=YES
guest_enable=YES
guest_username=www /*注意这里.很有可能是因为你的用户导致你的权限出问题*/
local_root=/home/www
anon_umask=022 /*这里是刚才上面提到的权限问题 */
</strong>

如果你已经是使用了RAM认证的.那么你可以参考下我的单个用户的配置.文件如下


代码如下:

<strong>anon_world_readable_only=NO
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
local_root=/var/public
anon_mkdir_write_enable=YES
</strong>

(0)

相关推荐

  • Linux配置VSFTP服务器的方法

    一.Linux FTP服务器分类: <1>wu-ftp  <2>proftp=profession ftp  <3>vsftp=very security ftp 配置文件: /etc/vsftpd/vsftpd.conf   //主配置文件 /etc/vsftpd.ftpusers      //被禁止登录FTP的用户文件 /etc/vsftpd.user_list     //允许登录FTP的用户文件 二.访问方式 <1>匿名登录  <2>帐

  • Linux编译安装vsftpd服务器(本地用户验证方式)

    Linux vsftpd编译安装和配置允许本地用户登录FTP 1.下载vsftpd源码 wget https://security.appspot.com/downloads/vsftpd-2.3.4.tar.gz 2.编译vsftpd源码 64位的系统编译之前先要执行cp /lib64/libcap.so.1 /lib/libcap.so.1命令: 复制代码 代码如下: tar xzvf vsftpd-2.3.4.tar.gz cd vsftpd-2.3.4 make make install

  • Linux 下VSFTP服务搭建过程

    Vsftp服务 服务功能:文件传输 1.环境部署 ip=192.168.1.50 [root@localhost /]# rpm -ivh /mnt/Packages/vsftpd-2.2.2-11.el6_4.1.x86_64.rpm 2.匿名访问 1)设置配置文件 [root@localhost /]# vi /etc/vsftpd/vsftpd.conf chown ftp /var/ftp/pub --设置准备目录 anonymous_enable=YES --开启匿名访问 local_

  • linux安装jdk,tomcat 配置vsftp远程连接的步骤

    不知不觉入行也有一年了,这两天在公司上班有空了就自己装了个vmware虚拟机,装了个红帽6.1完全命令行的操作系统,想着搭个公司现在在用的测试环境,没想到中间碰到了很多问题,不过大部分都解决了,现在可以达到自行上传项目等等操作,在这里把这两天学习的东西记录一下,防止记忆丢失. 一开始,要下载安装虚拟机,我选的是vmware,当然你也可以选择别的虚拟机,比如virtualBox等,虚拟机只是用来装操作系统的一个工具而已,当然vmware可能更强大一些,但是对于我们现在做的操作,随便一个工具就可以.

  • Linux平台通过nginx和vsftpd构建图片服务器

    因为开发需要,需要在Linux上构建一个独立的图片服务器,此处默认您已安装好Linux系统.系统环境:CentOs6.5,Vmware10 一.Nginx安装 1.nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没有gcc环境,需要安装gcc:yum install gcc-c++ PCRE(PerlCompatible Regular Expressions)是

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

    前段时间碰到一位牛B的人物,帮我修正了vsftpd基于PAM认证的问题.今天又碰到N个问题,比如Access denied. 和403错误,无法上传文件等等之类的错误.于是,只好请这个高人再次出马,帮忙再次修正.很感谢这位牛B人物.在利益大于一切的这个X蛋的社会,还能为了咱们这群小菜鸟去分析N个文件..这种精神实在是值得佩服. 针对我自己本身出现的问题,将高人与我的QQ聊天记录整理了一份,然后再加上实际的操作.终于让我大彻大悟.现在与大家狠狠的分享这位高人的成果. 用户上传文件访问出现403或者

  • linux服务器下配置多tomcat实现实例

    linux服务器下配置多tomcat 车辆交易用的系统模块,正在做.老板要看看,以便车城那边的人提出意见.于是在服务器上再次增加一个tomcat. 以前是配置过的,配置过程其实很简单,这次太大意了,找了半天问题. 首先是拷贝一个tomcat,放到一个新的位置,这个tomcat就是我要用的新的tomcat. 然后去配置一下日志的输出位置,在bin目录下的catalia.sh或者startup.sh.网上怎么样配置的都有,呵呵. 然后修改server.xml,配置好虚拟目录和端口信息.在此,conn

  • 在linux服务器下使用版本控制软件SVN的方法

    1.首先安装svn rpm包 查找rpm包里存在的版本,使用命令yum install sunversion...((根据package包里面存在的安装文件版本) 在linux服务器上建立SVN文件夹,个人创建在/usr/local/下: mkdir /usr/local/svn 在svn下创建项目管理目录blog: svnadmin create blog 2.启动SVN服务 svnserve -dr /usr/local/svn 个人电脑安装svn客户端,在指定文件夹下svn checkou

  • Linux服务器下Nginx与Apache共存的实现方法分析

    本文实例讲述了Linux服务器下Nginx与Apache共存的实现方法.分享给大家供大家参考,具体如下: 同一个端口是不能同时有两个程序监听的.所以换个思路解决同一台服务器下某些网站运行在nginx下,某些网站运行在Apache下共存. 解决思路: 将nginx作为代理服务器和web服务器使用,nginx监听80端口,Apache监听除80以外的端口,我这暂时使用8080端口. 解决方案: 在Linux 一经搭建好环境 先后安装了Nginx 和Apache 由于 默认端口都是:80 一般客户请求

  • 在Linux 服务器下修改防火墙允许该端口远程访问的方法

    1.问题描述 出于安全考虑,新搭建的服务器集群只开放指定几个端口,但是端口开放以后依然无法远程访问,后经过查找问题发现是防火墙需要对端口进行开放,所以使用如下命令修改防火墙允许端口远程访问 2.解决方法 使用命令行执行语句如下: firewall-cmd --zone=public --add-port=<strong>80/tcp</strong> --permanent firewall-cmd --reload 以上这篇在Linux 服务器下修改防火墙允许该端口远程访问的方法

  • Linux服务器下安装配置Nginx的教程

    Nginx("engine x")是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能的 Web和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器. 在高连接并发的情况下,Nginx是Apache服务器不错的替代品. Nginx 安装 一.安装编译工具及库文件 yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel 二.首先要安装 PCRE PCRE 作用是让 N

  • 在Linux服务器下启动tomcat的三种方式

    目录 第一种(当前会话启动): 第二种(带日志的当前会话启动): 第三种(后台永久启动): 1.最简单的写法: 2.手动指定tomcat启动时的日志路径: 直接进入主题,首先cd进入tomcat的bin文件夹下,然后可以尝试以下三种启动方式: 第一种(当前会话启动): ./startup.sh 效果: 然后tomcat就在后台启动了,我们还可以在当前会话中继续输入其它指令,比如 ps -ef | grep 'tomcat' 来查看我们刚才启动的tomcat服务: 可以看到它的进程id是6951,

  • linux服务器下PHPCMS v9 安全配置详解

    一.目录权限设置很重要:可以有效防范黑客上传木马文件. 如果通过 chmod 644 * -R 的话,php文件就没有权限访问了. 如果通过chmod 755 * -R 的话,php文件的权限就高了. 所以就需要分开设置目录权限和文件权限: linux 服务器权限:经常要用到的命令: find /path -type f -exec chmod 644 {} \; //设置文件权限为644 find /path -type d -exec chmod 755 {} \; //设置目录权限为755

  • Linux服务器下PHPMailer发送邮件失败的问题解决

    需求 更换服务器之后,我发现我的发送邮件功能失效了!原来的服务器是可以的,一定是哪里出问题了,决定来排查一下.我是用的PHPMailer,SMTP方式发送邮件的. 排查过程 这种方式首先PHP要开启sockets拓展,查了一下phpinfo页面,是开启的: 看了一下openssl也是开启(因为拿了qq邮箱来测),所以没问题: 那就再看一下allow_url_fopen,开启的,没问题: 是不是禁用了函数?没有禁用,没问题: 那配置上就没有问题了,我就想,是不是端口被占用了? 运行一下:netst

  • Linux服务器下nginx的安全配置详解

    Nginx是一个轻量级,高性能的Web服务器/反向代理和电子邮件 代理(IMAP/POP3),它可以运行在UNIX,GNU/Linux,BSD变种,MAC OS X,Solaris和Microsoft Windows上.根据Netcraft的调查数据显示,互联网上6%的域名都使用了Nginx Web服务器.Nginx是解决C10K问题的服务器之一,与传统服务器不一样,Nginx不依赖于线程处理请求,相反,它使用了一个更具扩展性的事件驱 动(异步)架构.Nginx在很多高流量网站上得到了应用,如W

随机推荐