Including port number in known_hosts? - SSH

This is a discussion on Including port number in known_hosts? - SSH ; We've got a case where we use a box with a single IP to proxy into multiple SSH servers; the way that known_hosts works right now, it only matches on the IP address or hostname.. is it possible to get ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Including port number in known_hosts?

  1. Including port number in known_hosts?

    We've got a case where we use a box with a single IP to proxy into
    multiple SSH servers; the way that known_hosts works right now, it only
    matches on the IP address or hostname.. is it possible to get known_hosts
    to include the port number, so you can have multiple SSH servers (with
    different keys) available via the same IP?

    ------------------------------------------------------------------------
    | nate carlson | natecars@natecarlson.com | http://www.natecarlson.com |
    | depriving some poor village of its idiot since 1981 |
    ------------------------------------------------------------------------

  2. Re: Including port number in known_hosts?

    >>>>> "NC" == Nate Carlson writes:

    NC> We've got a case where we use a box with a single IP to proxy into
    NC> multiple SSH servers; the way that known_hosts works right now, it
    NC> only matches on the IP address or hostname.. is it possible to get
    NC> known_hosts to include the port number, so you can have multiple
    NC> SSH servers (with different keys) available via the same IP?

    [~/.ssh/config]

    host foo
    hostname gateway
    port 221

    host bar
    hostname gateway
    port 222

    ..
    ..
    ..

    [~/.ssh/known_hosts]

    gateway (key of server to which gateway:221 is forwarded)
    gateway (key of server to which gateway:222 is forwarded)
    ....

    --
    Richard Silverman
    res@qoxp.net


  3. Re: Including port number in known_hosts?

    On Mon, 30 Jan 2006, Richard E. Silverman wrote:
    > [~/.ssh/config]
    >
    > host foo
    > hostname gateway
    > port 221
    >
    > host bar
    > hostname gateway
    > port 222
    >
    > .
    > .
    > .
    >
    > [~/.ssh/known_hosts]
    >
    > gateway (key of server to which gateway:221 is forwarded)
    > gateway (key of server to which gateway:222 is forwarded)
    > ...


    Ah, makes sense. Thanks!

    ------------------------------------------------------------------------
    | nate carlson | natecars@natecarlson.com | http://www.natecarlson.com |
    | depriving some poor village of its idiot since 1981 |
    ------------------------------------------------------------------------

+ Reply to Thread