From owner-freebsd-questions Wed Sep 5 11:53:44 2001 Delivered-To: freebsd-questions@freebsd.org Received: from skew.org (skew.org [216.241.42.159]) by hub.freebsd.org (Postfix) with ESMTP id AEFF837B407 for ; Wed, 5 Sep 2001 11:53:37 -0700 (PDT) Received: (from mike@localhost) by skew.org (8.11.4/8.11.4) id f85IsPx60561 for questions@freebsd.org; Wed, 5 Sep 2001 12:54:25 -0600 (MDT) (envelope-from mike) From: Mike Brown Message-Id: <200109051854.f85IsPx60561@skew.org> Subject: Re: 'w -n' returning hostnames -- SOLVED In-Reply-To: <20010905174155.U96906@sunbay.com> "from Ruslan Ermilov at Sep 5, 2001 05:41:55 pm" To: questions@freebsd.org Date: Wed, 5 Sep 2001 12:54:25 -0600 (MDT) X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ruslan Ermilov wrote: > Make sure the w(1) in question is /usr/bin/w. It is. But you got me to thinking about it some more, and for the sake of the archives, I am posting a better diagnosis. w(1) is just interpreting what is in /var/run/utmp. Upon examining this file, I see that it contains the truncated hostname in some cases, not the IP address. utmp is written to by login(1) if you use telnet or if you use ssh with "UseLogin yes" in sshd_config. Otherwise utmp is updated by sshd. I just realized that I had "UseLogin no" in the config, so sshd is doing the utmp maintenance on this system, whereas on the other system with the working 'w -n', I have "UseLogin yes" and it is login(1) doing the maintenance. It looks like the solution is to invoke sshd with the "-u0" option, or to use UseLogin yes. I'm going with the latter because changes to /etc/login.conf (.db) aren't picked up if you don't use login(1). - Mike ____________________________________________________________________________ mike j. brown, fourthought.com | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | personal: http://hyperreal.org/~mike/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message