首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 操作系统 > Linux > 关于“vsftpd 部分本地用户不能登录“的问题解决
【标  题】:关于“vsftpd 部分本地用户不能登录“的问题解决
【关键字】:vsftpd
【来  源】:http://blog.csdn.net/cdtdx/archive/2007/02/14/1510044.aspx

关于“vsftpd 部分本地用户不能登录“的问题解决

关于“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
我用的是FC4,按照你上一帖子里的方法试了,马上就解决了。所以,可以确定原因就在SELinux。
------------------------------------------------------------------------------------






 
HP-ux.Vertas NBU5.0 为介质解除冻结:【上一篇】
Ubuntu 6.10安装Eclipse:【下一篇】
【相关文章】
  • FreeBSD学习笔记4.ports安装vsftpd
  • vsftpd的几个报错解决办法
  • vsftpd dead , but subsys locked --解除方法汇总(Red Hat Enterprise Linux 4)
  • VSFTPD.CONF
  • vsftpd配置文件
  • vsftpd frequently asked questions
  • FreeBSD 4.10 安装配置vsftpd、mysql、apache
  • vsftpd服务器配置实验步骤
  • vsftpd.conf内配置参数说明
  • vsftpd.conf中文说明文档
  • 【随机文章】
  • C语言安全特性概要:进程部分
  • 不用软件盗QQ的方法
  • win2003的web服务配置
  • 注册表实战集锦--"网络"更改集锦
  • Windows下文件分割工具-软件+源码
  • 约瑟夫环问题(Josephus)(zz)
  • 生成静态页面 - 内容发布系统的开发
  • url, uri & urn区别
  • 解读Java Class文件格式
  • 黄健翔辞职的导火索是一封“举报信”
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.