User id creation/deletion - notification

Login or Register to Reply

Thread Tools Search this Thread
# 1  
Old 10-23-2015
User id creation/deletion - notification

Can someone help me with a shell script that will send an email to a set of email ids when a user id is created or deleted on AIX system.
Also, if the script can let the admin know when a particular user id's password will expire.
# 2  
Old 10-23-2015
Are you thinking of a (daily?) cron job? Did you check/search these fora on this exact topic?
# 3  
Old 10-23-2015
Dear ggayathri,

I have a few to questions pose in response first:-
  • What have you tried so far?
  • What output/errors do you get?
  • What AIX version are you using?
  • What files are you exploring to get this information?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)

Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.

We're all here to learn and getting the relevant information will help us all.

# 4  
Old 10-23-2015
Hi Robin,

This is to be executed as a cron job on a daily basis. Can consider shell/awk/perl scripts as well. My thoughts have been to find the difference between the /etc/passwd file and come up with the additions/deletions. I have not tried any scripting in this regard.
# 5  
Old 10-23-2015
Your suggestions could be set out as:-
  • Compare today's /etc/passwd to yesterday (sort first for ease)
  • Save current /etc/passwd to use tomorrow
You can then look for password expiry based on the content of /etc/security/password It's a little awkward because:-
  • The Last password change time is stored in seconds from 1/1/1970
  • The expiry will be in weeks, either per user or in the default stanza
Using /etc/passwd as a driver, you can read one stanza from /etc/security/passwd with grep -Ep "^$userid:" /etc/security/passwd although you then have to consider the points above to decide if the password is about to expire, depending also how you define 'about to expire'

Does this give you something to work with?

Login or Register to Reply

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Deletion of list of user based on a text file In LDAP UNIX server Chand UNIX for Dummies Questions & Answers 3 11-19-2015 10:36 AM
Notification of user id creation/deletion ggayathri Shell Programming and Scripting 2 10-23-2015 05:04 AM
User account expiration notification makauser UNIX and Linux Applications 2 10-13-2015 01:58 AM
User creation - query suresh3566 UNIX for Dummies Questions & Answers 2 11-11-2011 05:53 AM
NIS user creation Revathi@1 Solaris 4 09-29-2011 06:36 AM
User creation senmak AIX 6 07-20-2010 12:03 PM
Need help with user creation brew Solaris 2 05-09-2010 09:49 PM
User's deletion in OpenLDAP ghimakiran UNIX for Advanced & Expert Users 2 02-09-2010 01:15 AM
User creation krish4linux Red Hat 1 12-30-2009 09:44 AM
File Creation notification echchatbi UNIX for Dummies Questions & Answers 4 11-10-2009 11:32 AM
User Creation raynu.sharma Solaris 4 05-25-2009 04:37 AM
execve notification in user mode under Linux aaron.lwe Programming 1 04-15-2009 07:25 AM
User creation lbreddy Solaris 7 03-08-2008 05:45 AM
How to watch for file creation/deletion? siegfried Programming 5 11-13-2007 12:48 AM
user creation problem jarkvarma UNIX for Dummies Questions & Answers 1 11-05-2001 01:11 PM