Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I login anonymously with ftp (/usr/bin/ftp)?

Tags:

I'm trying to connect to an FTP server which allows anonymous access, I don't know how to specify the appropriate username/password required to do this though.

I've tried using anonymous/anonymous as the user/pass with no luck, as well the empty string and various combinations of the two, etc.

It's gotta be something simple that I'm missing, I can use connect just fine with curl ftp://server/

Using 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 
like image 889
sente Avatar asked Oct 14 '10 19:10

sente


2 Answers

Anonymous ftp logins are usually the username 'anonymous' with the user's email address as the password. Some servers parse the password to ensure it looks like an email address.

User:  anonymous Password:  [email protected] 
like image 164
Amardeep AC9MF Avatar answered Nov 05 '22 21:11

Amardeep AC9MF


Anonymous FTP usage is covered by RFC 1635: How to Use Anonymous FTP:

What is Anonymous FTP?

Anonymous FTP is a means by which archive sites allow general access to their archives of information. These sites create a special account called "anonymous".

Traditionally, this special anonymous user account accepts any string as a password, although it is common to use either the password "guest" or one's electronic mail (e-mail) address. Some archive sites now explicitly ask for the user's e-mail address and will not allow login with the "guest" password. Providing an e-mail address is a courtesy that allows archive site operators to get some idea of who is using their services.

These are general recommendations, though. Each FTP server may have its own guidelines.

For sample use of the ftp command on anonymous FTP access, see appendix 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-                    [email protected] 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% 

See also the example session at the University of Edinburgh site.

like image 38
Palec Avatar answered Nov 05 '22 22:11

Palec