Linux / UNIX generate htpasswd to store username and password with htpasswd command
Q. How do I use htpasswd command to store username and passwords?
A. htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users. If htpasswd cannot access a file, such as not being able to write to the output file or not being able to read the file in order to update it, it returns an error status and makes no changes.
Create a new password file
Following command will creates a new file and stores a record in it for user jerry. The user is prompted for the password. If the file exists and cannot be read, or cannot be written, it is not altered and htpasswd will display a message and return an error status.
# htpasswd -c /home/pwww/.htpasswd jerry
Change or update password
To add or modifies the password for user tom, enter:
# htpasswd /home/pwww/.htpasswd-users tom
The user is prompted for the password.
See previous FAQ : Apache password protect directories with .htaccess file for more examples.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Do I need to recompile PAM-aware application before using a PAM module?
- Linux create user account
- How to: Linux / UNIX setup Squid Proxy authentication
- Postfix SASL ERROR: Password not accepted from server: 535 5.7.0 Error: authentication failed: authentication failure
- Set Apache Password Protected Directories With .htaccess File
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: authentication, htpasswd_command, passwords, password_file, usernames



Recent Comments
Today ~ 1 Comment
Today ~ 2 Comments
Yesterday ~ 9 Comments
Yesterday ~ 32 Comments
07/04/2008 07:04 pm (2 days ago) ~ 1 Comment