1826373 Members
4262 Online
109692 Solutions
New Discussion

Re: lastlogin file

 
SOLVED
Go to solution
Sunil Sharma_1
Honored Contributor

lastlogin file

Hi All,

I want to know the information about lastlogin date and time for every users. My system is not in trusted mode.

other flavour of unix has lastlogin file whihc keep track of this bur i could not locate same in hp ux 11.11.

Is there anyfile like this in HP UX ?

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
6 REPLIES 6
Dani Seely
Valued Contributor

Re: lastlogin file

Hi Sunil, use the "last" command to show a listing of the last logged in users. Last searches back through the file /var/log/wtmp and displays a list of all users logged in (and out) since that file was created.

Also, I think on a system in untrusted mode you could check the syslog file and search for login.
Together We Stand!
Bharat Katkar
Honored Contributor

Re: lastlogin file

Use
# lastb -R

see man lastb
Read about /var/adm/wtmp and /var/adm/btmp

This two file contains information of Logins and they can even provide you with the IP addresses from where users logs in.

This is very important if you want to trace any user.

You need to know a lot to actually know how little you know
Sunil Sharma_1
Honored Contributor

Re: lastlogin file

When system in runing in trusted mode the value of parameter u_suclog give the information when user last login to system.

wtmp file give the historical data about user activity.

lastlog file give information about only last activiy of user.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
Bharat Katkar
Honored Contributor

Re: lastlogin file

Still your question is not cleared .. could U explain it more details..?
Thanks
You need to know a lot to actually know how little you know
Darren Prior
Honored Contributor
Solution

Re: lastlogin file

Hi Sunil,

As far as I'm aware there is no direct equivalent to u_suclog on an untrusted system. Unless you want to add a line to /etc/profile to touch a file for each user in a specific directory I'd suggest you use the output from last and use grep and head to get only the latest value for each user.

regards,

Darren.
Calm down. It's only ones and zeros...
Pete Randall
Outstanding Contributor

Re: lastlogin file

Sunil,

This might not be what you're looking for and it's probably not very accurate, but take a look at the finger command:

yukon(13)root# finger lld
Login name: llc In real life: Larry Dumstom
Bldg: acct1_hp405
Directory: /nfs/yukon/home/lld Shell: /bin/ksh
On since Apr 29 06:04:29 on dtremote from yukon


Pete

Pete