[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: How to create encrypted password via command line


Here is an example out of a RHEL4 manual... Look at the simply python
code in the "Warning" section that helps you set an initial password for
a user


To assign an initial password, use the following steps: 
Start the command line Python interpreter with the python command. It
displays the following: 

Python 2.4.3 (#1, Jul 21 2006, 08:46:09) [GCC 4.1.1 20060718 (Red Hat
4.1.1-9)] on linux2 Type "help", "copyright", "credits" or "license" for
more information. >>>
At the prompt, type the following commands. Replace <password> with the
password to encrypt and <salt> with a random combination of at least 2
of the following: any alphanumeric character, the slash (/) character or
a dot (.): 

                    import crypt; print
The output is the encrypted password, similar to '12CsGd8FRcMSM'. 

Press Ctrl-D to exit the Python interpreter. 

At the shell, enter the following command (replacing
<encrypted-password> with the encrypted output of the Python

                    usermod -p "<encrypted-password>" <username>
Alternatively, you can assign a null password instead of an initial
password. To do this, use the following command: 

              usermod -p "" username

Greg Caetano
greg caetano hp com

-----Original Message-----
From: redhat-list-bounces redhat com
[mailto:redhat-list-bounces redhat com] On Behalf Of Anne Moore
Sent: Wednesday, September 12, 2007 8:04 AM
To: redhat-list redhat com
Subject: How to create encrypted password via command line

Hi All
Does anyone know of a quick/painless way to create an encrypted {crypt}
password via the command like on Red Hat? I need my users to do this and
I don't want them to have to write much syntax, etc., as that will be
too much for them. I was hoping there was some built-in (or other)
method that allows creating an encrypted password, depending on what the
user types in for the password.
Thank you!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]