Operating System - Linux
1753518 Members
5018 Online
108795 Solutions
New Discussion

Re: Script to reset NIS users Password

 
Aakaash
Occasional Contributor

Script to reset NIS users Password

Hi Experts,
I need a script to reset the NIS users password .Here is the procedure currently we are following to reset passwords.




• On Master server enter “passwd -r files -F /etc/passwd userid”
• The new password should be the first three letters of the userid plus “-01”. Example: userid: minyard password: min-01
• Edit the /etc/password file and back-date the aging character by one week. This is the third character after the comma in the password field. The aging character will be a letter from a-z or A-Z, hence 52 possibilities. This will enable the user to immediately change his/her password to something more secure. Here’s an example of what you should change.
pilzj:uBNMQ/dq5Wi6I,O.gR:1723:125:JonPilz,,,:/home/app/users:/usr/bin/sh
pilzj:uBNMQ/dq5Wi6I,O.fR:1723:125:JonPilz,,,:/home/app/users:/usr/bin/sh

• Run “/var/yp/ypmake” to push the changes.
1 REPLY 1
Steven E. Protter
Exalted Contributor

Re: Script to reset NIS users Password

Shalom,

We reset the password to blank and force a change on then next login. We set a seven day period to use or lose the ID.

Security policy is set on the NIS master in /etc/default/security

ypmake is used by the scripts that do this.

The empty password script contains information on our internal setup, so I can't easily post it. The rest are simple passwd commands.

passwd -f username # forces a password change next login.

passwd -x 7 # makes this account live for only seven days before its inactive.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com