Protéger l'accès à une page par un mot-de-passe¶
https://www.it-connect.fr/securiser-les-authentifications-htaccess-avec-loption-digest%EF%BB%BF/
On utilise 2 fichiers (.htaccess et .htpasswd):
.htaccess¶
Il est à placer dans le dossier à protéger. https://httpd.apache.org/docs/current/fr/howto/htaccess.html chmod 755
AuthType Basic
AuthName "Protected Site"
AuthUserFile /Users/bruno/Sites/.htpasswd
require valid-user
.htpasswd¶
On peut le placer n'importe où.
Il contient les paires d'identifiants / mots de passe
bruno:$2y$10$eoOcCehAbCdEfGhIj.9AAGI90XyYaXZrSbzdswKuL6Q5E9oX2
http://www.htaccesstools.com/htpasswd-generator
Dernière mise à jour:
November 9, 2023