Bug 52746 - useradd -p doesn't hash passwords in /etc/shadow
useradd -p doesn't hash passwords in /etc/shadow
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: shadow-utils (Show other bugs)
7.1
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-28 13:55 EDT by Need Real Name
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-26 09:03:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-08-28 13:55:37 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 95; 
DNAUU234ENU01PCP)

Description of problem:
I noticed that creating a user with 'useradd' and the '-p' option (which 
gives the new user a default password) does not hash the password 
in /etc/shadow:


root@hogs /# useradd -p h4x0r lordspankatron
root@hogs /# tail -2 /etc/shadow
johnnyuser:$1$JiUjVlWa$gnfXvKsHUxnjoIPGmkt/1.:11562:0:99999:7:-1:-
1:2147482240
lordspankatron:h4x0r:11562:0:99999:7:::



This bug doesn't seem exploitible for two reasons:

    1.)  The user cannot log in with the supplied password because
MD5( password_supplied_at_login_prompt ) != 
unhashed_password_in_shadow_file
    2.)  /etc/shadow exists in mode 0400, so no one besides the super-user 
can read it anyway.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.  useradd -p aDefaultPassword aNewUser
2.  tail -1 /etc/shadow
3.  Look at the password field.
	

Actual Results:  The password is not hashed -- it is stored in plain-text.

Expected Results:  The password should have been hashed.

Additional info:
Comment 1 Paul W. Frields 2001-08-31 08:48:21 EDT
This doesn't really seem like a bug; useradd states in the man page that it 
expects the crypt(3) or MD5-hash returned string as an argument to the -p 
option, not the password in plaintext.  RTFM.

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