Generating htpasswd entry with OpenSSL



Published: 2017-07-07 12:28:54 +0000
Categories: BASH,

Language

BASH

Description

Generally when generating a htpasswd entry for Basic Authentication you'd use apache-utils to do it. On a server running only NGinx, this probably won't be available, so you instead need to do it with openssl

Similar to

Snippet

printf "USER:$(openssl passwd -apr1 PASSWORD)\n" >> .htpasswd

Usage Example

printf "joeblogs:$(openssl passwd -apr1 A9n,6-l8)\n" >> .htpasswd

Requires

Keywords

HTPasswd, Nginx, Basic Authentication, Apache, passwd,

Latest Posts


Copyright © 2022 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk, http://phecoopwm6x7azx26ctuqcp6673bbqkrqfeoiz2wwk36sady5tqbdpqd.onion and http://snippets.bentasker.i2p
hit counter