手动密码保护文件/文件夹 (Linux)



我想使用 htpasswd 在 Linux(Centos) 中使文件/文件夹受到密码保护。我做了以下工作:-

root@ cd /mnt/Recordings/CONF (I have Changed the directory)
CONF@ htpasswd -c .htpasswd xxxxx
CONF@ pwd
/mnt/Recordings/CONF
CONF@ vim .htaccess
AuthUserFile /mnt/Recordings/CONF/ .htpasswd
AuthName "Enter Password"
AuthType Basic
AuthName "Protected Context"
<Limit GET POST>
require valid-user
Require python
</Limit>

我无法在 Linux 中创建受密码保护的文件/文件夹("前端"/"命令提示符"/"基于 Web")。我收到以下错误:

[2014年1月8日星期三 17:38:57] [警报] [客户端 xxx.xxx.xxx.xxx]/mnt/Recordings/CONF/.htaccess:无效的身份验证文件类型:.htpasswd

尝试 htaccess 文件中的以下代码:

AuthUserFile "/mnt/Recordings/CONF/.htpasswd" AuthType Basic AuthName "My Secret Folder" Require valid-user Satisfy any Order deny,allow Deny from all

最新更新