Visit Our UNIX and Linux User Community

Would like to get email alerts when user password going to expire

Thread Tools Search this Thread
Operating Systems AIX Would like to get email alerts when user password going to expire
# 1  
Old 08-27-2015
Would like to get email alerts when user password going to expire


I am trying to write a shell script, which will send email alerts to Admin/users when users password is going to expire in 15 days.
Can you please help me with the script.

thank you.
# 2  
Old 08-27-2015
You should attempt to write your own code / script first; then post what you have written / tried first; to start to discussion.
# 3  
Old 09-07-2015
Welcome kumar7997,

I have a few to questions pose in response first:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • 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?

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. The password details are stored in /etc/security/passwd with the password rules stored in /etc/security/user. You will need to check the last update time against the current time with reference to the rules you have set in order to decide if the password is due to expire within any given period.

I hope that this helps, but if not, show us how far you have managed and explain what is not working, with all code, files input & output/errors wrapped in CODE tags.

# 4  
Old 09-10-2015
Thanks much Robin.

Actually it was just to simplify my work.(instead of checking manually) Thank you for your post/followup. I should have tried and post the code/content. But anyway found some reference script online and i modified it and used. What ever you've posted above is really helpful in figuring out where to start. I do have system admin knowledge. But not good at scripting.

Next time, I will definitely try and post the question with sufficient data.

Thanks Robin. Smilie

Previous Thread | Next Thread
Test Your Knowledge in Computers #607
Difficulty: Medium
In MySQL 8.0 CREATE TABLE t1 (c1 JSON); is not a valid statement.
True or False?

10 More Discussions You Might Find Interesting

1. Solaris

Force to reset password after expire

Hi Lads, I would like place the mechanism of force reset password to user when he login to the server after his password expired. Currently, We are resetting users once in every 60 days using cron job but I am thinking is there any other way to force reset passwords after it expires? I am using... (1 Reply)
Discussion started by: Navkreddy
1 Replies

2. Shell Programming and Scripting

Shell script to set user password to never expire in UNIX servers

Hi, I have a requirement where in i need to write a shell script to set users password to never expire. I know the command which is used to perform the same .. which is chage command. But, could not figure out how to do the same in shell script. Could you please help me with the shell... (3 Replies)
Discussion started by: suren424
3 Replies

3. Shell Programming and Scripting

Email alerts whenever someone logs into server via SSH any user?

Hi all, Thanks in Advance!! I dont know how to start to write script for this process, my requirement is if any user logs into server automatically Admin get mail alert. how is this possible? any one guide me to complete this process. (1 Reply)
Discussion started by: anishkumarv
1 Replies

4. AIX

Password Expire Message

Does anyone know if the default message displayed when a users password has expired can be changed? I am just assuming the message below is the default one. If so please tell. Using username "justinxx". justinxx@'s password: WARNING: Your password has expired. You must... (2 Replies)
Discussion started by: juredd1
2 Replies

5. UNIX for Advanced & Expert Users

SFTP password expire error

Hi, I am using sftp in batch script for which all configuration for public/private keys are done and it works fine without asking a password. No issues till this point. Now I the problem I have is that if the password expires/someone changes the authentication keys at reote server then the... (4 Replies)
Discussion started by: coolwade
4 Replies

6. Red Hat

set password not to expire

Hi All, Is this true on chage command? -M, MAX_DAYS Passing the number -1 as MAX_DAYS will remove checking a password's validity. Does this means password will not expire anymore? Thanks for any comment you may add. (0 Replies)
Discussion started by: itik
0 Replies

7. Solaris

Set Password Never Expire

Hello I want to set the password for user never expire through the command line. For your information the box is running under Solaris 8 platform. (2 Replies)
Discussion started by: shamsul
2 Replies

8. Shell Programming and Scripting

Password expire

Hi, Is there any way to find out the UNIX user's password expire date?. It'll we helpful to inform the users to change the password before it get expires.(FYI - I am not having only admin previlege.) (1 Reply)
Discussion started by: sharif
1 Replies

9. UNIX for Advanced & Expert Users

Disable password expire in HP UNIX

Hi, How to disable passwd expire in HP UNIX by not using SAM ? In our system SAM have some strange bugs. However due to some reason, we cannot add that patch. B. Rgds Christina (3 Replies)
Discussion started by: christina fung
3 Replies

10. UNIX for Advanced & Expert Users

password will expire

login: TEST7 TEST7's Password: Your password will expire: Wed Feb 19 14:28:08 2003 How can I the same information become in a script (as example in the .profile)????????? My login starts with .profile. These File is a menue with 24 lines and the message " Your password ....." disappear to... (8 Replies)
Discussion started by: Erwin Stocker
8 Replies

Featured Tech Videos