nginx auth_basic 비밀번호 암호화 하기

(Last Updated On: May 31, 2020)

 

printf "${username}:`openssl passwd -apr1`\n" >> .htpasswd

변수로 쓰기

username=john
password=STRONGPASSWORD123$
printf "${username}:`openssl passwd -stdin -apr1 <<< ${password}`\n" >> .htpasswd