LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Other *NIX
User Name
Password
Other *NIX This forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.

Notices

Reply
 
Search this Thread
Old 06-08-2011, 09:24 AM   #1
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Rep: Reputation: 0
Last login all user details with last login date needed


HI Techies,

I need the details of last login of all user with the last login date. (of all user, not only for those who have log in)

I have system with HP-UX OS installed.
(HP-UX B.11.00 U 9000/800 646319351 unlimited-user license)

I tried with the "last" command but not getting all user last login details with date.
command gives me only details about last login users and time, month,date not the year details.

Rgds,
Vikas
 
Old 06-08-2011, 12:45 PM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,950
Blog Entries: 5

Rep: Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755
Interesting - I installed some HP-UX 11 systems in Vashi (Navi Mumbai) back in 1998. I wonder if you're using those.

Anyway the information is stored in /var/adm/wtmp as binary data. Since /var/adm/wtmp grows it isn't unusual for people to truncate it over time to free up space so it may not have all the history you want.

You can use fwtmp command to dump wtmp file into ASCII format and see the year for logins there. You'd have to script getting the last login for each user.

The dump can be done with:
/usr/sbin/acct/fwtmp </var/adm/wtmp

You can redirect that to a file:
e.g.
/usr/sbin/acct/fwtmp </var/adm/wtmp >/var/adm/crash/fwtmp.out

Note that /var/adm/wtmp is often very large so it is important that you be sure your target directory/filesystem has enough room for the ascii dump.

Last edited by MensaWater; 06-08-2011 at 01:17 PM.
 
1 members found this post helpful.
Old 06-10-2011, 04:44 AM   #3
gadhave.vikas
LQ Newbie
 
Registered: May 2009
Location: Navi Mumbai (Maharashtra)
Distribution: Dont Know
Posts: 22

Original Poster
Rep: Reputation: 0
Hye Mensa Water thanks for your reply,
Am not working at Vashi working with some ware else.

I check with your advice but I did not find the required information, as I need all users last login details, not only those who had logged in to the system. I check the wtmp.
wtmp gives me only those details who have at least logged in to the system at single time.
Any way’s nice for R & D
I found one script from Google which derived the details using last command and with the help of passwd file. but still I am facing one issue as the last command not giving me year details the last command gives me only time month and users details.

So please advise me if any command is there with providing user login details with year information.


Rgds,
Vikas
 
Old 06-10-2011, 01:50 PM   #4
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,950
Blog Entries: 5

Rep: Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755Reputation: 755
The btpm file shows failed logins. You can run the command I gave against it as well.

The last command uses the information from wtmp. The only way to get year information is by using the other command.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User login expiry date? geekgrl Linux - Security 7 07-04-2011 06:08 AM
A script that will display only the last login of each user with the date and year? mrotsliah Linux - General 4 04-21-2010 03:42 AM
user login details abhijeetdutta Linux - Server 7 10-24-2009 04:09 AM
Gnome: Cannot login as default user, sends back to login, works as root Danny-T Linux - Newbie 2 05-27-2006 03:44 AM
Can't login remotely via new user created. Urgent help needed geomonap Red Hat 4 09-26-2005 02:44 PM


All times are GMT -5. The time now is 10:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration