How to prompt for the new password during the first login

Hi All,

I have created a new user. Using the below command I have created the user successfully.

useradd -c "Test user" -d /tmp/test -g Testgroup -s /bin/ksh -u 601 Test

I don't want to set the password using �passwd� command after creating a user.

I want to prompt for the new password during the first login or su to that user.
What flag I want to set for enabling this option.

Please help me.

Regards,
Kalai :slight_smile:

passwd -f Test

see man page for details.

Hi ,

passwd -f Test will work when we set the password and then when we issue passwd -f Test , then it will prompt for new password during login before that we need to provide the existing password.

I tried the below command after creating the new user.
passwd -d test
passwd -x 0 test

When I login it asks for the new password and does not prompt for existing password.

Regards,
Kalai