Forrest logo
back to the htpasswd tool

htpasswd:tldr:408a0

htpasswd: Create/overwrite htpasswd file.
$ htpasswd -c ${filename} ${username}
try on your machine

The command "htpasswd" is used to create, update, and manage user authentication files for basic authentication in Apache web servers. Here is an explanation of the provided command:

  • "htpasswd" is the command itself.
  • "-c" is an option that specifies the creation of a new file or overwriting an existing file with a new one.
  • "${filename}" is a placeholder for the name and path of the file where the usernames and passwords will be stored.
  • "${username}" is a placeholder for the desired username of the user that will be added to the authentication file.

Essentially, this command will create a new user authentication file (or overwrite an existing one) with the given filename and add a new user entry containing the specified username. After executing this command, the command-line interface will prompt you to enter a password for the user.

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