bash - 试图让用户看到letsencrypt密钥
问题描述
我不知道这是否是正确的地方,但我会试一试
我试图让用户mysql读取letsencrypt密钥。
通常任何用户都可以看到live和archive文件夹,因此 mysql 用户也可以
debian:~# sudo -u mysql ls /etc/letsencrypt/archive/
example1.com example2.com example3.com
如果我尝试查看其中的文件
debian:~# sudo -u mysql ls /etc/letsencrypt/archive/example1.com
ls: Zugriff auf /etc/letsencrypt/archive/example1.com/ nicht möglich: Keine Berechtigung
(德语是什么意思:你无权查看文件。)
然后我装了setfacl并试图获得对文件的 mysql 访问权限,所以我去了:
setfacl -R -m "u:mysql:r" /etc/letsencrypt/archive/
然后我检查了acl
debian:~# getfacl /etc/letsencrypt/archive/example1.com
getfacl: Entferne führende '/' von absoluten Pfadnamen
# file: etc/letsencrypt/archive/example1.com
# owner: root
# group: root
user::rwx
user:mysql:r--
group::r-x
mask::r-x
other::r-x
然后我变得自信并称赞自己,就像我做聪明事时经常做的那样。
出于某种原因,我再次检查:
debian:~# sudo -u mysql ls /etc/letsencrypt/archive/example1.com
ls: Zugriff auf /etc/letsencrypt/archive/example1.com/ nicht möglich: Keine Berechtigung
用户 mysql 仍然什么也看不到。(setfacl --version 2.2.52)我错过了什么吗?
解决方案
您还需要在文件夹上设置可执行位(x),以便用户能够实际导航到目录中。尝试以下操作:
setfacl -m "u:mysql:rx" /etc/letsencrypt/archive/
setfacl -R -m "u:mysql:r" /etc/letsencrypt/archive/*
推荐阅读
- javascript - 我使用 webpack 得到一个 TypeError *.a.*
- database - 在 Firestore 中管理 createdAt 时间戳
- javascript - 从詹金斯下载 zip
- javascript - TypeError:无法读取未定义的属性“地图”(React.js)
- jsonparser - 如何解析包含“。”的json 以其关键名称
- python - SyntaxError:Ubuntu Python 3 终端上的语法无效
- c++ - 如何从 Qt QWebEngineView 获取 HTTP 状态码?
- java - 使用 JMockit 模拟类中的 Arrays.sort() 方法
- r - 如何将具有某些值的元素保留在列表中?
- angular - 刷新页面导致 404 错误-AWS-Angular 6