字體:  

如何在Ubuntu下 安裝跟使用 htpasswd

ppstream 發表於: 2013-8-20 14:41 來源: ADJ網路控股集團


If you're trying to use nginx basic auth on a freshly installed Ubuntu server you might find out that you're missing this very important tool, htpasswd. If you're having trouble locating it, don't worry, here is the command you need to run in order to install it.

apt-get install apache2-utils

If you're not logged in as root add sudo in front of the command and you're done.
Here is an example command for using htpasswd for nginx:

htpasswd -c -d /path/to/file username