saltstack/salt — Issue #362: shadow.set_password as it pretains to Ubuntu
Author: redshirtlinux
Created: 2011-12-15 17:18:32+00:00
State: open

Hello Salt Stack Team,

This is a proposed modification to the help document associated with salt.modules.shadow. Ubuntu uses SHA-512 hashing for passwords. Using simple crypt for hashing will not work when attempting to set passwords on Ubuntu. Below I've suggested the Ubuntu users use mkpasswd and I have provided the proper syntax.

http://saltstack.org/ref/modules/all/salt.modules.shadow/#module-salt.modules.shadow

Current:

Manage the shadow file

salt.modules.shadow.info(name)

Return information for the specified user

CLI Example:

salt '*' shadow.user root

salt.modules.shadow.set_password(name, password)

Set the password for a named user. The password must be a properly defined hash, the password hash can be generated with this command: openssl passwd -1

CLI Example:

salt '*' root $1$UYCIxa628.9qXjpQCjM4a..

Proposed:

Manage the shadow file

salt.modules.shadow.info(name)

Return information for the specified user

CLI Example:

salt '*' shadow.user root

salt.modules.shadow.set_password(name, password)

Set the password for a named user. The password must be a properly defined hash, the password hash can be generated with this command: openssl passwd -1 <plaintext password>
Ubuntu uses SHA-512 hashing to encrypt passwords. To generate a SHA-512 hashed password install and use mkpasswd (please surround password in ''): mkpasswd -m sha-512 'plaintext password'

CLI Example:

salt '*' root $1$UYCIxa628.9qXjpQCjM4a..