tldr/pages/common/htpasswd.md

24 lines
591 B
Markdown
Raw Normal View History

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