[CentOS-devel] Command / utility to encrypt password which can be used for creating user account
banyan at rootong.com
Sun Nov 25 09:47:28 UTC 2012
You can save your ass from a combination,
useradd -c <user_name> -m <user_name> -p "`openssl passwd -1`"
Email: banyan at rootong.com
On 2012-11-25 8:13 AM, jupiter wrote:
> Brilliant, that is exactly what I am looking for. Just wondering why $
> sudo useradd -c "your user" -m your_user -p "encrypted password" does
> not work?
> Thank you very much Gianluca.
> On 11/24/12, Gianluca Cecchi <gianluca.cecchi at gmail.com> wrote:
>>> On Sat, Nov 24, 2012 at 1:00 AM, jupiter wrote:
>>>> Is there any command / utility can be used to encrypt a plain
>>>> password, then the encrypted password can be used for creating user
>>>> account and logging to CentOS 6.2 or CentOS 6.3?
>> An easy method is to use openssl command (MD5):
>> - run openssl command and type password and its confirmation
>> $ openssl passwd -1
>> Verifying - Password:
>> - create the user without specifying password
>> $ sudo useradd -c "your user" -m your_user
>> - change the user (note the single quotes around the encrypted password)
>> $ sudo usermod -p '$1$mJdspq9o$wZknKGNq433VsXKfK1EAq0' your_user
>> Useful also when a user wants to change his/her password and this way
>> can send the sysadmin the encrypted one to run the usermod command
>> CentOS-devel mailing list
>> CentOS-devel at centos.org
> CentOS-devel mailing list
> CentOS-devel at centos.org
More information about the CentOS-devel