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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script to set user password to never expire in UNIX servers
# 1  
Old 03-13-2016
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 script to do the same. This script should be executed for few users only ?

Please suggest.

Thanks in advance
# 2  
Old 03-13-2016
Show us the exact command you would use to remove the expiration date for a user's password.

Tell us what you want the script to do. (Should a list of users be provided as command-line operands? Should the script repeatedly prompt for a user name until the person running the script indicates they are done? Should the script repeatedly prompt for user names if and only if user names were not given as command-line operands? Something else?)

What shell are you using?

Which UNIX server are you using?
# 3  
Old 03-13-2016
Hi,

Command is


;
Code:
chage -l -1 -m 0 -M 99999 -E -1 <username>

I will pass the username with dynamic variable which i get from the Identity application which is "__NAME__".

Thanks

Last edited by Don Cragun; 05-12-2017 at 05:18 AM.. Reason: Add CODE and ICODE tags.
# 4  
Old 03-14-2016
Quote:
Originally Posted by suren424
Hi,

Command is chage -l -1 -m 0 -M 99999 -E -1 <username>

I will pass the username with dynamic variable which i get from the Identity application which is "__NAME__".

Thanks
I repeat:
Quote:
What shell are you using?

Which UNIX server are you using?
And, now, since I don't know what "the Identity application" is, what is a dynamic variable? Are you saying that your Identity application will export the environment variable __NAME__ and directly invoke your shell script?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

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

Hello, 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. (3 Replies)
Discussion started by: Kumar7997
3 Replies

2. Shell Programming and Scripting

Running set of commands in remote servers in shell script

Hi Wishing to all. I am very new joined in an organization as a unix system administrator. I need a help in preparing a script for a report. i have a file contains all of the linux/ubuntu servers line by line around 140 servers. vi servers.txt nh01 nh02 nh03 bh01 bh04 - - :wq (3 Replies)
Discussion started by: kumaraswamy
3 Replies

3. Shell Programming and Scripting

Script for login to servers with user name and password and execute commands

I am having the 15 servers which need to do the monitoring Hi I need a shell script, By which i can log in to multiple servers and execute the commands.. I need to specify the username and password in the scripts. Please help me to write the script so that it can login with username and... (5 Replies)
Discussion started by: nandan8a
5 Replies

4. Shell Programming and Scripting

Shell script to change the password on multiple servers in linux

Can any one please let me know the shell script to change the password for a particular user on multiple linux servers. (2 Replies)
Discussion started by: s_madras
2 Replies

5. Shell Programming and Scripting

how to set password/encrypt a shell script

Hi, I have written a shell script in unix for my customer. Now I want to make it only execute and not to read/write. Can anybody help me how to set password protect/encript my script. Thanks Suresh (3 Replies)
Discussion started by: suresh3566
3 Replies

6. Shell Programming and Scripting

Can I set Password to open my shell script?

Hi All, please help me on how to secure my shell script? I chnanged it to read-only mode using 'chmod'. but still i would like to set password for open the script. Is there any way? Please help me!! Thankyou all in advance!! :b: (6 Replies)
Discussion started by: little_wonder
6 Replies

7. 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

8. Shell Programming and Scripting

set password using a shell script

Hi All How can I set password in linux.It is OK if it display password in plain text in script. manually i can set: #passwd Changing password for root Enter new password: Bad password: too weak. Re-enter new password: Password changed. # I want this to be done by script.Please let me... (2 Replies)
Discussion started by: tannu
2 Replies

9. 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

10. 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
Login or Register to Ask a Question