Setting passwords automatically

How do I set up passwords on Sun Solaris 2.5.1 automatically (e.g., using a shell script reading from a textfile with username/plain text password entries)
ragglAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ahoffmannConnect With a Mentor Commented:
Unix doesn't support converting plain text to passwords. Passwords are always crypted ;-)

But you can try to write a program using the  crypt(3)  function.

0
 
ozoCommented:
Of course the text file could contain crypted entries...

Do you have a pwconv(1M) to create /etc/shadow from /etc/passwd?
I hope you're very carefull about doing the apropriate locking
to avoid accidentally breaking your user password files...

 

0
 
ahoffmannCommented:
pwconv?
ozo, this just converts your /etc/passwd to /etc/shadow.
Or do you have a version with additional functionality?
0
 
ozoCommented:
No, but converting /etc/passwd to /etc/shadow is a function which
"sets up passwords from a textfile"...

And it does so while maintaining the appropriate locks,
and while taking care not to open security holes or cause other problems.  

Considering that, I think I'd be hard pressed to come up with a
more suitable function.

 
 
0
All Courses

From novice to tech pro — start learning today.