■Apache用のパスワードファイル「/etc/httpd/conf/.htpasswd」を新規に作成し、ユーザ「user1」を追加する場合
※もし既に「.htpasswd」ファイルが存在する場合は、これまでに登録されたユーザクリアされて、新規の「user1」だけになります。
# htpasswd -c /etc/httpd/conf/.htpasswd user1
New password:
Re-type new password:
Adding password for user user1
■ユーザ「user2」を追加する場合
# htpasswd /etc/httpd/conf/.htpasswd user2
New password:
Re-type new password:
Adding password for user user2
■ユーザ「user2」のパスワードを変更する場合
# htpasswd /etc/httpd/conf/.htpasswd user2
New password:
Re-type new password:
Updating password for user user2
■ユーザ「user2」を削除する場合
# htpasswd -D /etc/httpd/conf/.htpasswd user2
Deleting password for user user2
コメント