Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 7660 - useradd -p enters plain text password
Summary: useradd -p enters plain text password
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: shadow-utils
Version: 6.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-12-07 19:34 UTC by Adi Linden
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-12-08 15:15:45 UTC

Attachments (Terms of Use)

Description Adi Linden 1999-12-07 19:34:57 UTC
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 15:15:59 UTC
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.