# ftp
ftp> open 192.168.0.200
Connected to 192.168.0.200.
220 (vsFTPd 1.2.1)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (192.168.0.200:root): foo
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.0.100:41900 192.168.0.200:21 ESTABLISHED
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.0.200:21 192.168.0.100:41900 ESTABLISHED
ftp> put hoge.txt
local: hoge.txt remote: hoge.txt
227 Entering Passive Mode (192,168,0,200,4,74)
150 Ok to send data.
このときの通信状況を見てみると
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 95568 192.168.0.100:40886 10.100.0.240:1086 ESTABLISHED
tcp 0 0 192.168.0.100:41900 10.100.0.240:21 ESTABLISHED
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.0.200:1086 192.168.0.100:40886 ESTABLISHED
tcp 0 0 192.168.0.200:21 192.168.0.100:41900 ESTABLISHED
# ftp
ftp> passive
Passive mode off.
ftp> open 192.168.0.200
Connected to 192.168.0.200.
220 (vsFTPd 1.2.1)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (192.168.0.200:root): foo
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
このときの通信状況を見てみると
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.0.100:46674 192.168.0.200:21 ESTABLISHED
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.0.200:21 192.168.0.100:46674 ESTABLISHED
ここまではパッシブモードと状況は変わりません。
次に、同じようにファイルをPUTしてみます。
ftp> put hoge.txt
local: hoge.txt remote: hoge.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
この間の通信を見てみると
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 95568 192.168.0.100:59660 192.168.0.200:33468 ESTABLISHED
tcp 0 0 192.168.0.100:46674 192.168.0.200:21 ESTABLISHED
# netstat -n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.0.200:33468 192.168.0.200:59660 ESTABLISHED
tcp 0 0 192.168.0.200:21 192.168.0.200:46674 ESTABLISHED