Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm not sure if this question is best suited here on ServerFault or over on SuperUser. Thinking about it logically I think this is a sysadmin question, so I'm putting it here, and if the mods think it should move, then apologies for guessing wrong!

Anyhow - I have a server off-site, and I'm stuck on a private IP with non access to the net except through an HTTP proxy or a SOCKS 4/5 proxy. I'm running OS X, and I'd like the ssh command from the terminal to somehow work through one of those two proxies to get out to the remote server. The SSH port on the remote server is non-standard, though I doubt that will make much difference.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Yes this can be done. See this site for one example.

Basically you use your local ~/.ssh/config flle (or /etc/ssh/ssh_config if you need it to be system-wide) to specify a ProxyCommand directive for the hosts that you need to go through the proxy to get to.

You can also use nc (which comes with OS X) instead of the software they mention on that site.

Refer to the ssh_config(5) and nc(1) man pages for additional information.

share|improve this answer
    
Unfortunately the page you link to is out of date, and the link to the patched version of the binary is dead - 404 error. –  Bart B Sep 27 '11 at 13:16
1  
Oh how embarrassing this is - I found a link to a working proxy command that still compiles on OS X 10.7 Lion, and still works, ON MY OWN BLOG! In my defence the post is 6 years old, but still. Working instructions here: bartbusschots.ie/blog/?p=184 –  Bart B Sep 27 '11 at 13:28
1  
@BartB "Anything you wrote more than a week ago may as well have been written by someone else." -- It's a programming axiom, but it holds true for sysadmins and bloggers too. –  voretaq7 Sep 27 '11 at 17:18

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.