gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 04:06:28 26 4
gpt4 key购买 nike

我想使用 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 中创建受密码保护的文件/文件夹(“前端”/“命令提示符”/“基于网络”)。我收到以下错误:

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

最佳答案

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


AuthUserFile“/mnt/Recordings/CONF/.htpasswd”
AuthType 基本
AuthName“我的 secret 文件夹”
需要有效用户
满足任意
订单拒绝、允许
所有人都否认

关于linux - 手动密码保护文件/文件夹 (Linux),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20995637/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com