权限被拒绝 - 即使在拥有所有权的组中

Permission denied - Even tho in group with ownership

我创建了一个“证书”组并将该组作为 chgrp -R 放入 /root/ca 及其所有文件! 即使我是“证书”的成员(重新启动多次甚至重新启动服务器)并且在 drwsrwsr-x 上设置了权限我在尝试“cd /root/ca”时仍然收到错误“权限被拒绝”。 我尝试更改权限和所有权等等,但不知何故仍然无法访问该文件夹,也无法在不使用“sudo”的情况下获取有关该文件夹的任何信息。 任何人都知道可能导致问题的原因以及如何解决它,所以如果我是证书成员,我可以访问该文件夹吗?

adm_mike@sf-svr-crt01:~$ id -NG
adm_mike adm cdrom sudo dip plugdev lxd certificates
adm_mike@sf-svr-crt01:~$ sudo ls -lh /root | grep ca
drwsrwsr-x 8 root certificates 4.0K Aug 18 06:25 ca
adm_mike@sf-svr-crt01:~$ sudo ls -lh /root/ca
drwsrwsr-x 2 root certificates 4.0K Aug 18 06:28 certs
drwsrwsr-x 2 root certificates 4.0K Aug 18 06:00 config
drwsrwsr-x 2 root certificates 4.0K Aug 13 06:36 crl
-rwxrwxr-x 1 root certificates    5 Aug 13 06:37 crlnumber
-rwxrwxr-x 1 root certificates  579 Aug 18 06:25 index.txt
-rwxrwxr-x 1 root certificates   21 Aug 18 06:25 index.txt.attr
-rwxrwxr-x 1 root certificates   21 Aug 16 15:21 index.txt.attr.old
-rwxrwxr-x 1 root certificates  423 Aug 16 15:21 index.txt.old
drwsrwsr-x 2 root certificates 4.0K Aug 18 06:25 newcerts
drwsrwsr-x 2 root certificates 4.0K Aug 17 14:16 private
drwsrwsr-x 2 root certificates 4.0K Aug 18 06:13 request
-rwxrwxr-x 1 root certificates    5 Aug 18 06:25 serial
-rwxrwxr-x 1 root certificates    5 Aug 16 15:21 serial.old
adm_mike@sf-svr-crt01:~$ cd /root/ca
-bash: cd: /root/ca: Permission denied

Linux Codes as Image

为了切换到目录 /root/ca,您还需要对顶级目录具有执行 (x) 权限 - 在本例中为 /root。虽然理论上解决方案也是更改 /root 的组,但不建议这样做,因为 /root 在所有情况下都应该只能由 root 用户访问。

您应该在单独的位置创建一个目录,即 /etc/ssl/ca,并在那里设置相应的权限。