LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Closed Thread
  Search this Thread
Old 06-09-2007, 09:58 AM   #1
kholloi
LQ Newbie
 
Registered: May 2007
Posts: 6

Rep: Reputation: 0
tunneling squid over ssh


Hello forum.

My Situation is this. I live in a country where internet access is severely restricted. I need to access certain sites which are believed to be inconsistent with the morals and ethics of this great hypocritical state.

I have SSH access to a Linux server which I work on in another country, lets call it rmt1.freedom.net.
I set up a squid proxy server on rmt1 and it is actually being used as a proxy server from the LAN at freedom.net.
I have no control over the firewall at freedom.net. It only allows SSH from my IP.

So here is what I have in mind. I want to create an SSH tunnel from my linux based desktop to rmt1.freedom.net:3128. Then I want to configure my browser to connect to virtual proxy at localhost:3128. These connections should then be forwarded via the ssh tunnel to rmt1.freedom.net:3128.

The man page is way too cryptic for me. If I can see an example of how this is done I would be much obliged.

Thanks
 
Old 06-09-2007, 02:03 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
[ Command removed by win32sux ]

-L means tunnel local port to some addressort relative to remote machine.

Last edited by win32sux; 06-10-2007 at 08:23 PM.
 
Old 06-10-2007, 01:12 AM   #3
kholloi
LQ Newbie
 
Registered: May 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks Raskin,

sorry but I am a little confused. Which command am I supposed to use? Or do I run one on the local machine and one on rmt1.freedom.net?

L
 
Old 06-10-2007, 01:23 AM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Try both, one at a time. I think that both ways work, but I can forget something. Your proxy will be 127.0.0.1:3128 from your box then.
 
Old 06-10-2007, 02:19 AM   #5
kholloi
LQ Newbie
 
Registered: May 2007
Posts: 6

Original Poster
Rep: Reputation: 0
OK Cool thanks for the help.
WIll take it from here and play it by ear.
 
Old 06-10-2007, 09:40 AM   #6
Bebo
Member
 
Registered: Jul 2003
Location: Göteborg
Distribution: Arch Linux (current)
Posts: 553

Rep: Reputation: 31
I often do this kind of proxying when at work. I use ssh to setup a tunnel from my work laptop to my home computer, which in turn runs squid. Here is the command that I use (translated to kholloi's case )

[ Command removed by win32sux ]

Then I tell Firefox to use 127.0.0.1:3128 as proxy (the xyzproxy Firefox add-on is a nice tool for quickly changing proxies). When I'm finished I just kill the ssh connection.

Oh, about the -f and -N options; -f tells ssh to just fork into the background after connecting, and -N tells ssh to not execute anything. That way you don't have to leave open the terminal that you execute the ssh command in.

Another "oh"; this requires the squid proxy to accept connections from localhost, you may have to edit squid's configuration for that.

Last edited by win32sux; 06-10-2007 at 08:23 PM.
 
Old 06-10-2007, 08:21 PM   #7
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by kholloi
I live in a country where internet access is severely restricted. I need to access certain sites which are believed to be inconsistent with the morals and ethics of this great hypocritical state.
LQ can play no part in helping you circumvent network access restrictions. There are plenty of places on the Web where you can get help with that, but this isn't one of them. Please refrain from asking for help here with these types of issues. Thread closed.

Last edited by win32sux; 06-10-2007 at 08:22 PM.
 
  


Closed Thread



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
Errors tunneling to a squid server kleptophobiac Linux - Networking 1 07-10-2007 11:58 AM
SSH tunneling entz Linux - Networking 3 04-04-2007 07:22 AM
Squid (Blocking tunneling sites) suhas! Linux - Server 4 03-30-2007 02:41 PM
X tunneling with SSH phekno Linux - Networking 3 05-31-2005 10:43 AM
SSH Tunneling danny_beta_read Linux - Networking 0 06-10-2004 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:09 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration