透過htpasswd來產生
要安裝apache2-utils 元件 使用htpasswd
sudo apt-get install apache2-utils
輸入以下指令產生htpasswd (其中/etc/apache2/.htpasswd為檔案產生位置 test01為使用者名稱)
sudo htpasswd -c /etc/apache2/.htpasswd test01
會顯示輸入密碼 檔案將產生到指定的位置
如要新增第二組使用者 上方指令請先移除 -c , 第二組帳密如下輸入以下指令.
sudo htpasswd /etc/apache2/.htpasswd test02