Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Add' user script required 1

Status
Not open for further replies.

PortyMan

Programmer
Jul 13, 2004
3
Hi,
I'm looking to 'automate' the adding of new users. Essentially I want a script that will create the user with appropriate home directory, shell process, group id, etc, then create their initial password (using userid as initial password) and then set their password to be reset on first use.
The only real problem is just how to set the script to answer the 'enter password' and 're-enter password' prompts when executing 'passwd userid'?
I'm using a Sun Solaris system.
Any help gratefully received...
G
 
I would look into 'expect'. man expect
 
Thanks BIS, but it looks like our system doesn't include 'expect'...
Not to worry, I've just set the script so that it 'tells' the operator what responses to use! Not terribly elegant but should do the trick (others can tinker with it once I'm gone...).
The other bits all work fine and the user gets created correctly.
Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top