diff --git a/site/passwords.md b/site/passwords.md index 6e82dea0bd..46b9420102 100644 --- a/site/passwords.md +++ b/site/passwords.md @@ -161,10 +161,29 @@ To do so: ## Computing Password Hashes -Sometimes it is necessary to compute a user's password hash, to updated via the [HTTP API](management.html) -or generate a [definitions file](definitions.html) to import. +Sometimes it is necessary to compute a user's password hash for updating via the [HTTP API](management.html) +or to generate a [definitions file](definitions.html) to import. -This is the algorithm: +### Hash via `rabbitmqctl` + +
+rabbitmqctl hash_password foobarbaz
+
+# Output:
+# Will hash password foobarbaz
+# 27cx5+wEi8R8uwTeTr3hk5azuV3yYxxAtwPPhCyrbdsxVhqq
+
+ +### Hash via HTTP API + +
+curl -4su guest:guest -X GET localhost:15672/api/auth/hash_password/foobarbaz
+
+# Output:
+# {"ok":"TBybOvomyVw6BqBU/fHCEpVhDO7fLdQ4kxZDUpt6hagCxV8I"}
+
+ +### This is the algorithm: * Generate a random 32 bit salt. In this example, we will use `908D C60A`. When RabbitMQ creates or updates a user, a random salt is generated. * Concatenate the generated salt with the UTF-8 representation of the desired password.