Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Setting up openssh to use a SOCKS 4 proxy Apps
OpenSSH SOCKS support was removed from the OpenSSH implementation on 2000-02-07. Using SSH through SOCKS firewalls is now only supported using a ProxyCommand from within the SSH configuration files.

To use OpenSSH through SOCKS, you will need to take a few steps:
  1. Download and compile connect.c. To run the following command, you will need Apple's Developer Tools, which are freely available by registering at Apple's Developer site:
    sudo  gcc -o sconnect connect.c
  2. Add the following line in your ssh_config file, located in /etc. The command shown below is for a SOCKS4 server:
    ProxyCommand /compile_dir/sconnect -4 -S SOCKS-server:1080 %h %p
    Replace compile_dir with the directory containing sconnect, and replace SOCKS-server with the address of your SOCKS server.
[robg adds: I have not tested this hint myself.]
    •    
  • Currently 3.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[18,225 views]  

Setting up openssh to use a SOCKS 4 proxy | 6 comments | Create New Account
Click here to return to the 'Setting up openssh to use a SOCKS 4 proxy' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Setting up openssh to use a SOCKS 4 proxy
Authored by: GaelicWizard on Jul 13, '03 04:23:38AM

Why on earth would you prefix gcc with sudo?!?

---
Pell



[ Reply to This | # ]
SOCKS 5, Making SOCKS optional, and cool things
Authored by: CarlosD on Jul 14, '03 05:20:18PM

I have been using this for quite a while and it works quite well. I would amend this hint by letting you know that it does work for SOCKS v5 as well -- just use -5 instead of -4 in the configuration file.

Also, better than putting the ProxyCommand in the default config, create a copy of the config (called ssh_config.socks, say) with the ProxyCommand line. This way you have the option of specifying that you wish to use socks in the command line itself using the -F (config file) switch. (Or make the *copy* the non-socks version if you expect to be using ssh more outside the firewall.)

For example, you can do something like this:

ssh in-house-host.mycompany.com
# uses the default, non-socksified config

ssh -F /etc/ssh_config.socks outside.host.com
# uses your modified config via the SOCKS server

Combined with dynamic dns or a static IP, you can do things with your machine from almost anywhere. What's *really* cool is when you combine this with tunneling (the -L switch) and VNC: free, secure, encrypted, global remote control.



[ Reply to This | # ]
Setting up openssh to use a SOCKS 4 proxy
Authored by: JeffUtter on Feb 03, '04 06:52:40PM

I know this post is kind of old but (on pather atleast) you have to compile like:

gcc -o sconnect connect.c -lresolv

for it to work.



[ Reply to This | # ]
Setting up openssh to use a SOCKS 4 proxy
Authored by: mithras on Jun 26, '07 06:58:31PM
The original page has disappeared, but is available via the Web Archive.
I'll ask Rob if he can host the file here.

http://web.archive.org/web/20040805201506/http://www.imasy.or.jp/~gotoh/connect.c

---
--
mithrastheprophet.net (coming soonish)

[ Reply to This | # ]

Other mirrored copies
Authored by: jms1 on Aug 12, '07 09:38:06AM

I found a copy of it here:
https://savannah.gnu.org/maintenance/connect.c

I'm hosting a copy of the file here, just in case it disappears again...
http://www.jms1.net/code/connect.c



[ Reply to This | # ]
Other mirrored copies
Authored by: robg on Aug 18, '07 05:05:37AM
I've now uploaded the source here as well, and edited the hint to reflect the local mirror.

-rob.

[ Reply to This | # ]