LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-25-2011, 07:21 AM   #1
eddsstudio
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: Disabled
Post 2 linux boxes, proxy and ssh tunnel forwarding


Hi,

problem: I need create ssh forwarding to other linux box that works as a proxy.

I have two linux boxes(centos 5.5), one in the office(server1) behind firewall, other at colocation(server2)

server1 has squid proxy instaled on port 3128.

i cant use server1 as a direct proxy from home because its behind firewall.

iwas able to create ssh tunnel from server1 to server2 and when i log in to server2 ican ssh root@localhost -p 12312 to server1

what i need is configure server2 so it forwards port server2:3128 to server1:3128

and i could add server2 ip addres and port to firefox proxy's and access ofice network.

Thanx
 
Old 05-25-2011, 07:39 AM   #2
tirab
Member
 
Registered: Dec 2010
Location: Italy, Lucca
Distribution: Slackware
Posts: 38

Rep: Reputation: 0
There is a "reverse" mode for ssh (-R)

Something like this:

On server1 (behind firewall)
Code:
ssh*-*R*9000:127.0.0.1:3128**-p*22**-l*usernameonserver2*ip_of_server2 -f -N
On server2 (home):
Code:
ssh**-p*9000 -l*usernameonserver1 127.0.0.1
On your browser the proxy will be: 127.0.0.1:9000

good luck
 
Old 05-25-2011, 07:51 AM   #3
eddsstudio
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Ok thanx,

this should work from home,

but if i am on other network with laptop, will it work if i add my home server box IP ??

will it forward it to server2 ??
 
Old 05-25-2011, 08:18 AM   #4
tirab
Member
 
Registered: Dec 2010
Location: Italy, Lucca
Distribution: Slackware
Posts: 38

Rep: Reputation: 0
(not tryed) but if you put server2 IP instead of 127.0.0.1 it should work ... (port 9000 in the example ...)
 
  


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
SSH Tunnel Forwarding with no shell Unixscript Linux - Server 1 07-10-2010 01:58 AM
ssh tunnel port forwarding andycol Linux - Server 2 03-18-2010 08:01 AM
ssh tunnel / port forwarding Q FrayAdjacent Linux - Networking 2 07-05-2005 04:37 PM
SSH tunnel or Iptables forwarding jatro Linux - Networking 5 06-15-2005 04:07 AM
game proxy ? udp forwarding ? tunnel ? n33dH3lp Linux - Networking 1 11-10-2003 01:13 PM


All times are GMT -5. The time now is 01:49 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration