[openssh-commits] [openssh] 02/02: upstream: hostname is not specified by POSIX but uname -n is, so use
Jochen.Bern at binect.de
Tue Feb 9 18:58:06 AEDT 2021
On 09.02.21 01:25, Nico Kadel-Garcia wrote:
> On Mon, Feb 8, 2021 at 3:59 PM Bob Proulx <bob at proulx.com> wrote:
>> The hostname -f option is a "new-ish" Linux specific option. It's not
>> portable. And because it works by doing a reverse DNS lookup it
>> depends upon live network connectivity at that moment working for the
>> network lookup and the results are spotty depending upon how DNS is
>> set up and how many IP addresses are configured on the host.
> It looks in /etc/hosts first, which works very well when DNS is
> unavailable and when the host his publishing a dynamic DNS entry.
Suffice to say that I added a check to our monitoring so as to detect
machines entering production where `hostname`, not to even mention
/etc/hosts, still returns "localhost.localdomain" or even just
"localhost" instead of something unique.
Out of interest, what *purpose* is the obtained hostname being used for?
Does OpenSSH actually *need* it to be a) unique, b) reproducible, and/or
c) a proper FQDN, or does it merely enter the comment of autogenerated
host keypairs? All the KnownHosts checking AFAIR happens on the *client*
side and uses whatever name(s) of the server are known *there* ...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3449 bytes
Desc: S/MIME Cryptographic Signature
More information about the openssh-unix-dev