2016-11-12 20:35:52 +03:00
|
|
|
# htpasswd
|
|
|
|
|
|
|
|
> Create and manage htpasswd files to protect web server directories using basic authentication.
|
|
|
|
|
|
|
|
- Create/overwrite htpasswd file:
|
|
|
|
|
2016-11-13 15:17:34 +03:00
|
|
|
`htpasswd -c {{path/to/file}} {{user_name}}`
|
2016-11-12 20:35:52 +03:00
|
|
|
|
|
|
|
- Add user to htpasswd file or update existing user:
|
|
|
|
|
2016-11-13 15:17:34 +03:00
|
|
|
`htpasswd {{path/to/file}} {{user_name}}`
|
2016-11-12 20:35:52 +03:00
|
|
|
|
2016-11-13 15:46:43 +03:00
|
|
|
- Add user to htpasswd file in batch mode without an interactive password prompt (for script usage):
|
2016-11-12 20:35:52 +03:00
|
|
|
|
2016-11-13 15:17:34 +03:00
|
|
|
`htpasswd -b {{path/to/file}} {{user_name}} {{password}}`
|
2016-11-12 20:35:52 +03:00
|
|
|
|
|
|
|
- Delete user from htpasswd file:
|
|
|
|
|
2016-11-13 15:17:34 +03:00
|
|
|
`htpasswd -D {{path/to/file}} {{user_name}}`
|
2016-11-12 20:35:52 +03:00
|
|
|
|
|
|
|
- Verify user password:
|
|
|
|
|
2016-11-13 15:17:34 +03:00
|
|
|
`htpasswd -v {{path/to/file}} {{user_name}}`
|