Htpasswd Generator

Boost your site's protection seamlessly with our intuitive .htpasswd generator, ensuring secure, encrypted access across multiple platforms.

INPUT


Options

OUTPUT

Server Side
Copy and paste this into your .htpasswd file
Documentation 📕

The Htpasswd Generator Tool is designed to streamline the process of creating secure entries for .htpasswd files, enabling website administrators to protect directories on their site with basic authentication. This tool generates credentials by hashing passwords using the MD5 algorithm, making it compatible across diverse hosting platforms, including Windows and Linux. The user-friendly interface allows for quick generation of .htpasswd entries without the need for complex command-line tools or extensive technical knowledge.

Understanding .htpasswd

The .htpasswd file is used by the Apache HTTP Server to create secure, restricted access areas on a website. It works in conjunction with a .htaccess file and contains lines of username and password pairs, separated by a colon. These passwords are encrypted, typically using the crypt method available on UNIX systems, although MD5 or SHA1 encryptions are also common.

Our .htpasswd generator can leverage either MD5, Bcrypt, SHA1 or Crypt hashing algorithm to create secure passwords compatible across various platforms, including Windows, MacOS, and Linux.

Generating .htpasswd Online using Htpasswd Generator Tool

To generate an entry for an .htpasswd file, simply input a username, password and select an encryption method.

For crafting strong and secure passwords, we recommend using our dedicated password generator tool.

The corresponding .htpasswd file must be placed in the folder defined by the AuthUserFile directive (please see below). In that case, it will be located in the “/path/to/.htpasswd” directory. A typical .htpasswd file looks like the following:

user1:$apr1$clme56rh$7kbO8h94VA5UWBNpdayu80
user2:$apr1$l76zf4jy$M7064lZwDjJjGigJ48fqP/
user3:$apr1$f2dmapgz$C.8mBkD1DoUiBVJGaCfJM0

Securing Apache Folders

To restrict access to specific folders within an Apache server, place a .htaccess file in the desired directory. This file should contain directives like the following to enforce basic authentication:

AuthUserFile /path/to/.htpasswd
AuthType Basic
AuthName "My restricted Area"
Require valid-user

Securing Folders on Nginx

For Nginx servers, update your site’s configuration as follows to protect a particular folder:

location /api {
    auth_basic           "Administrator's Area";
    auth_basic_user_file /path/to/.htpasswd;
}

To apply basic authentication site-wide while keeping certain areas public, use the auth_basic off directive within a specific location block:

server {
    ...
    auth_basic           "Administrator's Area";
    auth_basic_user_file /path/to/.htpasswd;
    location /public/ {
        auth_basic off;
    }
}

Managing Multiple Entries in .htpasswd

Yes, the .htpasswd file can accommodate multiple user credentials. Simply add a new username and password pair on each line to introduce additional entries. This feature allows for the creation of diverse access controls within the same file, enhancing the security and flexibility of your site’s authentication scheme.

TOOL TAGS 🔖
Share Our Tool 📣
Support Us 👏
IO Tools - Online web tools to support your daily work | Product Hunt Or