LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-16-2012, 06:55 AM   #1
iacchi
LQ Newbie
 
Registered: Oct 2011
Location: Florence, IT
Distribution: Debian testing
Posts: 9

Rep: Reputation: Disabled
Connect to a proxy through a middle host with a ssh tunnel


Hi everyone,
I've tried to exploit this thing the whole morning, but I couldn't find a way out.
Let me explain my situation: my university gives to student a proxy access to the university network to let them look for science articles and so on on the net and download them without paying because the university already has contracts with them.
The problem is that the dorm I'm in has a firewall which doesn't let me connect to the proxy and the sysadmins already said that they won't open that port.

Fortunatly enough, I have ssh access on a server where I keep my personal website and so on, so I was thinking to use this opportunity (since I can do ssh from my dorm) to access the proxy. What I have in mind is this:

"my laptop" == ssh tunnel ==> "hosting server" == connect ==> "proxy server"

In this way I should be able to reach the proxy from within my dorm. Surfing the net I've found the program connect and this piece of information: http://bent.latency.net/bent/git/got...ect.html#sec21
So, first of all I've tried to ssh into my hosting server and launched the connect command from there with

Code:
connect -p 3128 proxy.unito.it 3128
and then create a ssh tunnel (from my shell) with

Code:
ssh -f user@hosting-server -L 3128:localhost:3128 -N
And it kind of works: setting firefox to use localhost:3128 as a proxy I can open one internet page, but after that the connect instance on the hosting server dies and I can't connect anymore. Basically, I shoud run again the program for each page I open.

Trying to keep things simple, I've also tried the command suggested on the link above, and from my shell I run:

Code:
ssh user@hosting-server connect proxy.unito.it 3128
but after asking for the ssh password I receive this message:

Code:
bash: connect: command not found
Of course connect is installed in the server and in the path.

So, do you have any suggestion on how I can make this thing work? It doesn't need to be a ssh tunnel or whatever, I just want access to the proxy.
 
Old 02-16-2012, 07:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,398

Rep: Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965Reputation: 1965
I don't follow the logic of using the connect command. in your ssh command you're connecting to that socket that connect created, right? Well don't do that, just tell ssh to connect directly to the proxy, it's simpler than you think.
Code:
ssh user@hosting-server -L 3128:proxy.unito.it:3128
that will give you a simple "dog legged" connection.

Last edited by acid_kewpie; 02-16-2012 at 07:12 AM.
 
Old 02-16-2012, 09:17 AM   #3
omgs
Member
 
Registered: Dec 2010
Posts: 64

Rep: Reputation: 6
Just for the sake of being 100% sure everything will be understood:

1) The tunnel acid_kewpie mentions must remain open. If for any reason you close the connection, you just have to open it again.
2) You have to tell your web clients to use http://localhost:3128 as proxy

Last edited by omgs; 02-16-2012 at 09:18 AM.
 
Old 02-16-2012, 12:02 PM   #4
iacchi
LQ Newbie
 
Registered: Oct 2011
Location: Florence, IT
Distribution: Debian testing
Posts: 9

Original Poster
Rep: Reputation: Disabled
It works like a charm, thank you very much. I'm still trying to grasp the full basics of ssh tunneling.

Last edited by iacchi; 02-16-2012 at 12:04 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help for SSH tunnel through NTLM-authenticated HTTP proxy theYinYeti Linux - Networking 3 02-25-2012 02:15 PM
SSH tunnel proxy in Akonadi/Kontact/KMail desade Linux - Networking 4 10-06-2011 09:06 AM
Initiate ssh tunnel to connect to ssh? brianmcgee Linux - Security 2 09-07-2011 10:07 AM
ftp proxy via ssh tunnel on server side using what? drobert Linux - Software 3 05-09-2011 04:38 PM
How do I set up an ssh tunnel through a http proxy? wilko Linux - Networking 2 03-10-2010 01:05 PM


All times are GMT -5. The time now is 07:25 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration