Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

.htpasswd Generator

Generate user:hash lines for HTTP Basic Authentication in Apache, Nginx, Traefik and Caddy — with bcrypt by default and nothing sent to a server.

Mis à jour le

🔒 Runs locally with your browser’s Web Crypto API — nothing you type is sent to a server.

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : Htpasswd Generator

  1. Enter a username and password (or generate a strong password).
  2. Keep bcrypt unless your server is very old.
  3. Click Add user; repeat for more users.
  4. Copy the lines into your .htpasswd file or download it.

What is an .htpasswd file?

An .htpasswd file stores usernames and password hashes for HTTP Basic Authentication — the browser login prompt used to protect staging sites, admin areas and internal tools. Each line is username:hash.

Algorithms

FormatPrefixSecuritySupported by
bcrypt$2y$Strong, salted, slowApache 2.4+, Nginx (via system crypt on most Linux), Traefik, Caddy
APR1-MD5$apr1$Salted but fast — weak by today’s standardsApache, Nginx everywhere
SHA1{SHA}Unsalted — avoidApache, Nginx

Using the file

Apache (.htaccess or vhost):

AuthType Basic
AuthName "Restricted"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user

Nginx:

location /admin/ {
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
}

Keep the file outside the web root and readable only by the server (for example chmod 640). Basic Auth sends the password with every request, so only use it over HTTPS.

Nginx may not accept bcrypt on systems where its crypt() lacks support (some Alpine images); use APR1 there. Generate single bcrypt hashes with the bcrypt generator.

Aussi recherché comme : htpasswd online, nginx basic auth password, apache htpasswd, generate htpasswd, traefik basic auth.

Outils complémentaires : Htpasswd Generator

  • Générateur de mots de passe — Créez des mots de passe robustes et véritablement aléatoires ou des phrases de passe faciles à saisir, grâce à des règles avancées : incluez ou excluez des mots, imposez des caractères, choisissez les symboles autorisés, évitez les répétitions et les séquences.
  • Générateur de configuration Nginx — Choisissez ce que Nginx doit faire — servir un site statique ou une application SPA, agir en tant que proxy vers une application Node/Python, ou exécuter du code PHP — et cochez les options supplémentaires.
  • Calculateur chmod — Cochez les cases « Lecture », « Écriture » et « Exécution » pour le propriétaire, le groupe et les autres — ou saisissez 755, rwxr-xr-x ou u=rwx,g=rx,o=rx.
  • Hash Generator — Compute MD5 and SHA hashes of any text or file instantly, create HMAC signatures, and paste an expected checksum to verify a download.

Questions fréquentes

Does Nginx support bcrypt in .htpasswd?
Yes on most Linux distributions, because Nginx uses the system crypt() function. On systems without bcrypt support (for example some Alpine images), use APR1-MD5.
Is the password sent to your server?
No. Hashes are computed in your browser; nothing is transmitted or stored.
How do I add a user to an existing file?
Generate the line here and append it to the file on a new line. Adding the same username again replaces the old line in the box above.
Why is every bcrypt line different?
Each hash has a random salt. Different hashes for the same password all work.
Puis-je installer Htpasswd Generator en tant qu’application web et l’utiliser hors ligne ?
Oui. Htpasswd Generator est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires