Forrest logo
back to the htpasswd tool

htpasswd:tldr:d6b63

htpasswd: Display a string with username (plain text) and password (md5).
$ htpasswd -nbm ${username} ${password}
try on your machine

The command "htpasswd -nbm ${username} ${password}" is used to create or update an Apache-style password file. Here's an explanation of each component:

  • htpasswd: This is the command-line utility used to manage user authentication files in Apache web server. It can be used to create, update, or delete username/password combinations.
  • -nbm: These are options or flags that modify the behavior of the htpasswd command:
    • -n indicates that the password will be specified on the command line.
    • -b stands for "batch mode" and allows the command to be used in a non-interactive environment.
    • -m specifies that the MD5-based password encryption algorithm should be used.
  • ${username}: This should be replaced with the actual username for which you want to create or update the password.
  • ${password}: Similarly, replace this with the actual password for the given username.

In summary, the command generates an MD5-based encrypted password for the specified username and password, which can then be used for user authentication in an Apache web server.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the htpasswd tool