htpasswd Notes to Self

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) auth_basic_user_file /path/to/htpasswdfile/htpasswd; To append another user to the htpasswd file do: htpasswd /path/to/htpasswd/htpasswd second-user...

June 24, 2023 · Mario Jason Braganza