Verify user and password against a file created by htpasswd

You can use the htpasswd tool for this. # create htpasswd_file with user:password $ htpasswd -cb htpasswd_file user password Adding password for user user # verify password for user $ htpasswd -vb htpasswd_file user wrongpassword password verification failed $ htpasswd -vb htpasswd_file user password Password for user user correct. Exit status is 0 for success, … Read more

Adding a user on .htpasswd

Exact same thing, just omit the -c option. Apache’s docs on it here. htpasswd /etc/apache2/.htpasswd newuser Also, htpasswd typically isn’t run as root. It’s typically owned by either the web server, or the owner of the files being served. If you’re using root to edit it instead of logging in as one of those users, … Read more

tech