RHEL 5 update 4. How to force a user to change the password at his next logon.
Thanks in advance.
RHEL 5 update 4. How to force a user to change the password at his next logon.
Thanks in advance.
You can force a password to immediately expire with
chage -d 0 username
why I'm not works.
when we use option -d , user cannot login(rhel5.2, ssh4.3).
Did they ever have a password before? If not, you need to create one for them. This will not force their first password.
It have password, but still not works. ???
Chage -d should work. Can you log in as that user on the console?
User can log in to server normally.
But I want to test force them to change password at first login.
Why option -d not work for me ???
Using the -d option disables or removes a user password. The man page on passwd shows the -d option as disable a password.
You probably should use the -f option (force password change).
passwd -f ratcha.c
I have tested on RHEL 5.3 and below is working fine.
echo "Creating a user account for arm_naja"
useradd arm_naja
echo arm_naja"1234"|passwd --stdin arm_naja
echo "User arm_naja password changed!"
echo arm_naja|chage -d 0 arm_naja
echo "User arm_naja will be forced to change password on next login!"