Solved

Checking for oblete users? And get rid of them.

Posted on 2001-06-18
4
251 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks I will give it a try. But it will point me in the right direction. jq
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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 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.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

762 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

9 Experts available now in Live!

Get 1:1 Help Now