[SOLVED] set passwords in a script in solaris 9 and return
Solaris / OpenSolarisThis forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a script that adds a user to the solaris 9 system
I also have a random password generator so I can pass the password to the command but someone needs to hit return twice to set it, I want the script to set it for me so I don't have to hit return. As it is now after I add the user I set the password manually I don't want to do that I want the script to do that for me, How do I make this work
Many cli programs that require a password have the option of passing the password as a parameter. For example useradd takes the -p flag followed by a string to add the password. If this is used you will not need to press return twice when the user account is set up.
I have a user add script to add a user to Solaris 9 it does everything except set the password, I have a password generator in my script I want to set the generator to a variable and pass the variable to expect so I can set the password when adding the user.
You could create the hash yourself and then append a line (all 7 fields) to /etc/passwd . After all accounts are added run pwconv . If doing this I'd set the "must change at next login" option in the hash to force a change to the new and better hashes available in Solaris 9.
what I want to do is this I have a password generator as seen below which is in my script. this works for linux because linux has the "-p" option to pass the password too during the run of the useradd command, but Solaris doesn't as seen below for linux which is actually 2 stages