天天看点

linux FTP 问题

ftp服务器连接失败,错误提示:

500 oops: cannot change directory:/home/*******

500 oops: child died

解决方法: 在终端输入命令:

setsebool ftpd_disable_trans 1

service vsftpd restart

在安装完vsftp服务后登陆时可能遇到cannot change directory后面是登陆者的目录的错误。这是因为se设置的关闭了ftp的原因。 使用命令 getsebool ftpd_disable_trans 可以查看当前的状态如果不是on 那么是输入命令 setsebool ftpd_disable_trans 1 当然也可以加入-p参数 以便不需要每次开机都输入这个命令 setsebool -p ftpd_disable_trans 1 同理 如果smb服务也遇到相同的问题。

在安装完vsftp服务后登陆时可能遇到cannot change directory后面是登陆者的目录的错误。这是因为se设置的关闭了ftp的原因。

使用命令

getsebool ftpd_disable_trans

可以查看当前的状态如果不是on

那么是输入命令

当然也可以加入-p参数 以便不需要每次开机都输入这个命令

setsebool -p ftpd_disable_trans 1

同理 如果smb服务也遇到相同的问题 ,也可以这么做。

setsebool -p samba_enable_home_dirs=1

selinux的问题也可以使用 管理工具中的 selinux management 来调整相关设置。

ftp登录时错误信息:

500 oops: cannot change directory:/home/xxxxlogin failed.

421 service not available, remote server has closed connection

开始以为是权限问题,将home/xxxx chmod为777,vsftpd配置文件全开依然不行。

==================================

i found information at the nsa that indicates you can disable selinux protection of the ftp daemon.

this seems a bit drastic. it certainly works for now though.

原来是新装系统rhel5 增强的系统安全selinux在作怪,关掉selinux对ftp daemon的保护:

# setsebool ftpd_disable_trans 1

# service vsftpd restart

继续阅读