当前位置: > Linux服务器 > ftp >

不关闭seLinux解决vsftpd服务本地用户不能登录问题(500 OOPS: cannot change directory:/home/*** ( 转)

时间:2017-02-16 23:13来源:linux.it.net.cn 作者:IT
不关闭seLinux解决vsftpd服务本地用户不能登录问题(500 OOPS: cannot change directory:/home/*** 


这里不讲vsftpd的基本配置,网上教程已经太多了。这里只说seLinux的问题。

日前在CentOS6.5中安装了vsftpd,按照网上搜索的教程,配置好/etc/vsftpd/vsftpd.conf,重新启动后,登录实验,又出现了著名的不能设置主目录错误:


500 OOPS: cannot change directory:/home/*******
500 OOPS: child died
  

再到网上求助,发现多数都是让关掉seLinux服务,我记得以前也是这么做得,不过总觉得是有点因噎废食。于是继续google

终于看到了这篇文章,但是照做时却被提示错误:


#setsebool -P ftpd_disable_trans 1
Boolean ftpd_disable_trans is not defined
  于是查询selinux


[root@node4 home]#sestatus -b |grep ftp
allow_ftpd_anon_write                       off
allow_ftpd_full_access                      off
allow_ftpd_use_cifs                         off
allow_ftpd_use_nfs                          off
ftp_home_dir                                off
ftpd_connect_db                             off
ftpd_use_fusefs                             off
ftpd_use_passive_mode                       off
httpd_enable_ftp_server                     off
tftp_anon_write                             off
tftp_use_cifs                               off
tftp_use_nfs                                off
  发现确实没有该项,但是却意外发现了ftp_home_dir,于是我照方抓药执行

setsebool -P ftp_home_dir 1

  在查询一下,发现状态已经成功改过来了!


[root@node4 home]#sestatus -b |grep ftp
allow_ftpd_anon_write                       off
allow_ftpd_full_access                      off
allow_ftpd_use_cifs                         off
allow_ftpd_use_nfs                          off
ftp_home_dir                                on
ftpd_connect_db                             off
ftpd_use_fusefs                             off
ftpd_use_passive_mode                       off
httpd_enable_ftp_server                     off
tftp_anon_write                             off
tftp_use_cifs                               off
tftp_use_nfs                                off'


  重新启动vsftpd


#service vsftpd restart

  再次连接vsftpd服务,成功了!


(责任编辑:IT)
------分隔线----------------------------