Bug 7660 - useradd -p enters plain text password
useradd -p enters plain text password
Product: Red Hat Linux
Classification: Retired
Component: shadow-utils (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Depends On:
  Show dependency treegraph
Reported: 1999-12-07 14:34 EST by Adi Linden
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-12-08 10:15:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Adi Linden 1999-12-07 14:34:57 EST
When using the -p command line switch with useradd a plain text password is
added in /etc/passwd or /etc/shadow and not an encrypted password. After
using useradd a user connot log in with the password supplied to useradd,
the passwd command has to be run to update the passwd properly.
Comment 1 Bernhard Rosenkraenzer 1999-12-08 10:15:59 EST
useradd -p takes the *encrypted* password as parameter.
Allowing to specify cleartext passwords in the command line would not be a very
good idea (anyone can read it, and it remains in .bash_history).

If you absolutely need that function, use something along the lines of

useradd -p `echo 'print crypt("password", "RH");' | perl` username

Note You need to log in before you can comment on or make changes to this bug.