Pages

Thursday, December 19, 2013

add user password linux command line

add user password linux command line

My requirement is to automate creation of users thereby passing username and password in command line in Linux.

After searching a lot, I finally got a solution.

Our solution require openssl package to be installed and this solution is w.r.t BOSS Linux (a debian derived linux)

openssl passwd -crypt <UserPassword>

This generate a Hash.
Let that be called as <HASH>


useradd -m -p <HASH> UserName

This will add the user with the specified password.

This worked with openssl version 0.9.8g-15 .
Note that these commands must be run as root user .

No comments:

Post a Comment