Solved

Checking for oblete users? And get rid of them.

Posted on 2001-06-18
4
271 Views
Last Modified: 2010-04-21
How do you get a listing of users on the system, find out which ones are retired? Is there a way of seeing the last time the acct was used, so I can retire them? thanks

I am trying to delete users who may not longed on in 3 months. I also trying to clean out all users on the system who are retired.
0
Comment
Question by:petro2
4 Comments
 
LVL 11

Expert Comment

by:griessh
ID: 6203417
I think this problem is a bit more complicated than that. First of all, what is would be too long? There can be accounts that are not being used very frequently or at all, but you still need them to do certain tasks. Then more: what will happen will email accounts, home directories etc?
I think you shoul dget a list of users from your system (usually in the /etc/passwd) and check if they are still active.

======
Werner
0
 
LVL 6

Expert Comment

by:bira
ID: 6206983
Hi

   Use the last command:

   last > lastfile.txt
     ( It can take some minutes )

  check the file lastfile.txt for users that did't logged
  in a certain time you want.

  Once you know that users suspect of being retired,
  check with their departments if they are really gone,
  then delete them.

     Regards
0
 
LVL 5

Accepted Solution

by:
Nisus091197 earned 200 total points
ID: 6233293
All authorized users of the system should have a login in the /etc/passwd file or NIS map.

To find all files owned by a given user, say patc:

find / -user patc -ls

To find out which of these have been modified within the last 3 months:

find / -user patc -mtime -100 -ls

If this returns nothing, remove them:

find / -user patc -mtime -100 -exec rm -f {} \;

Tip:  Edit the /etc/profile so that it echos the date to a file called /usr/local/files/lastlogin.patc when patc logs in.

I have written a cool script which does exactly what you want.  Run it every day/week and it will report to the account manager via email a report on accounts that have not been accessed in three months say.

If you are good with scripting my tip above will see you right.  Otherwise I'll look it up for you.

Please advise.

Regards, Nisus
http://www.omnimodo.com
0
 

Author Comment

by:petro2
ID: 6245327
Thanks I will give it a try. But it will point me in the right direction. jq
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question