You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that when setting the password using the htpasswd.lens, it gets saved as plain text. Is it possible to save in one of the encrypted formats supported by htpasswd.
set username password
The text was updated successfully, but these errors were encountered:
Generating encryption hashes is outside the scope of what augeas is designed to do
Having said that, it is possible to use augeas to insert or update an existing password-hash hash into a file.
ie instead of supplying augeas with a password to encrypt, it is possible to generate the password-hash outside of augeas, and use augeas to update the htpasswd file
Example:
PWHASH="$( htpasswd -nb -5 user001 mysecret | sed -e 's/user101://' )"
augtool --noload <<EOF
load-file /etc/httpd/htpasswd
set /files/etc/httpd/htpasswd/webuser ${PWHASH}
save
EOF
which would set the password for the user "webuser" to the being "mysecret"
If the file /etc/httpd/htpasswd does not exist, it will be created, along with the user "webuser"
In the above example, the shell is substituting the variable ${PWHASH}
augtool only sees the resulting hash, and has no part in generating it
It seems that when setting the password using the htpasswd.lens, it gets saved as plain text. Is it possible to save in one of the encrypted formats supported by htpasswd.
The text was updated successfully, but these errors were encountered: