LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 01-28-2012, 09:23 AM   #1
newbie0101
Member
 
Registered: Nov 2011
Posts: 37

Rep: Reputation: Disabled
check how many days has been an account inactive


hi, how can one check for how many days an user hasn't logged into they account ?

i know there is command:
Code:
last user
that tells me when was last logged in but i want to have number of days that the user hasn't logged in.

thanks
 
Old 01-29-2012, 02:08 AM   #2
ukiuki
Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian, Ubuntu, Tinycore
Posts: 464

Rep: Reputation: 81
This: http://pwet.fr/man/linux/commandes/radlist

Regards
 
Old 01-29-2012, 10:31 AM   #3
Reuti
Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 970

Rep: Reputation: 184Reputation: 184
last will only work on the latest wtmp file, which might have been rotated already and for former entries you would have to scan in the rotated ones.

You can use:
Code:
$ lastlog -u user
which will give you the latest time the user was logged in. The difference in days needs to be computed though.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inactive Account Lock pattanaikhr Linux - Software 3 04-21-2011 03:57 AM
account should be expired/locked if not logged in for 15 days through FTP linux_beginer Linux - Server 1 03-26-2011 07:25 AM
account should be expired if not logged in for 15 days through FTP linux_beginer Linux - Server 5 03-24-2011 12:36 AM
to lock the account if not accessed through FTP for 15 days linux_beginer Linux - Newbie 2 03-23-2011 10:46 AM


All times are GMT -5. The time now is 08:39 AM.

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
Open Source Consulting | Domain Registration