1. Back to tools

Htpasswd Generator - Create Htpasswd

This tool generates a hashed password that is compatible with htpasswd. The hash is generated using the MD5 algorithm.

What is a htpasswd file

The .htpasswd file is a configuration file used for HTTP Basic Authentication, usually in conjunction with the .htpasswd file on web servers such as Apache. It stores usernames and their corresponding hashed passwords, which are used to restrict access to certain parts of a website or application. When a user attempts to access a protected resource, the server checks the user's credentials against the .htpasswd file.

The file format is simple: each line contains a username, followed by a colon (:) and a hashed password (e.g. user:$apr1$hashedpassword). Passwords are hashed for security, often using algorithms such as MD5, SHA, or bcrypt. This method is commonly used to add an extra layer of authentication for admin panels, staging sites, or private resources. It is lightweight and easy to set up, but is not suitable for large-scale user authentication.

How to use

To configure HTTP authentication on an Apache server, place these two files in the directory that you want to protect with HTTP authentication.

.htaccess

AuthName "Authentication required"
AuthType Basic
AuthUserFile /full-path/to/.htpasswd
Require user yourlogin

.htpasswd

yourlogin:$apr1$hashedpassword

Random articles

Free Google Maps widget for WordPress

Google Maps is the most popular web service for online maps and location-based features. It is widel...

JSON - A Key Format for Data Exchange

JSON, which stands for JavaScript Object Notation, is a lightweight data-interchange format. It is e...

What Is a UUID and How It Works

A UUID, or Universally Unique Identifier, is a 128-bit number used to uniquely identify information ...