-   Linux - Newbie (
-   -   SSH tunneling question. (

lukoro 03-28-2012 04:13 PM

SSH tunneling question.
So I'm trying to follow this tutorial -

I'm having trouble understanding the "The SOCKS Proxy way" part of it.

Do I need to have an SSH server running on my "HOME" computer using OpenSSH? And use OpenSSH at the "WORK" computer for it to work? Or can I use PuTTY at "WORK"?

If anyone can explain maybe how to do this in a little more detail, it would be awesome.

Thank you.

A.Thyssen 03-29-2012 03:52 AM

You only need a server at the remote end (where the output of the proxy will come from. The local proxy port is setup for the duration of the ssh command, when can be backgrounded.

Example: Run this...

ssh -N -o BatchMode=yes -D 4001 $rhost &
echo PID of SSH proxy = $!

Now you have a SOCKS proxy port on 4001 of the local machine.
Remember that PID! You need to kill that background daemon process to close the proxy link!

Here is a test I like to try...

curl --socks5 localhost:4001 |
  grep -A1 IP

This should return the IP address of the remote host where the SOCK proxy comes out! If it comes back with your local IP, or an error something is wrong.

You may like to look at "tsocks" which is a LD_PRELOAD library that will force most applications to use the indicated proxy port for its internet communications.

lukoro 03-29-2012 07:48 AM

Thank you very much!

A.Thyssen 03-29-2012 11:57 PM


Originally Posted by lukoro (Post 4639637)
Thank you very much!

Be sure to up my repretation ;-)

I am a late commer to these foums, so could use the 'rep' ;-)

All times are GMT -5. The time now is 05:19 PM.