Bug 18919 - useradd does not encrypt the password when adding a user with the -p option.
useradd does not encrypt the password when adding a user with the -p option.
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: shadow-utils (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Dale Lovelace
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-11 17:46 EDT by moonpie
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-11 17:46:47 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 moonpie 2000-10-11 17:46:43 EDT
useradd has the -p option, that lets you specify a password to be assigned
to a new user instead of having to do this as an extra step.  Although I
think this is bad practice in general, putting plaintext passwords on the
command line, it doesn't work in a big way.

i.e.
useradd bob -p bobspassword

this puts "bobspassword" in /etc/shadow instead of calling crypt, or some
other encryption function.
Comment 1 Dale Lovelace 2000-10-12 09:07:31 EDT
This is the correct behaviour for the -p option to useradd. You must encrypt the
passwd yourself. From the useradd man page:

       -p passwd
              The  encrypted  password,  as returned by crypt(3).
              The default is to disable the account.

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