加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

telnet登陆21测试ftp

(2015-07-16 10:47:59)
标签:

端口

服务器

模式

数据连接

分类: 验证
FTP通信通常需要两个连接,主连接用telnet可以连上,数据连接如果是被动模式也可以用另一个telnet连接来获取数据,如果是主动模式就必须自己写一个服务器监听某端口,然后通过PORT命令指定该端口让服务器来连接。
 
C:>telnet ftp.kernel.org 21
(cmd窗口清屏,服务器返回下面的数据)
220 Welcome to ftp.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)
注:A*256+B=pasv打开的端口
(列目录敲入:)

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                 16384 Oct 02 09:20 lost+found
drwxrwsr-x    9 536      536          4096 Sep 26 22:48 pub
lrwxrwxrwx    1 0                     1 Oct 03 04:41 usr -> .
lrwxrwxrwx    1 0                    10 Oct 03 04:41 welcome.msg -> pub/README

失去了跟主机的连接。
C:\>
)
150 Here comes the directory listing.
226 Directory send OK.
(退出,敲入:)
quit(回车)
221 Goodbye.

失去了跟主机的连接。
C:\>

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有