Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Checking for oblete users? And get rid of them.

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtualizing TAPE on dual VIOS 3 101
Control Number of Log Files -Perl 7 86
Linux hostname change 2 83
How to make a Bash alias that takes parameters 5 71
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

791 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