[CentOS] Multiple FreeNX servers and SSH ports

Sun Mar 21 16:18:55 UTC 2010
Stephen Harris <lists at spuddy.org>

On Sun, Mar 21, 2010 at 05:03:12PM +0100, Niki Kovacs wrote:

> Now I can ssh into my two machines from the outside, using my public IP 
> address. E. g. :
> 
> # ssh my.ip.add.res -p 10022 --> I'm logged into bernadette
> 
> # ssh my.ip.add.res -p 10023 --> Logs me into raymonde

[ Key changed... ]

> Now, of course, I could manually open ~/.ssh/known_hosts, erase the 
> respective line and then log back again. But is there a more orthodox 
> way to log into two different machines via two distinct ports on one 
> single IP address without getting this sort of error ?

>From "man ssh_config" look into CheckHostIP

For example:

  Host bernadette
    HostName my.ip.add.ress
    Port 10022
    HostKeyAlias bernadette
    CheckHostIP no

  Host raymonde
    HostName my.ip.add.ress
    Port 10023
    HostKeyAlias raymonde
    CheckHostIP no

Now you should be able to do "ssh bernadette" and "ssh raymonde".

Personnally, I use something like dnsalias.org to register my hostname
so if the IP address changes I don't need to change config files
(set HostName foobar.dnsalias.org - where foobar is the name you registered)

-- 

rgds
Stephen