telnet登陆21测试ftp
(2015-07-16 10:47:59)
标签:
端口服务器模式数据连接 |
分类: 验证 |
FTP通信通常需要两个连接,主连接用telnet可以连上,数据连接如果是被动模式也可以用另一个telnet连接来获取数据,如果是主动模式就必须自己写一个服务器监听某端口,然后通过PORT命令指定该端口让服务器来连接。
C:>telnet ftp.kernel.org 21
(cmd窗口清屏,服务器返回下面的数据)
220 Welcome toftp.kernel.org.
(输入用户名,敲入:)
user anonymous(回车)
331 Please specify the password.
(输入口令,敲入:)
pass anonymous@(回车)
230-
Welcome to the
230-
230-
LINUX KERNEL ARCHIVES
230- ftp.kernel.org
230-
......省略
230-For comments on this site, please contact <<a href="mailto:ftpadmin@kernel.org" style="word-wrap: break-word; text-decoration: none; color: rgb(86, 86, 86);">ftpadmin@kernel.org>.
230-Please do not use this address for questions that are not related to
230-the operation of this site. Please see our
homepage at
230-http://www.kernel.org/ for links to Linux documentation resources.
230-
230 Login successful.
(进入被动模式,敲入:)
pasv(回车)
227 Entering Passive Mode (204,152,191,37,A,B)
(cmd窗口清屏,服务器返回下面的数据)
220 Welcome to
(输入用户名,敲入:)
user anonymous(回车)
331 Please specify the password.
(输入口令,敲入:)
pass anonymous@(回车)
230-
230-
230-
230-
230-
......省略
230-For comments on this site, please contact <<a href="mailto:ftpadmin@kernel.org" style="word-wrap: break-word; text-decoration: none; color: rgb(86, 86, 86);">ftpadmin@kernel.org>.
230-Please do not use this address for questions that are not related to
230-the operation of this site.
230-http://www.kernel.org/ for links to Linux documentation resources.
230-
230 Login successful.
(进入被动模式,敲入:)
pasv(回车)
227 Entering Passive Mode (204,152,191,37,A,B)
注:A*256+B=pasv打开的端口
(列目录敲入:)
list(回车)
(
此时在另一个cmd窗口敲入下面的命令,回车,其中7393=28*256+225,即可看到服务器传回的目录数据
(列目录敲入:)
list(回车)
(
此时在另一个cmd窗口敲入下面的命令,回车,其中7393=28*256+225,即可看到服务器传回的目录数据
:
C:\>telnet 204.152.191.37 7393
drwxrwx--- 2
536
528
4096 May 21 2001 for_mirrors_only
drwx------ 2
0
0
16384 Oct 02 09:20 lost+found
drwxrwsr-x 9
536
536
4096 Sep 26 22:48 pub
lrwxrwxrwx 1
0
0
1 Oct 03 04:41 usr -> .
lrwxrwxrwx 1
0
0
10 Oct 03 04:41 welcome.msg -> pub/README
C:\>telnet 204.152.191.37 7393
drwxrwx---
drwx------
drwxrwsr-x
lrwxrwxrwx
lrwxrwxrwx
失去了跟主机的连接。
C:\>
)
150 Here comes the directory listing.
226 Directory send OK.
(退出,敲入:)
quit(回车)
221 Goodbye.
)
150 Here comes the directory listing.
226 Directory send OK.
(退出,敲入:)
quit(回车)
221 Goodbye.
失去了跟主机的连接。
C:\>
前一篇:telnet登陆POP收邮件
后一篇:直接telnet 25端口发邮件