Bug 19256

Summary: Useradd saves plain text passwords in shadow passsword file
Product: [Retired] Red Hat Linux Reporter: Johnray Fuller <jrfuller>
Component: shadow-utilsAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED NOTABUG QA Contact: Dale Lovelace <dale>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: crash, wolfgang
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-17 14:46:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Johnray Fuller 2000-10-17 14:46:43 UTC
Hello,

Mark Wolfgang actuallty found this one,.

The bug occurs if the user uses this command to enter a new user's
password:

useradd newuser -p password

The password under this command is stored in plain text in the /etc/shadow
file. this of course prevents the user from logging in.

Take care,
Johnray

Comment 1 Nalin Dahyabhai 2000-10-17 16:16:41 UTC
As documented in the man page, the -p option expects an already-crypted
password.  Use
python -c 'import crypt;print crypt.crypt("password","salt")'
to generate a suitable value.  Use a salt of "$1$jrHrLTgH" or something similar
to get an md5crypt hash instead of a standard crypt hash.