Re: ssh_config: Hostname with multiple IP addresses

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



David Newall wrote:
> All of this fails to help the original question, which is how to specify
> multiple IP addresses.  The obvious answer to that is to put multiple A
> records into your local DNS.  If you don't have a local DNS or have no
> control over it, specify multiple Hosts in your config, one for each IP
> address.

Just some brainstorming here...

It should always be possible to populate the local /etc/hosts file as
an override to DNS with a local unique name.  And then use that local
name in the config file.

Example /etc/hosts:

    93.184.216.34 foo.example.com foo
    2606:2800:220:1:248:1893:25c8:1946 foo.example.com foo

Example ssh config:

    Host shortname realname.example.com
      HostKeyAlias realname.example.com
      Hostname foo

Use like:

    ssh shortname
    ssh realname.example.com

I tested this just now and on a host with IPv6 connectivity it used
the IPv6 address.  The same configuration on a host with only IPv4
connectivity used the IPv4 address.

It's perhaps not the simplest of configurations but it did seem to fit
the criteria.  The way to get both an IPv4 and an IPv6 address
available to Hostname.  By stitching it through the /etc/hosts file.
WDYT?

Bob

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux