Operating System - HP-UX
1833464 Members
2598 Online
110052 Solutions
New Discussion

Re: Adding user with force user to change password

 
SOLVED
Go to solution
Deepak.R
Frequent Advisor

Adding user with force user to change password

Hi,

Can anyone tell is there any way to create a user using useradd command which force the user to change the password at first login, without using passwd command

thanks
8 REPLIES 8
Rajeev  Shukla
Honored Contributor

Re: Adding user with force user to change password

There is no options with with useradd which will enable you to ask the user to change the password on first login.
The only option is you create a user either with a default password or no password and use password -f username to expire the password.
So as soon as he logs in he is prompted to change the password.

Cheers
Rajeev
Muthukumar_5
Honored Contributor

Re: Adding user with force user to change password

Answer is in your question itself. useradd command is used to add the user details and settings. with passwd command only, we can ask users to change their passwd at first login. Else change your machine to Trusted to ask passwd changes at first login after conversion.

hth.
Easy to suggest when don't know about the problem!
Adisuria Wangsadinata_1
Honored Contributor
Solution

Re: Adding user with force user to change password

Hi,

Check this url below (docID : USECKBRC00009486) :

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063198811

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Mark Nieuwboer
Esteemed Contributor

Re: Adding user with force user to change password

Hi,

You need the command
/usr/lbin/modprpw -e

be carefull with this command.

grtz. Mark
Venkatesan_5
Frequent Advisor

Re: Adding user with force user to change password

hi,

these steps are for non-trusted systems....

1. create a user with this command ----- > # useradd -u 102 -g adm -m -d /home/ind ind
2. issue this command to remove the password for the user --- > # passwd -d username
3. issue this command to ask for a password when he logs in ---- > # passwd -f username
4. check it now , it will work
5. as soon as giving the login name it will
ask for a password , after changing it will come back to login prompt.
6. relogin after changing.....

It has been tested in a test server also by me......

the problem is solved.

regds

Venkatesan.
Deepak.R
Frequent Advisor

Re: Adding user with force user to change password

Thanks to all of you for prompt replies .

But I wanted to know if there is any way to do it with one command ( useradd ) without using the passwd command.

Thanks
Adisuria Wangsadinata_1
Honored Contributor

Re: Adding user with force user to change password

Hi there,

Check the url that I refer you on my previous post. On that document, they refer to execute the useradd.sam command instead of useradd. This is the command SAM calls when adding a user.

For more details, please check the url and read the document.

Hope this can help you.

Cheers,
AW
now working, next not working ... that's unix
Deepak.R
Frequent Advisor

Re: Adding user with force user to change password

Thanks Adusuria

Need to try it out.

Just confirm this can be run on a non-trusted system

deepak