Proto Recv
-
Q Send
-
Q Local Address Foreign Address State PID/Program
name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1326/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2349/master
tcp6 0 0 :::21 :::* LISTEN 6256/vsftpd
tcp6 0 0 :::22
:::* LISTEN 1326/sshd
tcp6 0 0 ::1:25 :::* LISTEN 2349/master
#
要注意看,上面的特殊字体那行有出
现
,才代表
vsftpd
这
只服
务
有
启动
喔!!
.
匿名者无法下载的问题
现在让我们来模拟一些
FTP
的常用状态!假设你想要½
/etc/securetty
以及主要的
/etc/sysctl.conf
放
置给所有人下载,
那么你可能会这样做!
[root@study ~]#
cp
-
a /etc/securetty /etc/sysctl.conf /var/ftp/pub
[root@study ~]#
ll /var/ftp/pub
-
rw
-------
. 1 root root 221 Oct 29 2014 securetty
#
先假
设
你
没
有看到
这个问题
!
-
rw
-
r
--
r
--
. 1 root root 225 Mar 6 11:05 sysctl.conf
一般来说,默认要给用户下载的
FTP
文件会放置到上面表格当中的
/var/ftp/pub
目录喔!现在让我
们使用简单的终端机浏览器
curl
来观察看看!
看你能不能查询到上述两个文件的内容呢?
# 1.
先看看
FTP
根目
录
底下有什么
文件
存在?
[root@study ~]#
curl ftp://localhost
drwxr
-
xr
-
x 2 0 0 40 Aug 08 00:51 pub
#
确
实
有存在一
个
名
为
pub
的
文件
喔!那就是在
/var/ftp
底下的
pub
啰
!
# 2.
再往下看看,能不能看到
pub
内
的
文件
呢?
[root@study ~]#
curl ftp://localhost/pub/
#
因
为
是目
录
,要加上
/
才好!
-
rw
-------
1 0 0 221 Oct 29 2014 securetty
-
rw
-
r
--
r
--
1 0 0 225 Mar 06 03:05 sysctl.conf
# 3.
承上,
继续
看一下
sysctl.conf
的
内
容好了!
[root@study ~]#
curl ftp://localhost/pub/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00
-
system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.con
f(5) and sysctl.d(5).
#
真的有看到
这个
文件
的
内
容喔!所以确定是可以
让
vsftpd
读
取到
这
文件
的!
# 4.
再
来
瞧瞧
securetty
好了!
[root@study ~]#
curl ftp://localhost/pub/securetty
curl: (78) RETR response: 550
#
看不到耶!但是,基本的原因
应该
是
权
限
问题
喔!因
为
vsftpd
默
认
放在
/var/ftp/pub
内
的
资
料,