Files
mkdocs/docs/macos/webserver/htpasswd.md
2020-07-21 11:16:00 +02:00

36 lines
685 B
Markdown

# 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
```http
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
```http
bruno:$2y$10$eoOcCehAbCdEfGhIj.9AAGI90XyYaXZrSbzdswKuL6Q5E9oX2
```
http://www.htaccesstools.com/htpasswd-generator