SELinux与FTP

系统环境:Red Hat Enterprise Linux Server 6

iptables的规则中已经对FTP服务放行了

 

windows客户端访问时的情况:

C:\Users\Administrator>ftp 192.168.18.140

Connected to 192.168.18.140.

220 (vsFTPd 2.2.2)

User (192.168.18.140:(none)): huage

331 Please specify the password.

Password:

500 OOPS: cannot change directory:/home/huage

500 OOPS: priv_sock_get_cmd

Connection closed by remote host.

 

出现这种情况是因为selinux的缘故:

[root@desktop huage]# sestatus

SELinux status:                 enabled

SELinuxfs mount:                /selinux

Current mode:                   enforcing

Mode from config file:          enforcing

Policy version:                 24

Policy from config file:        targeted

[root@desktop huage]# getsebool -a |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

httpd_enable_ftp_server --> off

sftpd_anon_write --> off

sftpd_enable_homedirs --> off

sftpd_full_access --> off

sftpd_write_ssh_home --> off

tftp_anon_write --> off

[root@desktop huage]# setsebool ftp_home_dir on                     //重启后失效

[root@desktop huage]# setsebool -P ftp_home_dir on                //永久保存

 

sestatus  This tool is used to get the status of system running SELinux.

getsebool:   

                get SELinux boolean value(s)

-a             Show all SELinux booleans.

 

setsebool

                set SELinux boolean value

用法:

       setsebool -P boolean value bool1=val1 bool2=val2 ...

If  the  -P option is given, all pending values are written to the policy file on disk. So they will be persistant

       across reboots. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值