我正在尝试连接到允许匿名访问的FTP服务器,但我不知道如何指定执行此操作所需的相应用户名/密码.
我尝试使用匿名/匿名作为用户/传递没有运气,以及空字符串和两者的各种组合等.
它必须是我想念的简单东西,我可以使用连接 curl ftp://server/
使用python:
stu@sente ~ $ cat - | python
import ftplib
ftp = ftplib.FTP("ftp.server")
ftp.set_debuglevel(2)
ftp.connect()
ftp.login()
list = ftp.nlst()
ftp.close()
print "\n", " ".join(list)
^D
*get* '220 ftp.server NcFTPd Server (licensed copy) ready.\r\n'
*resp* '220 ftp.server NcFTPd Server (licensed copy) ready.'
*cmd* 'USER anonymous'
*put* 'USER anonymous\r\n'
*get* '331 Guest login ok, send your complete e-mail address as password.\r\n'
*resp* '331 Guest login ok, send your complete e-mail address as password.'
*cmd* 'PASS **********'
*put* 'PASS **********\r\n'
*get* '230 Logged in anonymously.\r\n'
*resp* '230 Logged in anonymously.'
*cmd* 'TYPE A'
*put* 'TYPE A\r\n'
*get* '200 Type okay.\r\n'
*resp* '200 Type okay.'
*cmd* 'PASV'
*put* 'PASV\r\n'
*get* '227 Entering Passive Mode (12,161,242,12,128,138)\r\n'
*resp* '227 Entering Passive Mode (12,161,242,12,128,138)'
*cmd* 'NLST'
*put* 'NLST\r\n'
*get* '150 Data connection accepted from 208.118.225.99:38451; transfer starting.\r\n'
*resp* '150 Data connection accepted from 208.118.225.99:38451; transfer starting.'
*get* '226 Listing completed.\r\n'
*resp* '226 Listing completed.'
Obin bin pub public sci_tech_med
Run Code Online (Sandbox Code Playgroud)
Ama*_*9MF 24
匿名ftp登录通常是用户名'匿名',用户的电子邮件地址作为密码.某些服务器会解析密码以确保其看起来像电子邮件地址.
User: anonymous
Password: anonymous@domain.com
Run Code Online (Sandbox Code Playgroud)
Pal*_*lec 14
RFC 1635:如何使用匿名FTP涵盖匿名FTP使用:
什么是匿名FTP?
匿名FTP是存档站点允许对其信息档案进行一般访问的一种方法.这些网站创建了一个名为"匿名"的特殊帐户.
...
传统上,这个特殊的匿名用户帐户接受任何字符串作为密码,尽管通常使用密码"guest"或一个人的电子邮件(e-mail)地址.一些存档站点现在明确要求用户的电子邮件地址,并且不允许使用"访客"密码登录.提供电子邮件地址是一种礼貌,允许存档网站运营商了解谁在使用他们的服务.
但这些是一般性建议.每个FTP服务器都有自己的指南.
有关匿名FTP访问命令的示例使用ftp,请参阅附录A:
atlas.arc.nasa.gov% ftp naic.nasa.gov Connected to naic.nasa.gov. 220 naic.nasa.gov FTP server (Wed May 4 12:15:15 PDT 1994) ready. Name (naic.nasa.gov:amarine): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: 230----------------------------------------------------------------- 230-Welcome to the NASA Network Applications and Info Center Archive 230- 230- Access to NAIC's online services is also available through: 230- 230- Gopher - naic.nasa.gov (port 70) 230- World-Wide-Web - http://naic.nasa.gov/naic/naic-home.html 230- 230- If you experience any problems please send email to 230- 230- naic@nasa.gov 230- 230- or call +1 (800) 858-9947 230----------------------------------------------------------------- 230- 230-Please read the file README 230- it was last modified on Fri Dec 10 13:06:33 1993 - 165 days ago 230 Guest login ok, access restrictions apply. ftp> cd files/rfc 250-Please read the file README.rfc 250- it was last modified on Fri Jul 30 16:47:29 1993 - 298 days ago 250 CWD command successful. ftp> get rfc959.txt 200 PORT command successful. 150 Opening ASCII mode data connection for rfc959.txt (147316 bytes). 226 Transfer complete. local: rfc959.txt remote: rfc959.txt 151249 bytes received in 0.9 seconds (1.6e+02 Kbytes/s) ftp> quit 221 Goodbye. atlas.arc.nasa.gov%
另请参阅爱丁堡大学网站上的示例会话.
| 归档时间: |
|
| 查看次数: |
140228 次 |
| 最近记录: |