#
什么
SELinux type
几乎都可以被
取的才
喔!所以要
这样处
理!
# 5.
订权
限之后再一次
securetty
看看!
[root@study ~]#
chmod a+r /var/ftp/pub/securetty
[root@study ~]#
curl ftp://localhost/pub/securetty
#
你就可以看到
实际
文件
# 6.
SELinux type
(
非必
)
[root@study ~]#
restorecon
-
Rv /var/ftp
上面这个例子在告诉你,要先从权限的½度来瞧一瞧,如果无法被读取,可能就是因为没有
r
或没
rx
啰!并不一定是由
SELinux
引起的!
了½乎?好~再来瞧瞧如果是一般账号呢?如何登入?
.
无法从家目录下载文件的问题分析与½决
我们前面½立了
ftptest
账号,那如何使用文字½面来登入呢?就使用如下的方式来处理。同时请注
意,因为文字型的
FTP
客户端软件,
默认会½用户丢到根目录而不是家目录,因此,你的
URL
能需要修订一下如下!
# 0.
curl
这个
文字
浏览
器可以
传输数
据,我
先½立一些
据在
ftptest
家目
[root@study ~]#
echo "testing" > ~ftptest/test.txt
[root@study ~]#
cp
-
a /etc/hosts /etc/sysctl.conf ~ftptest/
[root@study ~]#
ll ~ftptest/
-
rw
-
r
--
r
--
. 1 root root 158 Jun 7 2013 hosts
-
rw
-
r
--
r
--
. 1 root root 225 Mar 6 11:05
sysctl.conf
-
rw
-
r
--
r
--
. 1 root root 8 Aug 9 01:05 test.txt
# 1.
一般
账号
直½登入
FTP
器,同
时变换
到家目
去!
[root@study ~]#
curl ftp://ftptest:myftp123@localhost/~/
-
rw
-
r
--
r
--
1 0 0 158 Jun 07 2013 hosts
-
rw
-
r
--
r
--
1 0 0
225 Mar 06 03:05 sysctl.conf
-
rw
-
r
--
r
--
1 0 0 8 Aug 08 17:05 test.txt
#
真的有
据~看
文件
最左
限也是
没问题
,所以,
来读
一下
test.txt
容看看
# 2.
始下
test.txt, sysctl.conf
等有
限可以
阅读
文件
看看!
[root@study ~]#
curl ftp://ftptest:myftp123@localhost/~/test.txt
curl: (78) RETR response: 550
#
竟然
说没
限!明明我
rwx
是正常
没问题
!那是否有可能是
SELinux
造成的?
# 3.
½
SELinux
Enforce
Permissive
看看情
!同
时观
察登
录档
[root@study ~]#
setenforce 0
[root@study ~]#
curl ftp://ftptest:myftp123@localhost/~/test.txt
testing
[root@study ~]#
setenforce 1
#
确定
问题
后,一定要
Enforcing
啊!