Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
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.
Product: Red Hat Linux
Classification: Retired
Component: shadow-utils (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
Dale Lovelace
Depends On:
  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:
Last Closed: 2000-10-11 17:46:47 EDT
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 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.

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.