[comp.sys.amiga] telnet access to FTPD

d88-mbe@sm.luth.se (Michael Bergman) (03/10/90)

This question is probably best answered by someone with a good knowledge of
UN*X. Actually it might not belong in this group at all, but I decided I'll
take the risk...

OK, here we go...
As far as I can understand, the ftp program is a user interface to the
FTP-server of the foreign host. I't fixes the connections so that data can
be transferred (sockets and all that isn't my cup of tea really).
It's possible to access the FTP-server of a foreign host via telnet by
doing "telnet hostname 21", where 21 is the ftp-service port. You're then
thrown directly into the FTPD and can log in with USER anonymous and
PASS xxx@yyy.
Various commands are available, HELP shows them all.
However, even though you can eg issue the command LIST, no data connection
is established between the host and telnet(??), so nothing happens of course.
This means that you can't RETR(EIVE) files either.

The question is (although i suspect that the answer is NO):

Is it possible to call telnet from an Amiga, connect to a foreign host's
FTPD and have a proper connection set up so that data can be transferred
between the host and the Amiga? Or is it nessecary to have a real UN*X host
to do this?
(As I said before I fear that *nothing* of the above is possible, but my
philosophy here is you can never be sure...)

If anyone decides to post an answer to this, could you please EMAIL me a
copy of that posting? I dont't have time to read through news for a week
or so...  Thanx.

Mike

     //
    //  Michael Bergman             d88-mbe@sm.luth.se
\\ //   Dept. of Comp. sci,	    {uunet,mcvax}!sunic.se!sm.luth.se!d88-mbe
 \X/    Univ. of Lulea, SWEDEN

tadguy@cs.odu.edu (Tad Guy) (03/10/90)

[ This really doesn't belong in comp.sys.amiga... ]

In article <778@tau.sm.luth.se> d88-mbe@sm.luth.se (Michael Bergman) writes:
> It's possible to access the FTP-server of a foreign host via telnet
> by doing "telnet hostname 21", where 21 is the ftp-service port.
> You're then thrown directly into the FTPD and can log in with USER
> anonymous and PASS xxx@yyy.  Various commands are available, HELP
> shows them all.  

Right, though it's more accurate to say that you're communicating with
the ftpd (the ftp server process) on the remote host.

> though you can issue the command LIST, no data connection is
> established between the host and telnet(??)...

Right.

> Is it possible to call telnet from an Amiga, connect to a foreign host's
> FTPD and have a proper connection set up so that data can be transferred
> between the host and the Amiga? Or is it nessecary to have a real UN*X host
> to do this?

If you have the ftp program on your Amiga (since you have telnet, you
really should also have ftp), all works as it should.  Why?  Well...

When you issue a command that requires the transfer of data (such as
STOR, RETR, LIST, NLST, etc), ftpd attempts to open a *second* TCP
connection to your host on the ftp-data port (#20), unless you've
previously used the PORT command to tell the ftpd process specifically
where to connect.  

This means that your side of the connection must have *previously*
begun listeneing for connections on that port.  Telnet doesn't do this
(it wasn't designed to, and it's outside the scope of telnet to do
such things; that's why ftp exists).  When the transfer is completed,
the second connection is closed.

So, with normal telnet clients, the answer is ``no''...  (You could
hack some kind of listening code into telnet, but that's not the right
solution).

> If anyone decides to post an answer to this, could you please EMAIL me a
> copy of that posting? 

Done.  You might also what to check out RFC959, which defines FTP.

	...tad