Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 2009 15:26:29 -0800
From:      George Davidovich <freebsd@optimis.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: "Last login" message
Message-ID:  <20091204232629.GC18745@marvin.optimis.net>
In-Reply-To: <560f92640912031516r7519dbb9x32e236b90f2b6508@mail.gmail.com>
References:  <560f92640912031516r7519dbb9x32e236b90f2b6508@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 03, 2009 at 03:16:54PM -0800, Nerius Landys wrote:
> When I ssh to my FreeBSD machine, I get something like this:
> 
> Last login: Thu Dec  3 15:12:40 2009 from 11.22.33.44
> Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
>         The Regents of the University of California.  All rights
>         reserved.
> 
> FreeBSD 7.1-RELEASE-p9 (DAFFY) #0: Thu Dec  3 11:33:28 PST 2009
> 
> ..where "11.22.33.44" is an IP address.  However, sometimes, in place
> of an IP address I get a truncated hostname, for example
> "daffy.nerius.co" (note the last 'm' missing).  I was wondering what
> controls this, meaning if I get an IP or a hostname, and why it's
> being truncated.

If 'touch ~/.hushlogin' isn't what you're after, consider modifying
sshd_flags in /etc/rc.conf.  From sshd(8):

 -u len  This option is used to specify the size of the field in the
         utmp structure that holds the remote host name.  If the
         resolved host name is longer than len, the dotted decimal value
         will be used instead.  This allows hosts with very long host
         names that over- flow this field to still be uniquely
         identified.  Specifying -u0 indicates that only dotted decimal
         addresses should be put into the utmp file.  -u0 may also be
         used to prevent sshd from making DNS requests unless the
         authentication mechanism or configuration requires it.
         Authentication mechanisms that may require DNS include
         RhostsRSAAuthentication, HostbasedAuthentication, and using a
         from="pattern-list" option in a key file.  Configuration
         options that require DNS include using a USER@HOST pattern in
         AllowUsers or DenyUsers.

I count 'daffy.nerius.co' as 15.

-- 
George




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091204232629.GC18745>