Unix/Linux Go Back    

AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

Last user login more than certain days


Thread Tools Search this Thread Display Modes
Old Unix and Linux 1 Week Ago   -   Original Discussion by leecopper
leecopper's Unix or Linux Image
leecopper leecopper is offline
Registered User
Join Date: May 2017
Last Activity: 19 February 2018, 10:19 PM EST
Posts: 13
Thanks: 6
Thanked 0 Times in 0 Posts
Last user login more than certain days

Hi guys ,

I would like to check if there is any command I can list the inactive user with not log in more than 50 days?

Any help will be appreciated. Thanks
Sponsored Links
Old Unix and Linux 1 Week Ago   -   Original Discussion by leecopper
rbatte1's Unix or Linux Image
rbatte1 rbatte1 is offline Forum Staff  
Root armed
Join Date: Jun 2007
Last Activity: 23 February 2018, 10:02 AM EST
Location: Lancashire, UK
Posts: 3,487
Thanks: 1,518
Thanked 679 Times in 612 Posts
If you can use last and get a list of those that have been active for your desired period, then you can use something like:-

cut -f1 -d ":" /etc/passwd | grep -vf active-list

You have to be careful that the active list doesn't match multiple accounts, e.g. a user named bob in the active list might also match bobby and you won't see it in the output.

How are your users defined? Are there likely to be false-positives in this?

perhaps you also need to merge your active list with a list of service accounts, e.g. root or oracle or whatever. You need to be sure that your listed idle users are checked before you do anything too drastic with them.

I hope that this helps,
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
User Account Login Login on your AIX server perl_in_my_shel AIX 1 07-02-2012 06:39 PM
How to Login as another user through Shell script from current user[Not Root] ujjwal27 Shell Programming and Scripting 9 05-27-2012 12:50 PM
error message rmclomv ... SC Login Failure for user Please login: lifegeek Solaris 1 10-21-2009 01:03 PM
Running script from other user rather than login user rawatds Shell Programming and Scripting 3 01-30-2009 01:18 PM
Script to calculate user's last login to check if > 90 days pdtak Shell Programming and Scripting 3 11-01-2008 06:36 AM

All times are GMT -4. The time now is 02:15 PM.