Operating System - HP-UX
1836995 Members
1940 Online
110111 Solutions
New Discussion

Re: HP-UX Useradd clarification

 
sriharikumar_1
Contributor

HP-UX Useradd clarification

Hi all,

Is there any way in HP-UX 11.00 for adding a user and assinging the password for that by a single command.

Please clarify.

Thanks and Regards.
4 REPLIES 4
Andreas Garbe
Advisor

Re: HP-UX Useradd clarification

Hi,

you found some information on the forum

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x72bcd06ed8c8d4118fef0090279cd0f9,00.html

or search "useradd script"

rgds
Rita C Workman
Honored Contributor

Re: HP-UX Useradd clarification

Well here's an old way to do it.....wonder if anyone still does it this way...

#vipw
Go to the end of the file and add for a new line
#
save the file !


/rcw
Bruce Regittko_1
Esteemed Contributor

Re: HP-UX Useradd clarification

Hi,

No, there is not a HP-UX command line utility that will create a new account and set the passwd. If you want this, you will have to write your own utility.

As a starting point, you could have your script run useradd and then use the expect language to provide the passwd command with input or generate the encrypted password yourself with makekey. See the following thread for more information:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x47ae79bffde7d4118fef0090279cd0f9,00.html

--Bruce
www.stratech.com/training
Christopher Caldwell
Honored Contributor

Re: HP-UX Useradd clarification

/usr/sam/lbin/useradd.sam will add users with already encrypted passwords.

On Trusted Systems, you may have to run another command to actually activate the account, depending on which security features are active. (Specifying a password expiration period is one of those features.)

If you like C, you can use setprpwent to do just about whatever you'd like from the command line.