diff options
Diffstat (limited to 'docs/man/htpasswd.1')
-rw-r--r-- | docs/man/htpasswd.1 | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/docs/man/htpasswd.1 b/docs/man/htpasswd.1 index d0ad7e8..776c051 100644 --- a/docs/man/htpasswd.1 +++ b/docs/man/htpasswd.1 @@ -19,7 +19,7 @@ .el .ne 3 .IP "\\$1" \\$2 .. -.TH "HTPASSWD" 1 "2019-08-09" "Apache HTTP Server" "htpasswd" +.TH "HTPASSWD" 1 "2024-04-02" "Apache HTTP Server" "htpasswd" .SH NAME htpasswd \- Manage user files for basic authentication @@ -27,16 +27,16 @@ htpasswd \- Manage user files for basic authentication .SH "SYNOPSIS" .PP -\fB\fBhtpasswd\fR [ -\fBc\fR ] [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR\fR +\fB\fBhtpasswd\fR [ -\fBc\fR ] [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR\fR .PP -\fB\fBhtpasswd\fR -\fBb\fR [ -\fBc\fR ] [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR \fIpassword\fR\fR +\fB\fBhtpasswd\fR -\fBb\fR [ -\fBc\fR ] [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] [ -\fBD\fR ] [ -\fBv\fR ] \fIpasswdfile\fR \fIusername\fR \fIpassword\fR\fR .PP -\fB\fBhtpasswd\fR -\fBn\fR [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR\fR +\fB\fBhtpasswd\fR -\fBn\fR [ -\fBi\fR ] [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR\fR .PP -\fB\fBhtpasswd\fR -\fBnb\fR [ -\fBm\fR | -\fBB\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR \fIpassword\fR\fR +\fB\fBhtpasswd\fR -\fBnb\fR [ -\fBm\fR | -\fBB\fR | -\fB2\fR | -\fB5\fR | -\fBd\fR | -\fBs\fR | -\fBp\fR ] [ -\fBr\fR \fIrounds\fR ] [ -\fBC\fR \fIcost\fR ] \fIusername\fR \fIpassword\fR\fR .SH "SUMMARY" @@ -45,10 +45,10 @@ htpasswd \- Manage user files for basic authentication \fBhtpasswd\fR is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users\&. If \fBhtpasswd\fR cannot access a file, such as not being able to write to the output file or not being able to read the file in order to update it, it returns an error status and makes no changes\&. .PP -Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by \fBhtpasswd\fR\&. This program can only manage usernames and passwords stored in a flat-file\&. It can encrypt and display password information for use in other types of data stores, though\&. To use a DBM database see dbmmanage or htdbm\&. +Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by \fBhtpasswd\fR\&. This program can only manage usernames and passwords stored in a flat-file\&. It can hash and display password information for use in other types of data stores, though\&. To use a DBM database see dbmmanage or htdbm\&. .PP -\fBhtpasswd\fR encrypts passwords using either bcrypt, a version of MD5 modified for Apache, SHA1, or the system's \fBcrypt()\fR routine\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-encrypted passwords while others in the same file may have passwords encrypted with \fBcrypt()\fR\&. +\fBhtpasswd\fR hashes passwords using either bcrypt, a version of MD5 modified for Apache, SHA-1, or the system's \fBcrypt()\fR routine\&. SHA-2-based hashes (SHA-256 and SHA-512) are supported for \fBcrypt()\fR\&. Files managed by \fBhtpasswd\fR may contain a mixture of different encoding types of passwords; some user records may have bcrypt or MD5-hashed passwords while others in the same file may have passwords hashed with \fBcrypt()\fR\&. .PP This manual page only lists the command line arguments\&. For details of the directives necessary to configure user authentication in httpd see the Apache manual, which is part of the Apache distribution or can be found at http://httpd\&.apache\&.org/\&. @@ -71,19 +71,28 @@ Create the \fIpasswdfile\fR\&. If \fIpasswdfile\fR already exists, it is rewritt Display the results on standard output rather than updating a file\&. This is useful for generating password records acceptable to Apache for inclusion in non-text data stores\&. This option changes the syntax of the command line, since the \fIpasswdfile\fR argument (usually the first one) is omitted\&. It cannot be combined with the \fB-c\fR option\&. .TP \fB-m\fR -Use MD5 encryption for passwords\&. This is the default (since version 2\&.2\&.18)\&. +Use MD5 hashing for passwords\&. This is the default (since version 2\&.2\&.18)\&. +.TP +\fB-2\fR +Use SHA-256 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&. +.TP +\fB-5\fR +Use SHA-512 \fBcrypt()\fR based hashes for passwords\&. This is supported on most Unix platforms\&. .TP \fB-B\fR -Use bcrypt encryption for passwords\&. This is currently considered to be very secure\&. +Use bcrypt hashing for passwords\&. This is currently considered to be very secure\&. .TP \fB-C\fR -This flag is only allowed in combination with \fB-B\fR (bcrypt encryption)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17)\&. +This flag is only allowed in combination with \fB-B\fR (bcrypt hashing)\&. It sets the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17)\&. +.TP +\fB-r\fR +This flag is only allowed in combination with \fB-2\fR or \fB-5\fR\&. It sets the number of hash rounds used for the SHA-2 algorithms (higher is more secure but slower; the default is 5,000)\&. .TP \fB-d\fR -Use \fBcrypt()\fR encryption for passwords\&. This is not supported by the httpd server on Windows and Netware\&. This algorithm limits the password length to 8 characters\&. This algorithm is \fBinsecure\fR by today's standards\&. It used to be the default algorithm until version 2\&.2\&.17\&. +Use \fBcrypt()\fR hashing for passwords\&. This is not supported by the httpd server on Windows and Netware\&. This algorithm limits the password length to 8 characters\&. This algorithm is \fBinsecure\fR by today's standards\&. It used to be the default algorithm until version 2\&.2\&.17\&. .TP \fB-s\fR -Use SHA encryption for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&. +Use SHA-1 (160-bit) hashing for passwords\&. Facilitates migration from/to Netscape servers using the LDAP Directory Interchange Format (ldif)\&. This algorithm is \fBinsecure\fR by today's standards\&. .TP \fB-p\fR Use plaintext passwords\&. Though \fBhtpasswd\fR will support creation on all platforms, the httpd daemon will only accept plain text passwords on Windows and Netware\&. @@ -101,7 +110,7 @@ Name of the file to contain the user name and password\&. If \fB-c\fR is given, The username to create or update in \fIpasswdfile\fR\&. If \fIusername\fR does not exist in this file, an entry is added\&. If it does exist, the password is changed\&. .TP \fB\fIpassword\fR\fR -The plaintext password to be encrypted and stored in the file\&. Only used with the \fB-b\fR flag\&. +The plaintext password to be hashed and stored in the file\&. Only used with the \fB-b\fR flag\&. .SH "EXIT STATUS" @@ -117,7 +126,7 @@ The plaintext password to be encrypted and stored in the file\&. Only used with .fi .PP -Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. The password will be encrypted using the modified Apache MD5 algorithm\&. If the file does not exist, \fBhtpasswd\fR will do nothing except return an error\&. +Adds or modifies the password for user \fBjsmith\fR\&. The user is prompted for the password\&. The password will be hashed using the modified Apache MD5 algorithm\&. If the file does not exist, \fBhtpasswd\fR will do nothing except return an error\&. .nf @@ -146,24 +155,27 @@ Web password files such as those managed by \fBhtpasswd\fR should \fInot\fR be w This program is not safe as a setuid executable\&. Do \fInot\fR make it setuid\&. .PP -The use of the \fB-b\fR option is discouraged, since when it is used the unencrypted password appears on the command line\&. +The use of the \fB-b\fR option is discouraged, since when it is used the plaintext password appears on the command line\&. .PP When using the \fBcrypt()\fR algorithm, note that only the first 8 characters of the password are used to form the password\&. If the supplied password is longer, the extra characters will be silently discarded\&. .PP -The SHA encryption format does not use salting: for a given password, there is only one encrypted representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&. +The SHA-1 hashing format does not use salting: for a given password, there is only one hashed representation\&. The \fBcrypt()\fR and MD5 formats permute the representation by prepending a random salt string, to make dictionary attacks against the passwords more difficult\&. + +.PP +The SHA-1 and \fBcrypt()\fR formats are insecure by today's standards\&. .PP -The SHA and \fBcrypt()\fR formats are insecure by today's standards\&. +The SHA-2-based \fBcrypt()\fR formats (SHA-256 and SHA-512) are supported on most modern Unix systems, and follow the specification at https://www\&.akkadia\&.org/drepper/SHA-crypt\&.txt\&. .SH "RESTRICTIONS" .PP -On the Windows platform, passwords encrypted with \fBhtpasswd\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&. +On the Windows platform, passwords hashed with \fBhtpasswd\fR are limited to no more than \fB255\fR characters in length\&. Longer passwords will be truncated to 255 characters\&. .PP -The MD5 algorithm used by \fBhtpasswd\fR is specific to the Apache software; passwords encrypted using it will not be usable with other Web servers\&. +The MD5 algorithm used by \fBhtpasswd\fR is specific to the Apache software; passwords hashed using it will not be usable with other Web servers\&. .PP Usernames are limited to \fB255\fR bytes and may not include the character \fB:\fR\&. |