1833554 Members
3069 Online
110061 Solutions
New Discussion

Listing inactive users

 
binraj
Occasional Advisor

Listing inactive users

Hi

Is there any way to get the list of dormant users who have never logged into the system for a certain period of time (eg: 30 days.

I know that we can get this information using last command. However, my wtmp file got truncated and hence I am unable to use this command. Is there any alternate way in hp-ux?

Thanks in advance
6 REPLIES 6
Michal Toth
Regular Advisor

Re: Listing inactive users


option 1) retain wtmp records for at least 30 days

option 2) put something in system wide profile that would create a record somewhere each time an interactive shell is started for a user, then you could use it for your checks (basically a very primitive paralel wtmp log)

and surely there are other ways
binraj
Occasional Advisor

Re: Listing inactive users

Hi

Thanks for the reply. However, I am trying to see some native option available for getting the information at present. I can not use my wtmp file as it is refreshed one.

Thanks
Yang Qin_1
Honored Contributor

Re: Listing inactive users

If you setup .sh_history file for all your users and suppose after they log on to the system they will at least type one command then you can list all .sh_history file and see whose .sh_history is not updated for a long time. Note using FTP to logon to the server will not record anything in .sh_history file.

ls -lt /home/*/.sh_history

Yang
Peter Godron
Honored Contributor

Re: Listing inactive users

Hi,
if your system is trusted, can't you use getprpw to get last login details.
Or use 'find' to check on the time of the users .profile file in their home directory
Peter Godron
Honored Contributor

Re: Listing inactive users

Hi,
could you please update this thread with your latest status.
Were any of the answers useful?
binraj
Occasional Advisor

Re: Listing inactive users

Thanks to all those who replied to my query.

Since there is no direct way for systems that are not trusted, I will have to go with suggestion given to check timestamp of .sh_history.

Thanks