full hostname in last

full hostname in last

Post by Karel.DeBruy » Thu, 27 Mar 1997 04:00:00



Hi,

I want to find out the complete hostname from a last entry.
the last command gives me :

dbruyne   pts/15       pcrokb1.rekc.uia Mon Mar 24 11:45 - 12:28  (00:43)

the hostname is pcrokb1.rekc.uia.ac.be

Karel
--
=======================================================================
Karel De Bruyne
System/Network Manager                      phone      + 32 3 820 22 04
UIA - Computer Centre                       fax        + 32 3 820 22 49

 
 
 

full hostname in last

Post by Shawn Laemmri » Thu, 27 Mar 1997 04:00:00



: Hi,
:
: I want to find out the complete hostname from a last entry.
: the last command gives me :
:
: dbruyne   pts/15       pcrokb1.rekc.uia Mon Mar 24 11:45 - 12:28  (00:43)
:
: the hostname is pcrokb1.rekc.uia.ac.be
:

The problem is the field in the structure is fixed length... I'm not sure
what it is off hand, but your host name is probibly longer than the
machine name part of the struct allows (for it to be fully displayed).

Shawn
-----------------------------------*--------------------------------------

System Administrator Technology Development Group
Michigan Tech University Rm 205 (906)487-1932 OR 7-2981  Fax:(906)487-3185

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAzLvj+oAAAEEAKZ/MNO8ZJA3VoeTh0o2GLmgfpn5zhxA2pGSLFQduWZNk8g3
JNPprHbUyYU7RVUkRWz4PQyVQFR7dtkXBLTUmLJAtN/ot+HzD2L80/tylkbXbfcf
RA6K7DLfvWOSbnnz2GvbNLSiHp0GsMaXU9ZAkXLHxh8cBjdvmMqq4FJZlEHVAAUR
tCJTaGF3biBMYWVtbXJpY2ggPHN3bGFlbW1yQG10dS5lZHU+
=GYiJ
-----END PGP PUBLIC KEY BLOCK-----

 
 
 

full hostname in last

Post by Casper H.S. Dik - Network Security Engine » Fri, 28 Mar 1997 04:00:00




}:
}: I want to find out the complete hostname from a last entry.
}: the last command gives me :
}:
}: dbruyne   pts/15       pcrokb1.rekc.uia Mon Mar 24 11:45 - 12:28  (00:43)
}:
}: the hostname is pcrokb1.rekc.uia.ac.be
}:
}The problem is the field in the structure is fixed length... I'm not sure
}what it is off hand, but your host name is probibly longer than the
}machine name part of the struct allows (for it to be fully displayed).

wtmpx stores a wopping total of 256 bytes of the remote hostname; last will
only show a few because it formats nicer.

So the information is there, it just won't show.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

full hostname in last

Post by Japhy Ryd » Fri, 28 Mar 1997 04:00:00



:
: wtmpx stores a wopping total of 256 bytes of the remote hostname; last will
: only show a few because it formats nicer.
:
:
: So the information is there, it just won't show.
:

yep.  its not too hard to write your own modified last command to do this
if you want either.

basically just check out the source from freebsd/netbsd whatever, to get
a general idea of whats going on, and go from there.

 
 
 

full hostname in last

Post by Cameron Lai » Sat, 29 Mar 1997 04:00:00





>:
>: wtmpx stores a wopping total of 256 bytes of the remote hostname; last will
>: only show a few because it formats nicer.
>:
>:
>: So the information is there, it just won't show.
>:

>yep.  its not too hard to write your own modified last command to do this
>if you want either.

>basically just check out the source from freebsd/netbsd whatever, to get
>a general idea of whats going on, and go from there.

I'm not so sure.  I had written the same to Mr. DeBruyne,
but he quite correctly pointed out that the information
is *not* there, at least not as you and I first said.

Here's what I know:  essentially all Unixes offer a `man
utmp`.  For BSD-derived flavors, /usr/include/utmp.h
typically includes in the definition for utmp a ut_host
field; this is NOT present, however, in SysVish Unixes,
including Solaris, in particular (and Mr. DeBruyne did
post his appeal to c.u.s).  Even for BSD, by the way,
it's stickier than might first appear, for, in the words
of one man page at hand,

        When they log out, init(8)  clears  that  entry
        by  setting ut_name  and ut_host to null strings
        ...

The key to this, as so often is the case in c.u.s, is to
read what Mr. Dik has written carefully.  He mentioned
utmpx(4).  There, eXtended utmp information, including
ut_host, is indeed available.

I'm rushed now, but perhaps over the weekend I'll post a
small example program.
--

Cameron Laird           http://starbase.neosoft.com/~claird/home.html

                        +1 713 996 8546 FAX

 
 
 

1. How to retain the full hostname in last command?

Hi..

I've recently noticed that if I run "last" for security

reasons, the hostname displayed is somewhat stripped off to certain

size such that I can't figure out the full remote hostname from

which my users logged from.

for instance...

i get something like this...

bbs       ttyp5        jade.ucs.indiana Thu May 11 13:29 - 13:32  (00:03)
                       ^^^^^^^^^^^^^^^^
bbs       ttyp4        sage.cc.purdue.e Thu May 11 13:29 - 13:30  (00:00)
                       ^^^^^^^^^^^^^^^^
bbs       ttyp4        netcom9.netcom.c Thu May 11 13:20 - 13:29  (00:09)
                       ^^^^^^^^^^^^^^^^

Is there a way around this problem??

Such that I can retrieve the full hostname..how long it may be in characters?

Any help will be greatly appreciated!

Sincerely yours,

heejoon.

--
Heejoon Park                                            
Univ.of Illinois at Urbana-Champaign      

http://www.cen.uiuc.edu/~hp8825                           Phone:1-217-332-5386

2. Canon BJC 2100

3. Full hostname in last/wtmp ?

4. NEED HELP PLEASE!!!

5. Stats: Cola last 7 days full listing (sorry late posting, I've been busy)

6. How to read a line without echo from a shell script?

7. Solaris 7 last command output doesn't show the full name of host

8. ifconfig error: SIOCSIFFLAGS: Try again --> means IRQ conflict

9. Full hostname patch or change?

10. Logging full hostname for client connection

11. why doesn't $DISPLAY or $HOSTDISPLAY show full hostname?

12. HOWTO get full hostname with `who am i` ?

13. Getting full remote hostname