2024-08-27 20:51:43 +03:00
. \" generated with Ronn-NG/v0.10.1
. \" http://github.com/apjanke/ronn-ng/tree/0.10.1
.TH "HASH_PASSWORD" "1" "August 2024" ""
2018-12-10 20:14:34 +03:00
.SH "NAME"
\fB hash_password\fR \- Calculate the hash of a new password, so that passwords can be reset
.SH "SYNOPSIS"
2024-08-27 20:51:43 +03:00
.TS
allbox;
\fB hash_password\fR [\fB \- p\fR \fB \- \- password\fR [password]] [\fB \- c\fR \fB \- \- config\fR \fI file\fR ]
.TE
2018-12-10 20:14:34 +03:00
.SH "DESCRIPTION"
\fB hash_password\fR calculates the hash of a supplied password using bcrypt\.
.P
\fB hash_password\fR takes a password as an parameter either on the command line or the \fB STDIN\fR if not supplied\.
.P
2022-09-28 16:45:13 +03:00
It accepts an YAML file which can be used to specify parameters like the number of rounds for bcrypt and password_config section having the pepper value used for the hashing\. By default \fB bcrypt_rounds\fR is set to \fB 12\fR \.
2018-12-10 20:14:34 +03:00
.P
The hashed password is written on the \fB STDOUT\fR \.
.SH "FILES"
A sample YAML file accepted by \fB hash_password\fR is described below:
.P
bcrypt_rounds: 17 password_config: pepper: "random hashing pepper"
.SH "OPTIONS"
.TP
\fB \- p\fR , \fB \- \- password\fR
2024-08-27 20:51:43 +03:00
Read the password form the command line if [password] is supplied, or from \fB STDIN\fR \. If not, prompt the user and read the password from the tty prompt\. It is not recommended to type the password on the command line directly\. Use the STDIN instead\.
2018-12-10 20:14:34 +03:00
.TP
\fB \- c\fR , \fB \- \- config\fR
Read the supplied YAML \fI file\fR containing the options \fB bcrypt_rounds\fR and the \fB password_config\fR section containing the \fB pepper\fR value\.
.SH "EXAMPLES"
Hash from the command line:
.IP "" 4
.nf
$ hash_password \- p "p@ssw0rd"
$2b$12$VJNqWQYfsWTEwcELfoSi4Oa8eA17movHqqi8\. X8fWFpum7SxZ9MFe
.fi
.IP "" 0
.P
2024-08-27 20:51:43 +03:00
Hash from the stdin:
.IP "" 4
.nf
$ cat password_file | hash_password
Password:
Confirm password:
$2b$12$AszlvfmJl2esnyhmn8m/kuR2tdXgROWtWxnX\. rcuAbM8ErLoUhybG
.fi
.IP "" 0
.P
Hash from the prompt:
2018-12-10 20:14:34 +03:00
.IP "" 4
.nf
$ hash_password
Password:
Confirm password:
$2b$12$AszlvfmJl2esnyhmn8m/kuR2tdXgROWtWxnX\. rcuAbM8ErLoUhybG
.fi
.IP "" 0
.P
Using a config file:
.IP "" 4
.nf
$ hash_password \- c config\. yml
Password:
Confirm password:
$2b$12$CwI\. wBNr\. w3kmiUlV3T5s\. GT2wH7uebDCovDrCOh18dFedlANK99O
.fi
.IP "" 0
.SH "COPYRIGHT"
2024-08-27 20:51:43 +03:00
This man page was written by Rahul De «rahulde@swecha\. net» for Debian GNU/Linux distribution\.
2018-12-10 20:14:34 +03:00
.SH "SEE ALSO"
2021-07-06 15:03:16 +03:00
synctl(1), synapse_port_db(1), register_new_matrix_user(1), synapse_review_recent_signups(1)