User id creation/deletion - notification

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support User id creation/deletion - notification
# 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.


Robin
# 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?

Robin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deletion of list of user based on a text file In LDAP UNIX server

Dear All, It would be really nice, if you could help me to write a script for deletion of list of user( more than 15000 users) stored in a file and sorted by email address( i need deletion of only a particular type of mail address). Is the any script to write and take the file as input and... (3 Replies)
Discussion started by: Chand
3 Replies

2. Shell Programming and Scripting

Notification of user id creation/deletion

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 Replies)
Discussion started by: ggayathri
2 Replies

3. UNIX and Linux Applications

User account expiration notification

Dear Concern, Is there any built in tool/application/command available for Linux user account expiration notification purpose. With Best Regards, Md. Abdullah-Al Kauser (2 Replies)
Discussion started by: makauser
2 Replies

4. UNIX for Advanced & Expert Users

User's deletion in OpenLDAP

Hi, I am using OpenLDAP for authenticating my postfix mail server. Now i have to clean up some resigned users from the LDAP directory. I have the list of common names (CN) with me, how can i delete the LDAP users form with that list. Regards, Hima Kiran (2 Replies)
Discussion started by: ghimakiran
2 Replies

5. Red Hat

User creation

Hi Thanks in advance. How to create a user without useradd command ?? (1 Reply)
Discussion started by: krish4linux
1 Replies

6. UNIX for Dummies Questions & Answers

File Creation notification

Hello, Please help about writing a process that will be automatically notified by file creation in a predefined directory. Some code will appreciated. Thanks for all. (4 Replies)
Discussion started by: echchatbi
4 Replies

7. Solaris

User Creation

i am trying to create a user on solaris 10. it is not taking user name with more than ten characters. which file i need to edit to do this setting. (4 Replies)
Discussion started by: raynu.sharma
4 Replies

8. Programming

execve notification in user mode under Linux

Hi, I'm writing a monitor program that can be notified once a process makes an execve system call and then stop that process for examining before it starts to run the new code. I know I can ptrace a process to achieve this, but I do not want to ptrace every process in the system. Is it possible?... (1 Reply)
Discussion started by: aaron.lwe
1 Replies

9. Solaris

User creation

Hi all, I want to create one user with full permissions to one directory called /opt/tivoli/tsm/client/ba/bin. Name for the user Tivoli Thanks & Regards Babu (7 Replies)
Discussion started by: lbreddy
7 Replies

10. Programming

How to watch for file creation/deletion?

How do I write a C program that will watch a directory for file creation/deletion? Maybe it would receive a signal when someone creates a file? thanks, Siegfried (5 Replies)
Discussion started by: siegfried
5 Replies
Login or Register to Ask a Question