[plug] Remote machines
Craig Ringer
craig at postnewspapers.com.au
Thu May 30 19:23:03 WST 2002
> Then I tried to ssh port forwarding:
> ssh $ACCOUNT at gwaleel.pair.com -f -N -L 7721:localhost:21
> ftp localhost 7721
> I can log in fine, but when I try to do anything interesting it doesn't
> work, whether using passive mode or not:
>
> ftp> passive
> Passive mode on.
> ftp> ls -l
> 227 Entering Passive Mode (127,0,0,1,252,236)
> ftp: connect: Connection refused
OK, this is the easier bit: your machine is asking the remote machine
"what port do I connect to" as usual, and getting a result. All well and
good 'till it tries to connect to, say, localhost:4623 ('cos the remote
server _did_ say port 4623).
> ftp> passive
> Passive mode off.
> ftp> ls -l
> 200 PORT command successful.
> <FTP seems to hang, I press Ctrl-C ...>
> 421 Service not available, remote server has closed connection
Perhaps because of the tunnel the ftp command is reporting your IP as
127.0.0.1, which would cause the ftp server to connect to itsself and
try to transfer the file. Otherwise, don't really know.
Unless I'm being a total idiot (not beyond the bounds of possibility)
this is why your tunneled connection can't get data transfers: ftp's
separation of data and control channels, and the confusion caused by
tunneling the control channel.
Fix: use passive mode and convince your FTP program to connect only to a
small set of pre-assigned ports on the server which (what do you know!)
you've thoughtfully also forwarded to the server. Convincing your FTP
program could be the "interesting" bit.
--
Craig Ringer
GPG Key Fingerprint: AF1C ABFE 7E64 E9C8 FC27 C16E D3CE CDC0 0E93 380D
-- if it ain't broke, add features 'till it is.
More information about the plug
mailing list