株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

新規作成

htpasswd -b -m -c .htpasswd test password

# cat .htpasswd
test:$apr1$.qM7LWcN$pwlNMo3cBNKNb3PJIzsxu/

追加作成

# htpasswd -b -m .htpasswd test2 password
Adding password for user test2

# cat .htpasswd
test:$apr1$.qM7LWcN$pwlNMo3cBNKNb3PJIzsxu/
test2:$apr1$nPy4qYuP$u8f4eCirx14MnH5BFLwx80

-m→MD5でハッシュ
-c→新規作成
-b→標準出力

.htpasswordと同じディレクトリに.htaccessを作成

# cat .htaccess                            
AuthType Basic                                                
AuthUserFile /home/user/.htpasswd   
AuthName "UserAuth"                                           
<Limit GET POST HEAD>                                         
require valid-user                                            
</Limit>

削除

 htpasswd -D .htpasswd test

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)