LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-05-2013, 06:30 AM   #1
swaggerlee
Member
 
Registered: Jul 2012
Location: India,Kolkata
Distribution: fedora,ubuntu
Posts: 35

Rep: Reputation: Disabled
Question how to connect a remote host via ssh behind proxy


HI all

here is the situation... let say

i deliver code to my client who is outside my network with ip 122.122.122.122 (say)

now i can connect my client via ssh with IP i.e 115.115.115.115 (say) direct connection from server room

but what i need to know is how can i connect to my client from my desk from my computer (ip 192.168.100.116) which is behind a squid proxy server.

waiting for possible solutions

Hope i described my problem briefly
 
Old 06-05-2013, 07:01 AM   #2
sunilpopaliya
Member
 
Registered: Apr 2012
Posts: 47

Rep: Reputation: 4
you want access 115.115.115.115 or 122.122.122.122 from your local system ??

I think you have a firewall between your local system to your data center right?


sunil
 
Old 06-05-2013, 07:15 AM   #3
swaggerlee
Member
 
Registered: Jul 2012
Location: India,Kolkata
Distribution: fedora,ubuntu
Posts: 35

Original Poster
Rep: Reputation: Disabled
@ sunil

i want to connect 122.122.122.122 from my local system

i have a proxy connection
 
Old 06-05-2013, 07:22 AM   #4
sunilpopaliya
Member
 
Registered: Apr 2012
Posts: 47

Rep: Reputation: 4
can you update output of tracert 122.122.122.122 from your local system?

Still i have doubt regarding your question. i want to know that 115.115.115.115 is your server which is situated at your data center right ? where 122.122.122.122 is placed ?


sunil
 
Old 06-05-2013, 07:45 AM   #5
swaggerlee
Member
 
Registered: Jul 2012
Location: India,Kolkata
Distribution: fedora,ubuntu
Posts: 35

Original Poster
Rep: Reputation: Disabled
Quote:
i want to know that 115.115.115.115 is your server

NO !!

actually it is a server with direct internet line having ip i.e 155.155.155.155 it is in our office placed in our server room

you don't have to provide proxy for browsing internet it runs on direct connection



Quote:
where 122.122.122.122 is placed ?
122.122.122.122 is our client computer IP address located some far away in same city

since our client has provided us with direct net connection (122.122.122.122). we can upload code to there machine through ssh and since i can't upload code from my desk machine as it is behind proxy so i need to go into server room and connet 122.122.122.122 from 155.155.155.155 via ssh

Quote:
can you update output of tracert 122.122.122.122 from your local system?
bash: command not found


HOPE i am clear !!!

Last edited by swaggerlee; 06-05-2013 at 07:58 AM.
 
Old 06-05-2013, 08:28 AM   #6
sunilpopaliya
Member
 
Registered: Apr 2012
Posts: 47

Rep: Reputation: 4
can you upload output of tracert 115.115.115.115 command from your local system ?


sunil popaliya
 
Old 06-05-2013, 09:45 AM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,308
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Squid is for HTTP not SSH, so having Squid or not is irrelevant for your connection.

If you can log into 122.122.122.122 from the outside using and then from there to 192.168.100.116 again using SSH, you have several options. One is to chain ssh clients:

Code:
ssh -tt 122.122.122.122 ssh -tt 192.168.100.116
Another is to use netcat. It's a little more confusing, but provides you with a more direct connection.

Code:
ssh  -o 'ProxyCommand ssh %h nc 192.168.100.116 22' \
       -o 'HostKeyAlias=192.168.100.116' \
       user@122.122.122.122
There are other options and variations, including port forwarding. But like the above, they all depend on being able to ssh to 122.122.122.122 and from there to 192.168.100.116
 
Old 06-06-2013, 12:51 AM   #8
swaggerlee
Member
 
Registered: Jul 2012
Location: India,Kolkata
Distribution: fedora,ubuntu
Posts: 35

Original Poster
Rep: Reputation: Disabled
@ sunil bhai
Quote:
can you upload output of tracert 115.115.115.115 command from your local system ?
am on windows system ,how can i give you above output !!

@ Turbocapitalist

I think you didn't read my problem carefully

i want to connect 122.122.122.122 via ssh from 192.168.100.116 and i am using windows machine

plzz read above posts carefully and solvge my problem !!
 
Old 06-06-2013, 01:07 AM   #9
sunilpopaliya
Member
 
Registered: Apr 2012
Posts: 47

Rep: Reputation: 4
in windows machine go to command prompt and run this command.

I think turbocapitalist is correct. ssh has no concern with proxy.

ssh to 122.122.122.122 from your local machine you should have proper route and you should have proper permission at your client end.


sunil
 
Old 06-06-2013, 01:13 AM   #10
a.abdulna
Member
 
Registered: Feb 2013
Location: Bangalore
Distribution: Rhel
Posts: 86

Rep: Reputation: Disabled
From local machine to able access your 115.x.x.x server through putty? then u are able access 122.x.x.x server also ( via 115)
 
Old 06-06-2013, 01:30 AM   #11
swaggerlee
Member
 
Registered: Jul 2012
Location: India,Kolkata
Distribution: fedora,ubuntu
Posts: 35

Original Poster
Rep: Reputation: Disabled
@ a.abdulna

yes i know i can do that via (115.x.x.x.) but i want to do it from my ip i.e 192.168.100.116 using putty
post something else !
 
Old 06-06-2013, 01:33 AM   #12
sunilpopaliya
Member
 
Registered: Apr 2012
Posts: 47

Rep: Reputation: 4
hey man,

He is telling you to ssh 115.115.115.115 from your local system. if it will work, you can do ssh to 122.122.122.122 also.


sunil
 
Old 06-06-2013, 01:53 AM   #13
swaggerlee
Member
 
Registered: Jul 2012
Location: India,Kolkata
Distribution: fedora,ubuntu
Posts: 35

Original Poster
Rep: Reputation: Disabled
@ sunil
the tracert output gives Request time out for 30 hops

as per ur comment can you suggest any "proper route" & "proper permission at my client end." so that i can connect 122.122.122.122 via ssh from my local machine
 
Old 06-06-2013, 01:57 AM   #14
a.abdulna
Member
 
Registered: Feb 2013
Location: Bangalore
Distribution: Rhel
Posts: 86

Rep: Reputation: Disabled
Which proxy ur having? like ( firewall, router or any proxy script ). or just try like any route add from ur putty, # route add 122.x.x.x gw x.x.x.x

please explain me your scenario..
 
Old 06-06-2013, 02:01 AM   #15
sunilpopaliya
Member
 
Registered: Apr 2012
Posts: 47

Rep: Reputation: 4
It is better now to contact your Network admin to provide you proper access to connect your server because i don't know about your network architecture.

If any other query is there upload it.

sunil
 
  


Reply

Tags
clientserver, ip, ssh



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
Connect to a proxy through a middle host with a ssh tunnel iacchi Linux - Networking 3 02-16-2012 12:02 PM
unable to connect to remote host using ssh tariq Linux - Newbie 31 11-04-2011 09:01 AM
ssh can not connect remote host crazy6 Linux - Newbie 2 03-04-2011 07:28 PM
How to connect through restricted proxy to remote host ? haxpor Programming 2 07-27-2007 01:41 AM
how 2 connect 2 remote host using SSH fhameed Linux - Networking 2 09-08-2004 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:02 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