.htpasswd one-liner

Preface

It’s annoying when you need apache2-utils just for creating password hash for Basic auth. So here is Shell one-liner doing it using openssl.

$ user=ab
$ pass=pwd
$ printf "${user}:$(openssl passwd -apr1 ${pass})\n"

#linux #bash #openssl #tool #nginx

Leave a Reply

Your email address will not be published.