Solved

Checking for oblete users? And get rid of them.

Posted on 2001-06-18
4
263 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now