To create the
htpasswd file along with its first user, I just:
htpasswd -c /path/to/htpasswdfile/htpasswd some-user
It’ll ask you for the password for that user, encrypt it and store it in that location.
Add these lines to get Nginx to use the file for basic auth:
auth_basic "Login to Proceed: "; #(or whatever message you want)
To append another user to the
htpasswd file do:
htpasswd /path/to/htpasswd/htpasswd second-user
That ought to do it.
apache-utils on Debian or use Paru/Yay to install
nginx_passwd on Arch.
Feedback on this post? Mail me at email@example.com
P.P.S. Subscribe to my mailing list!
Forward these posts and letters to your friends and get them to subscribe!
P.P.P.S. Feed my insatiable reading habit.