Setting up openssh to use a SOCKS 4 proxy

Jul 11, '03 07:00:00AM

Contributed by: slander

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.]

Comments (6)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030707082555629