ex:
vi /www/.htaccess
    AuthName "Protect test by .htaccess"
    Authtype Basic
    AuthUserFile /www/.htpasswd
    require user 123

htpasswd -c /www/.htpasswd 123
New password:
Re-type new password:
Adding password for user 123

備註:
AuthName:輸入帳密的對話視窗中,出現的提示字元。
AuthType:認證的類型,我們這裡僅列出 Apache 預設的類型。
AuthUserFile:這個保護目錄所使用的帳密設定檔。
require:後面接可以使用的帳號。
來源資料:htaccess