[CentOS] Multiple FreeNX servers and SSH ports

Simon Billis simon at houxou.com
Sun Mar 21 17:06:28 UTC 2010


Hi Nikki,


Niki Kovacs sent a missive on 2010-03-21:

> Les Mikesell a écrit :
>> 
>> You don't really need to change the ports on the hosts.  Just configure
>> the router to accept different ports on the internet side and redirect
>> to port 22 at the different IP addresses on the inside. Then you only
>> have to change the client settings for access from outside.   I'd move
>> both of them away from port 22 on the outside, though - you'll avoid a
>> lot of password guessing attempts that will happen otherwise.
>> 
> 
> Sorry, but I don't quite follow you. (One of these cases where I feel
> my IQ is just a bit insufficient :oD)
> 
> How can I possibly access two distinct machines behind one single IP
> address when they run SSH on the same port ?

You have to use a combination of NAT and PAT (NAT is Network address
translation and PAT is Port address translation) on the router.

> 
> Or, I'll reformulate my question more simply.
> 
> I have a router with *one* public IP address (213.41.141.252). And
> behind that router, on the local network, I have two different machines:
> 192.168.1.2 and 192.168.1.3.
> 
> Is there a (normal, orthodox) way to SSH into these machines directly
> from the outside? That is, without logging into the main box and then
> hopping around internally? Something where in one case, ssh
> 213.41.141.252 -option gets me into machine A, and then ssh
> 213.141.141.252 -otheroption gets me into machine B.
> 
> I'm confused.

Depending on your router you will be able to configure it to do what you
want.

On your router you "should" be able to do the following:
Redirect connections to 213.141.141.252 port 2222 to 192.168.1.2 port 22 AND
Redirect connections to 213.141.141.252 port 2223 to 192.168.1.3 port 22

You then can connect using your favourite ssh client (mine is absolute
telnet :-) ) by connecting to 213.141.141.252 port 2222 you'll be connected
to 192.168.1.2 via ssh.

Simples!

Hope this helps

Simon.






More information about the CentOS mailing list