On Mon, Sep 18, 2017 at 12:59 PM, jacksonp <[email protected]> wrote:

> trying to manually set a password via mysql guacamole_user table. Not
> concerned about security, not salting, just want to enter any kind of
> password that will work.
>
>
I strongly recommend against using unsalted passwords. Even if you're not
concerned about security, you should be concerned about security.

Documentation says if password_salt is null, it just ignores.
>
> I tried hashing with sha256 which is how I read the doc.
>
> mkpasswd -m sha-256
> Password:
> $5$AlqeE/FaJQ.BC$oB5w9sisUTuFjLCQMknBS6XVFSEWH5cAs/84ajS.dO5
>
>
mkpasswd will not produce a SHA-256 hash, but rather a salted and hashed
password formatted as necessary for Linux / UNIX password files like
/etc/shadow. You are forcing it to use SHA-256, yes, but it is still
salting the password prior to hashing and formatting the result for use
within a password file.

If you just want to calculate the SHA-256 hash of an arbitrary string, you
would do:

    echo -n "the-string-to-hash" | sha256sum

That will produce a result like:

    d07f9c10b821ac6e82e683831594136438701d7fcfdd7e877b5caca2bdfd31f7  -

That hex value in the result, in this case
"d07f9c10b821ac6e82e683831594136438701d7fcfdd7e877b5caca2bdfd31f7", is the
value you're looking for. You would then specify that in your INSERT /
UPDATE, using UNHEX() to transform it into a BINARY(32).

- Mike

Reply via email to