如何添加多個用戶和登錄憑據,以便多個用戶可以使用其特定憑據訪問目錄?假設我希望他們都能夠訪問該目錄/about/team/
.ht 訪問:
AuthType Basic
AuthName "Please enter the username and password"
AuthBasicProvider file
AuthUserFile /path/.htpasswd1
Require user user1
AuthType Basic
AuthName "Please enter the username and password"
AuthBasicProvider file
AuthUserFile /path/.htpasswd2
Require user user2
AuthType Basic
AuthName "Please enter the username and password"
AuthBasicProvider file
AuthUserFile /path/.htpasswd3
Require user user3
.htpasswd
user1: 123%%^sample-passwordHJGH&^
user2: 456%%^sample-passwordHJGH&^
user3: 789%%^sample-passwordHJGH&^
謝謝
uj5u.com熱心網友回復:
指定單個身份驗證塊并Require valid-user改為使用。例如:
AuthType Basic
AuthName "Please enter the username and password"
AuthBasicProvider file
AuthUserFile /absolute/file-path/to/.htpasswd
Require valid-user
請注意,檔案路徑AuthUserFile是絕對檔案系統路徑。
參考:
- https://httpd.apache.org/docs/2.4/howto/auth.html#lettingmorethanonepersonin
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/411223.html
標籤:
上一篇:將檔案夾重寫為子檔案夾
