Re: Multiple machines at one IP

reg_at_dwf.com
Date: 10/30/03

  • Next message: JM: "Logging SFTP transfer.."
    To: "Doug Griswold" <griswld@cio.sc.gov>
    Date: Thu, 30 Oct 2003 00:21:35 -0700
    
    

    > the others from there, but there are times when it is necessary to ssh
    > directly to my PC on port 1602 instead. The problem is that, even
    > without strict checking enabled, OpenSSH doesn't seem to like a
    > different computer answering on the IP that the main login box answered
    > on before. I get a giant warning and an error and cannot connect. The
    > issue is that it stores the keys by IP address only, not IP and port
    > number, so it doesn't know that going to port 22 and port 1602 are two
    > different machines. The only resoltion I have come up with was to set
    > up a shell script that purges the known_hosts file each time, and then I
    >

    I had exactly the same problem, and complained that SSH should keep info
    not just bi IP, but by IP,port.

    Someone on this list pointed out that its not really necessary, as there
    is a hook in SSH to get around the problem.

    OK, enough, here is what you want to do at work.
    Add the file ~/.ssh/config to the files in .ssh, and put something like
    this in it:

    HOST mymachine
            HostName <external-IP>
            Port 1602
            HostKeyAlias mymachine

    and then ssh to <mymachine> rather than ssh'ing to the external-IP -p 1602.

    This will keep the statistics in known_hosts under <external-IP> if you
    go to that machine directly, and under <mymachine> when using the above
    'alias' so there are no complaints.

    -- 
                                            Reg.Clemens
                                            reg@dwf.com
    

  • Next message: JM: "Logging SFTP transfer.."