Bug 1253051 - "To create an encrypted password, you can use python" improperly & unnecessarily suggests using custom salt
"To create an encrypted password, you can use python" improperly & unnecessar...
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: doc-Installation_Guide (Show other bugs)
7.1
Unspecified Unspecified
urgent Severity medium
: rc
: ---
Assigned To: Petr Bokoc
ecs-bugs
: Documentation
Depends On: 1253048
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-12 16:14 EDT by Ryan Sawhill
Modified: 2015-11-24 11:57 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1253048
Environment:
Last Closed: 2015-11-24 11:57:04 EST
Type: Bug
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 Ryan Sawhill 2015-08-12 16:14:46 EDT
+++ This bug was initially created as a clone of Bug #1253048 +++

Document URL: 

  https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html#sect-kickstart-commands

Section Number and Name: 

  ⁠23.3. Kickstart Syntax Reference

Describe the issue: 

  Three times on this page, you can find the following text:

    To create an encrypted password, you can use python: 
      $ python -c 'import crypt; print(crypt.crypt("My Password", "$6$My Salt"))'
    This generates a sha512 crypt of your password using your provided salt

  Note that neither passwd nor grub-crypt let you specify custom salts ... so, to be clear, it's just not done, and a potentially bad practice to encourage.

Suggestions for improvement: 

  Remove all mentions of salt. The python version we have in RHEL6 and RHEL7 auto-generates an appropriate random salt when you don't specify it. Instead, the text could read:

    To create an encrypted password, you can use python:
      $ python -c 'import crypt; print(crypt.crypt("My Password"))'
    This generates a sha512 crypt-compatible hash of your password using a random salt. 

Additional information: 

  Here's what python's crypt looks like on RHEL7:

  # python -c 'import crypt; print(crypt.crypt("My Password"))'
  $6$ixr3bNcdW5VITMgz$8HJdnbow67FK8nDke3AyX19.Q1WqyRSM9CklF5sRcsp4j6crg0Kfm3RTTOLQibtUVGrTvK/BI5oDQ96Tx0cJq.

  # python -c 'import crypt; help(crypt.crypt)'
  Help on function crypt in module crypt:
  crypt(word, salt=None)
    Return a string representing the one-way hash of a password, with a salt
    prepended.
    
    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.
    
    Note that these are non-standard extensions to Python 2.7's crypt.crypt()
    entrypoint, backported from 3.3: the standard Python 2.7 crypt.crypt()
    entrypoint requires two strings as the parameters, and does not support
    keyword arguments.
  (END)
Comment 5 Petr Bokoc 2015-11-24 11:57:04 EST
Changes have been published both in the 7.2 Beta release as well as in the final 7.2 release.

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