`
swvip
  • 浏览: 150497 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

[转]vsftpd出现500 OOPS: cannot change directory的解决办法

阅读更多
ftp服务器连接失败,错误提示:
500 OOPS: cannot change directory:/home/*******
500 OOPS: child died


解决方法:

1 在终端输入命令:
setsebool ftpd_disable_trans 1
service vsftpd restart

就OK了!但是下次重启了还会这样··

2 在终端输入命令:

setsebool -P ftpd_disable_trans 1

service vsftpd restart

这样每次重启机器都可以了·

原因就在SELinux。
===========================================================================================
另外一篇:


关于vsftpd 部分本地用户不能登录,部分可以”的问题,我重新做了一些实验,我把这个问题结合实验的结果再重新描述一下,请各位高人,帮忙看看可能的原因。 谢谢了!

系统中原来就有的本地帐号都不能登录,我的/etc/vsftpd/vsftpd.conf文件的配置如下:
local_enable=YES
write_enable=YES
chroot_local_user=YES
pam_service_name=vsftpd
/etc/pam.d/vsftpd存在且正常。

登录时错误信息都是一样的:
500 OOPS: cannot change directory:/home/xxxx
Login failed.
421 Service not available, remote server has closed connection

他们的home目录都是/home/xxxx。/home和/home/xxxx的权限都是755。
以上这些帐号都不能ftp登录,这些都是平常经常使用的,可以用shell登录的。

我新创建了一个usr1帐号,
# useradd -G test -d /tmp/usr1 usr1
能ftp登录,他的home为/tmp/usr1,在/分区上。而/home我是mount到/dev/hda9上的。
#mount
/dev/hdb1 on / type ext3 (rw)
/dev/hda9 on /home type ext2 (rw)

所以,我猜想:是否是由于/home分区的原因,而造成“主目录在/home分区的帐号”都不能登录呢?

为了验证以上设想,我试着再创建了一个帐号,
useradd -G test -d /home/usr3 usr3
/home, /home/usr3 的权限都是755。

usr3 ftp登录失败。
500 OOPS: cannot change directory:/home/usr3
Login failed.
421 Service not available, remote server has closed connection

至此,我觉得可以确定是由于/home分区的原因,而造成“主目录在/home分区的帐号”都不能登录。
参考文章:
-----------------------------------------------------------------------------------------
I finished my second upgrade to Fedora Core 4. Not everything is ironed out yet with the build of course. But one thing is for sure a lot has happened to the RedHat I knew before.

I must say of all the changes, for me the nicest addition is the new SELinux extensions. For deep background on the reasons for and theory of SELinux read, The Inevitability of Failure: The Flawed Assumption of Security in Modern Computing Environments

The more I work with SELinux the more I realize I need to know about it, and how exactly it does all its stuff. It certainly changes things relating to users, directories and access. As I am starting to learn it, I'm sure I'm doing things the hard-way. :)

The major difference, so far for me, in Red Hat's SELinux is the way ftp is handled. vsftpd is still the server which is great. However, it seems to be designed to run as a daemon rather than invoked via xinet.d. If you grab a working copy of the xinet.d file for vsftpd you can invoke it via xinet.d wrapper. I did my first server upgrade in this manner. The current one I am trying as a daemon. I certainly think I will miss some of the features that the xinet.d wrapper brings, and may yet return to it.

Of all the issues I saw most notable is if you want to enable chroot directory's outside of the normal /home/xxx vsftpd. These will fail with a

500 OOPS: cannot change directory: /mnt/xxxxx

I was able to use ftp if I logged in with an account with a directory in /home, but once I set a user account to have a home drive outside of /home (in this case on a mounted secondary disk) vsftpd barfs the above.


I found information at the NSA that indicates you can disable SELinux protection of the ftp daemon.

setsebool -P ftpd_disable_trans 1

This seems a bit drastic. It certainly works for now though.

I think ultimately the issue resides with policies, but as SELinux policies are new to me, it will take time before it all gets sorted out. As I spend time with the new SELinux extensions in Fedora Core 4 I will keep you updated on my thoughts and configuration lessons.


---------------------------------------------------------------------------------------

解决办法:
--------------------------------------------------------------------------------------
# setsebool ftpd_disable_trans 1
   # service vsftpd restart

 

 

 


所以,可以确定原因就在SELinux。

分享到:
评论

相关推荐

    vsftpd 出现530 and 500 错误问题解决办法

    VSFTP 530 Login incorrect And 500 OOPS: vsftpd: refusing to run with writable anonymous root 错误的解决方法  530 Login incorrect : 在文件中限制匿名用户,做如下设置: anonymous_enable=NO user...

    ubuntu下vsftp问题修复

    vsftp出现550 Failed to change directory Ubuntu 获取软件失败 404错误 解决Ubuntu提示500 OOPS: vsftpd: refusing to run with writable root inside chroot()

    详解vsftpd.conf

    详解vsftpd.conf 对于初学者很合适

    vsftp连接错误cannot locate user entry:vsftpd

    主要介绍了vsftpd登陆错误: 500 OOPS: cannot locate user entry:vsftpd问题的解决办法,需要的朋友可以参考下

    vsftpd-3.0.5-1.el8.x86_64.rpm

    sed -i 's|anonymous_enable=YES|anonymous_enable=NO|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen=NO|listen=YES|g' /etc/vsftpd/vsftpd.conf sed -i 's|listen_ipv6=YES|listen_ipv6=NO|g' /etc/vsftpd/vsftpd....

    vsftpd-3.0.5-1.el6.x86_64.rpm

    centos 6上的vsftpd v3.0.5版本rpm安装包 1)如果运行了vsftpd,则先停止: service vsftpd stop 2)安装或升级vsftpd: rpm -Uvh vsftpd-3.0.5-1.el6.x86_64.rpm 3)然后修改vsftpd.conf文件: sed -i 's|...

    vsftpd-3.0.5.el 7.9.zip

    centos el7上的vsftpd v3.0.5版本的rpm安装包 1)如果运行了vsftpd,则先停止: systemctl stop vsftpd 2)安装或升级vsftpd: rpm -Uvh vsftpd-3.0.5-1.el7.x86_64.rpm rpm -Uvh vsftpd-sysvinit-3.0.5-1.el7.x86_...

    docker-vsftpd:在Docker中运行vsftpd

    Vsftpd Docker容器 vsftpd: : 码头工人: : 如果需要安全的FTP服务器来支持多种身份验证类型,例如htpasswd,BerkeleyDB或LDAP,则可以使用此存储库来构建满足您需求的容器。 用法: 建立容器 docker build -...

    vsftpd_ubuntu安装文件

    ubuntu下的ftp服务器软件:vsftpd。 安装命令:sudo dpkg -i 此文件

    docker-vsftpd:一个支持 SSL 的 vsftpd 服务器 Docker 镜像

    Docker 镜像文件来创建一个支持 SSL 的 Centos7 vsftpd 服务器。 它使用虚拟用户进行数据传输并禁用匿名登录。 上传也被禁用。 该图像主要用作共享现有文件的快速方式,以防通过其他方法(https、ssh 等)共享不容易...

    linux vsftpd搭建步骤 亲测可用

    500 OOPS: priv_sock_get_result. Connection closed by remote host. 这样的错误,需要升级pam yum update pam 6日志分析 vsftpd的两个日志文件分析如下: /var/log/xferlog 记录内容举例 /var/log/vsftpd.log Sat ...

    Linux FTP服务配置

    drwx------ 2 500 500 4096 Jun 25 21:34 xiaochuan drwxrwxrwx 2 508 508 4096 Jun 30 22:39 xu drwx------ 2 501 501 4096 Jun 25 20:25 xujunchuan 226 Directory send OK. ftp> pwd 257 "/home" 限制用户目录...

    vsftpd-3.0.3.tar

    openwrt中的vsftpd-3.0.3.tar.gz 下载后放入trunk/dl路径就可以了。

    手动添加vsftpd服务

    手动编译安装vsftpd之后,只需要将该文件复制到/etc/init.d文件夹下,即为安装了vsftpd服务,可运行service vsftpd status查看

    vsftpd-server:vsftpd ftp 服务器的 docker 镜像

    它基于 vsftpd。 您可以使用环境变量 $USER 和 $PASS 配置 ftp 用户和密码,并安装一个卷“/ftp”来放置文件。 您可能还需要一些端口转发: docker run -p 2021:21 -p 2020:20 -p 12020:12020 -p 12021:12021 -p ...

    vsftp3.0.4适用于el7(centos7.x),规避3.0.2版本的漏洞

    cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak 4) 如果运行了vsftpd,则先停止: systemctl stop vsftpd 5) 安装升级vsftpd 3.0.4 rpm -Uvh vsftpd-3.0.4-1.el7.x86_64.rpm rpm -Uvh vsftpd-...

    vsftpd-grok-patterns:用于解析 vsftpd 日志记录的 Logstash 配置和 grok 模式

    vsftpd-grok-模式 用于解析 vsftpd 日志记录的 Logstash 配置和 grok 模式 用法 安装logstash 将50-filter-vsftpd.conf添加到/etc/logstash/conf.d 将vsftpd.grok添加到/etc/logstash/patterns.d 重启logstash ...

    centos7.0 vsftpd配置

    网上搜了很多vsftpd的配置,都没弄好,自己记录了一下搭建vsftpd及增加用户的过程

Global site tag (gtag.js) - Google Analytics