Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to reverse tunnel?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Sun Apr 04, 2010 6:45 am    Post subject: How to reverse tunnel? Reply with quote

Suppose the SSH server (the box in which I want log into) has name serve, having IP 192.168.1.1 and the host's name is client with ip 192.168.1.2

From the tutorials I got -

ssh -R <the host's open port>localhost:22 <username>@192.168.1

In the server to set up a reverse tunnel.

My question is what is this localhost?...and why port 22?

Is all this possible without a third 'middle' computer?
_________________
My blog
Back to top
View user's profile Send private message
jordanwb
l33t
l33t


Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Sun Apr 04, 2010 2:58 pm    Post subject: Re: How to reverse tunnel? Reply with quote

dE_logics wrote:
My question is what is this localhost?...and why port 22?


localhost resolves to 127.0.0.1 which is the ip address that the ssh server listens on. Port 22 is the port that ssh listens on.

Btw you spelled "sense" in your signature incorrectly.
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Mon Apr 05, 2010 4:40 pm    Post subject: Reply with quote

Thanks for telling me that.

So 127.0.0.1 (or localhost) is assumed to be the server? So wont it be wrong to use localhost in case the server's address (in this example 192.168.1.1 and external, through NAT) which is not 127.0.0.1?
_________________
My blog
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Mon Apr 05, 2010 10:05 pm    Post subject: Reply with quote

127.0.0.1 always points to the local machine, that's what the loopback (lo) interface is for.

I'm not entirely sure what you're asking in the initial question, but the ports involved in the forwarding are arbitrary (although if you're a regular user, you'll need to use ports >1024). The localhost is what you'd normally use, the only case you wouldn't is if you were trying to reach a third machine which was only reachable via the machine you're sshing to (or from, in the case of a reverse forwarding).
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
dE_logics
Advocate
Advocate


Joined: 02 Jan 2009
Posts: 2253
Location: $TERM

PostPosted: Tue Apr 06, 2010 5:10 am    Post subject: Reply with quote

Ok, now I understand. Thanks!

We do not have to use the external IP for this setting in the server.
_________________
My blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum