Operating System - HP-UX
1837008 Members
1935 Online
110111 Solutions
New Discussion

How to force users to change their password

 
SOLVED
Go to solution
Juerg DENNEBERG
Advisor

How to force users to change their password

How can I force the users to change their password. I want all (about 600) to change their password when they log in the next time only. (HP UX 11.0) Do I have to use SAM and touch every user? I do not hope. Can I exclude certain users from being forced?
The personal liberty goes so far as it does not affect the liberty of others
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: How to force users to change their password

See the section on password aging in man (4) passwd.

Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: How to force users to change their password

You will need to write a script to extract all users then on those users that you wish to force a new password simply issue a passwd -f username command. Man passwd for details.
If it ain't broke, I can fix that.
harry d brown jr
Honored Contributor

Re: How to force users to change their password

Ouch, I hope you are taking tomorrow off or having your phone disconnected.

You could script it.

live free or die
harry
Live Free or Die
Sajid_1
Honored Contributor

Re: How to force users to change their password

If you have password againg policy enabled, then you can do this automatically by setting the agings.

In your case, if you want only for specific users, then add a 'passwd' check line in the profiles or in a common profile.

# man passwd
learn unix ..
A. Clay Stephenson
Acclaimed Contributor

Re: How to force users to change their password

You are in luck, I had a script that was extremely close. It also has an array that you can set to exclude those users that you wish to 'skip' over. If you are using NIS then change the cat /etc/passwd to ypcat passwd, I would also comment out the actual passwd -f ... command until you are satisfied with the results.

Attached is agepasswds.sh.


If it ain't broke, I can fix that.
Tom Danzig
Honored Contributor

Re: How to force users to change their password

Quick script to do it for all users with UID 100 or greater:

#!/usr/bin/sh

for i in `awk -F: '{if($3>=100){print $1}}' /etc/passwd`
do
passwd -f $i
done
avsrini
Trusted Contributor
Solution

Re: How to force users to change their password

Hi Juerg,
You can do a work around also. Edit the
passwd file and add a ,.. in the passwd entry
of the users you have to force the passwd change. Take BACKUP of passwd before changes.
This will force the users to change the passwd
next time.

Rgds
Srini
Be on top.