Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I need to access an FTP server at work but the server will only accept local IPs. I cannot access it from my home machine. I have been able to ssh into my Unix work machine through PuTTY and from there successfully open a console FTP connection to the FTP server.

I could work through this, but I would prefer not to as it is very cumbersome for me. I would prefer to tunnel an FTP connection through the work machine via PuTTY so I may use my FTP client of choice, FileZilla, to accomplish my FTP needs on the server. Of course this is through port 21.

I know PuTTY is capable of port forwarding through ssh, I'm just not sure how to use it.

Home -> Work -> Server.

share|improve this question

migrated from serverfault.com May 19 '12 at 6:51

This question came from our site for system and network administrators.

    
There's nothing inherently different about uploading vs download over a SOCKS proxy connection. The big different is your home Internet connection is likely to have poor upload (outgoing) performance in comparison to download (incoming) performance. We'd probably need more logs to be able to diagnose it. –  EightBitTony May 20 '12 at 7:55
    
I've come to the conclusion that I'm probably on to another problem entirely and will work on creating a new question addressing this specific problem. Thank you so much for your help EightBitTony! –  Ben Jacobson May 20 '12 at 23:58
    
Might want to register your Server Fault account with the same credentials as here in order to reclaim this question @ben –  random May 21 '12 at 0:23

2 Answers 2

Use a SOCKS proxy.

PuTTY window

The source port is now (locally) a SOCKS proxy. Configure FileZilla to use it as a SOCKS proxy (see below). It'll open a connection through that to the host you ssh to (your work machine) and then connect from there, to any IP address you give it. Works for anything with supports SOCKS and that includes FTP.

The rest of the PuTTY config just remains the same - configure the ports (as shown) and then connect that PuTTY session to your Work machine via SSH.

Here's what the FileZilla option needs to look like,

enter image description here

When you put in the target for the FTP connection, use the IP address not the hostname, because DNS resolution may still happen locally and you don't want that.

The whole thing is secure and invisible - it looks like a basic SSH connection to anything else on the network.

NB: If you want to do this from the command line, you can use PuTTY's plink.exe to do the following,

plink -ssh -D 9090 you@your.work.laptop.example

it achieves the same thing without having to create a PuTTY profile or use the GUI.

share|improve this answer
    
I Like that way of doing it a little more than my answer. You can set the SOCKS proxy in filezilla under "Generic Proxy" and remember to use it in "passive mode". –  couling May 18 '12 at 21:42

Firstly its much easier / arguably better to be using SCP. Since you've got SSH it would be common for you to have SCP access also. But I don't know your network so to the question...

Firstly Make sure that your client is set to use FTP in ACTIVE mode. I wanted to suggest using passive mode but you can't control which ports will be used.

Secondly Limit the number of ports your FTP client will use in active mode down to a handful. Less that 10 would be good. And here's why.

Thirdly create remote port forwards for all of these ports.

That should get it working

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.