LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-15-2010, 12:11 PM   #1
Neruocomp
Member
 
Registered: Oct 2004
Distribution: Slackware, CentOS
Posts: 135

Rep: Reputation: 15
Tracking old users


Is there an easy or at least any way of figuring out which users have been active and which havent? I've got 500ish users and need to start weeding.
 
Old 06-15-2010, 12:25 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Depending om how long you keep your utmp file, last / lastlog could give some info.

If you setup your password handling correctly (enforcing regular password changing), you can also use chage -l <user> to get an reasonable estimate (the first line of output: Last password change).

If these users are allowed to use su / sudo: Have a look at those logs as well.

Hope this gets you going.
 
Old 06-15-2010, 01:03 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
In your "weeding" you don't need to delete the users. Use usermod -s /bin/false" to set the shell for each to /bin/false so if they attempt to login it logs them out. You can also run "passwd -l" to lock the accounts.

If the users you lock out call to complain you can easily revert by using "passwd -u" to unlock the account and set the user password back to what it was before the lock.

You could also use usermod -c to add a comment to the account noting when you locked it (e.g. usermod -c "Locked 15 Jun 2010" -s /bin/false <loginid>). Then at some later point you can look to see when accounts were locked. If they are still locked 6 months later (or 10 days later depending on what you decided) then you can delete them.

Note that many shops never delete users so as to not reuse UID numbers - that way if you had occasion to restore some old backup it would come in with the correct login IDs on the files instead of just the UID.
 
Old 06-15-2010, 03:42 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by MensaWater
Note that many shops never delete users so as to not reuse UID numbers - that way if you had occasion to restore some old backup it would come in with the correct login IDs on the files instead of just the UID.
+1

@Neruocomp: Some more things to consider when "retiring" old users:
http://www.daemonforums.org/showthread.php?t=413

(Replace chpass(1) with chage(1) for Linux systems.)
 
1 members found this post helpful.
  


Reply



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
Tracking users rozilla Linux - Networking 4 07-26-2008 10:36 AM
Tracking problem users. swsquall Linux - Server 2 06-03-2008 07:37 PM
Tracking users in ProFtpd AudioMechanic Linux - Networking 2 05-23-2005 02:05 PM
tracking what users do... pAn1k Linux - Security 4 11-19-2004 09:32 AM
Tracking Users and thier commands Shai Linux - Security 1 08-13-2001 06:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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