Change user password

Go to solution
Super Advisor

Change user password

I want to force the users to change the password , I tried to use the command "chage", it is great problem , it don't allow two users or above to change password at the same time , it will hold at the below screen ,

my command is
# chage -d0 userid1
# chage -d0 userid2

But when userid1 is changing the password, then userid2 can't change the password at the same time,
the below is the error :
login: user2
You are required to change your password immediately (root enforced)

we have about 200 users so it is a great problem of us , can suggest how to solve it ? thx.

Jean-Pierre Denis
Valued Contributor

Re: Change user password


why not using passwd?

Which distro are you using ? Are they all local user?

Open your Mind and use Open Source software...
Steven E. Protter
Exalted Contributor

Re: Change user password

On HP-UX this command works:

passwd -f

issued as root.

I just tried that in Red Hat 7.3 and to my surprise it did not work.

passwd -x 0

Will probably do the trick though.

From the man page.

-x This will set the maximum password lifetime, in days, if the user's account supports password life times. Available to root only.

Steven E Protter
Owner of ISN Corporation
Super Advisor

Re: Change user password

I think I got the same problem as Steven, the " -e " is not work .

can anyone suggest what is the best way to regularly force users ( about 200 users in our company) to change the password , and does anyone has a script to do it? thx.
aparna challagulla
Valued Contributor

Re: Change user password

hi juno,

u can force the users to change their passwords on a regular basis by setting the min and max password aging options of passwd command

passwd -n mindays -x maxdays username

or maybe u can use

chage -m0 username

so that the user can change his/her password anytime.

do it in the reverse order first give the chage -m and then set the password lifetime using passwd.

If you don't have time to do it right you must have time to do it over