Operating System - HP-UX
1835224 Members
2463 Online
110078 Solutions
New Discussion

multiple users password change

 
Neale Machin
Advisor

multiple users password change

I currently have an application that users are unable to change their passwords in. I need to set more secure passwords for the users (Although I will be creating these) . Is there anyway of scripting up a list of users and forcing the passwd to be changed without having to type in new password with its confirmation. Or do I have a nice tedious afternoon ahead?
Just cos I look after Unix Boxes doesnt mean I wear sandals
3 REPLIES 3
Deepak Extross
Honored Contributor

Re: multiple users password change

John Carr_2
Honored Contributor

Re: multiple users password change

Hi

I had to do this last year, unfortunatly I no longer have access to the scripts which I created to do this.

How I did it was by creating a dummy user changing the password using the usual password command then extracting the encrypted password from the password file and substituting it to the list of required users in the password file with a shell script thus creating a common password with minimal user interaction.

cheers
John.

Niraj Kumar Verma
Trusted Contributor

Re: multiple users password change

Hi

copy the following lines of script

----------- cut here --------

#!/bin/sh

Password_file=/etc/passwd
Out_File=/tmp/PASSWD.MOD

cat $Password_file |awk -F":" '{print $1":,/...:"$3":"$4":"$5":"$6":"$7}'>$Out_File

---- End

This script will create a file which will ask the password at first login without asking the old password.

select the users from /tmp/PASSWD.MOD file for whome you want to change the password and copy the full line to /etc/password for that particular user.

first make a copy of your password file and chnage the
variable Password_file respectively .

I hope it will work.

-Niraj
Niraj.Verma@philips.com