【问题标题】:Failure in Apache+Windows basic authenticationApache+Windows 基本认证失败
【发布时间】:2022-09-26 16:53:21
【问题描述】:

.htaccess

AuthName \"Restricted Area\" 
AuthType Basic 
AuthUserFile path/.htpasswd
require valid-user

.htpasswd

test:FUgb1Qdh6571o
#This tool is used to generate password file http://tools.dynamicdrive.com/password/

当 Apache 在 Windows 10 上运行并且我试图访问文件夹身份验证对话框出现时,它不会进行身份验证并且不允许访问受限文件夹。

阿帕奇错误日志:

AH01617: user test: authentication failure for \"/folder\": Password Mismatch

当 Apache 在 Ubuntu 上运行时,相同的设置可以正常工作

有什么问题?不同的密码存储方法?

    标签: windows apache basic-authentication


    【解决方案1】:

    我不知道您使用的在线工具,但我建议使用 htpasswd 工具生成密码。

    要创建一个新的db,请使用:

    htpasswd -c .htpasswd test
    

    要更新密码,请使用:

    htpasswd .htpasswd test
    

    PS。我不建议使用在线密码生成器。 可以被收割,然后用来对付你。

    PS.2 可能htpasswd 命令在apache installation directory

    【讨论】:

      猜你喜欢
      • 2020-11-14
      • 1970-01-01
      • 2013-06-09
      • 1970-01-01
      • 2017-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多