ubuntu 14.04中開啟vsftpd服務步驟

readyao發表於2016-01-15

1、安裝vsftpd

root@linux_ever:~# apt-get install vsftpd

2、判斷vsftpd是否安裝成功,並且是否開啟該服務

方法1:

root@linux_ever:~# service vsftpd restart

輸出:
vsftpd stop/waiting
vsftpd start/running, process 12805    (表明開啟了該服務)

方法2:

root@linux_ever:~# netstat -l | grep ftp
輸出:
tcp        0      0 *:ftp                   *:*                     LISTEN   (表明開啟了該服務)

3、測試

在一個終端中輸入:
root@linux_ever:~# tcpdump -nt -i lo port 21   開始監聽
在另一個終端中輸入:
root@linux_ever:~# ftp 127.0.0.1
Connected to 127.0.0.1.
220 (vsFTPd 3.0.2)
Name (127.0.0.1:root): yxk   輸入登入的另一個使用者名稱
331 Please specify the password.
Password:                               輸入登入的另一個使用者名稱密碼
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> get test                              獲取另一個使用者主目錄下的test檔案
local: test remote: test
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for test (5 bytes).
226 Transfer complete.
5 bytes received in 0.00 secs (1.8 kB/s)        傳輸成功
ftp>                                             輸入quit退出

下面是tcpdump監聽到資料幀
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [S], seq 968764036, win 43690, options [mss 65495,sackOK,TS val 17697935 ecr 0,nop,wscale 7], length 0
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [S.], seq 4051126491, ack 968764037, win 43690, options [mss 65495,sackOK,TS val 17697935 ecr 17697935,nop,wscale 7], length 0
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [.], ack 1, win 342, options [nop,nop,TS val 17697935 ecr 17697935], length 0
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 1:21, ack 1, win 342, options [nop,nop,TS val 17697936 ecr 17697935], length 20
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [.], ack 21, win 342, options [nop,nop,TS val 17697936 ecr 17697936], length 0
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [P.], seq 1:11, ack 21, win 342, options [nop,nop,TS val 17698464 ecr 17697936], length 10
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [.], ack 11, win 342, options [nop,nop,TS val 17698464 ecr 17698464], length 0
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 21:55, ack 11, win 342, options [nop,nop,TS val 17698465 ecr 17698464], length 34
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [.], ack 55, win 342, options [nop,nop,TS val 17698465 ecr 17698465], length 0
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [P.], seq 11:21, ack 55, win 342, options [nop,nop,TS val 17698964 ecr 17698465], length 10
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [.], ack 21, win 342, options [nop,nop,TS val 17698974 ecr 17698964], length 0
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 55:78, ack 21, win 342, options [nop,nop,TS val 17698974 ecr 17698964], length 23
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [.], ack 78, win 342, options [nop,nop,TS val 17698974 ecr 17698974], length 0
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [P.], seq 21:27, ack 78, win 342, options [nop,nop,TS val 17698974 ecr 17698974], length 6
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [.], ack 27, win 342, options [nop,nop,TS val 17698974 ecr 17698974], length 0
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 78:97, ack 27, win 342, options [nop,nop,TS val 17698975 ecr 17698974], length 19
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [.], ack 97, win 342, options [nop,nop,TS val 17698985 ecr 17698975], length 0
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [P.], seq 27:35, ack 97, win 342, options [nop,nop,TS val 17700098 ecr 17698975], length 8
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 97:128, ack 35, win 342, options [nop,nop,TS val 17700099 ecr 17700098], length 31
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [.], ack 128, win 342, options [nop,nop,TS val 17700099 ecr 17700099], length 0
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [P.], seq 35:59, ack 128, win 342, options [nop,nop,TS val 17700099 ecr 17700099], length 24
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 128:179, ack 59, win 342, options [nop,nop,TS val 17700099 ecr 17700099], length 51
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [P.], seq 59:70, ack 179, win 342, options [nop,nop,TS val 17700099 ecr 17700099], length 11
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 179:240, ack 70, win 342, options [nop,nop,TS val 17700099 ecr 17700099], length 61
IP 127.0.0.1.21 > 127.0.0.1.53609: Flags [P.], seq 240:264, ack 70, win 342, options [nop,nop,TS val 17700100 ecr 17700099], length 24
IP 127.0.0.1.53609 > 127.0.0.1.21: Flags [.], ack 264, win 342, options [nop,nop,TS val 17700100 ecr 17700099], length 0

相關文章