在我的根文件夹中,我有一个名为 app 的文件夹(例如/root/myapp
)。此/root/app
文件夹归用户 root 和组team
. 我已通过使用将其应用于整个目录chown -R root:team /root/myapp
;但是我有一个用户是该team
组的一部分,他们无法访问此文件夹。
⚡ root@dev ~/myapp dev ● ls -la
total 10568
drwxrwxr-x 18 root team 4096 Aug 11 21:44 .
drwx------ 9 root root 4096 Aug 11 21:47 ..
-rw-rw-r-- 1 root team 341 Jun 17 02:17 .env
drwxrw-r-x 8 root team 4096 Aug 11 21:47 .git
-rw-rw-r-- 1 root team 1573 Aug 11 15:53 .gitignore
-rw-rw-r-- 1 root team 4405 Jul 30 15:11 Gemfile
-rw-rw-r-- 1 root team 13315 Aug 3 17:18 Gemfile.lock
-rw-rw-r-- 1 root team 384 Jun 17 02:11 README.md
-rw-rw-r-- 1 root team 227 Jun 17 02:11 Rakefile
drwxrw-r-x 13 root team 4096 Aug 11 20:23 app
drwxrw-r-x 2 root team 4096 Jun 17 02:11 bin
drwxrw-r-x 3 root team 4096 Jun 17 02:11 cfn-templates
drwxrw-r-x 5 root team 4096 Aug 11 15:54 config
-rw-rw-r-- 1 root team 130 Jun 17 02:11 config.ru
drwxrw-r-x 3 root team 4096 Aug 11 16:08 db
drwxrw-r-x 2 root team 4096 Aug 11 16:49 doc
drwxrw-r-x 6 root team 4096 Aug 11 20:23 lib
drwxrw-r-x 2 root team 4096 Jun 17 02:27 log
-rw-rw-r-- 1 root team 34733 Aug 11 16:50 models.dot
-rw-rw-r-- 1 root team 4439122 Aug 11 16:50 models.png
drwxrw-r-x 2 root team 4096 Jun 17 02:11 nginx
drwxrw-r-x 51 root team 4096 Jun 17 02:27 node_modules
-rw-rw-r-- 1 root team 14122 Jun 17 02:27 package-lock.json
-rw-rw-r-- 1 root team 706 Jun 17 02:11 package.json
drwxrw-r-x 2 root team 4096 Aug 3 18:38 public
drwxrw-r-x 2 root team 4096 Jun 17 02:11 storage
drwxrw-r-x 10 root team 4096 Jun 17 02:11 test
drwxrw-r-x 5 root team 4096 Jun 17 02:25 tmp
drwxrw-r-x 2 root team 4096 Jun 17 02:11 vendor
当我运行时groups user1
,我可以看到它user1
在team
组中:
⚡ root@dev ~/myapp dev ● groups user1
user1 : user1 team
在该用户的主目录中,我以下列方式创建了一个符号链接ln -s /root/myapp /home/user1/myapp
:但是,如果我尝试 cd 进入该用户下的该目录,我会得到permission denied
.
知道是什么原因造成的吗?据我了解,团队中的任何人都应该能够读取、写入或执行整个目录。
这是来自用户用户's home directory as the
用户的 ls:
│user1@dev ~ % ls -la
│total 84
│drwxr-xr-x 3 user1 user1 4096 Aug 11 21:55 .
│drwxr-xr-x 3 root root 4096 Aug 11 21:17 ..
│-rw------- 1 user1 user1 29 Aug 11 21:19 .bash_history
│-rw-r--r-- 1 user1 user1 220 Apr 4 2018 .bash_logout
│-rw-r--r-- 1 user1 user1 3771 Apr 4 2018 .bashrc
│-rw-r--r-- 1 user1 user1 0 Jun 23 04:40 .cloud-locale-test.skip
│-rw-r--r-- 1 user1 user1 807 Apr 4 2018 .profile
│drwxr-xr-x 2 root root 4096 Aug 11 21:17 .ssh
│-rw------- 1 user1 user1 695 Aug 11 21:32 .viminfo
│-rw-rw-r-- 1 user1 user1 42357 Aug 11 21:19 .zcompdump
│-rw------- 1 user1 user1 673 Aug 11 21:55 .zsh_history
│-rw-r--r-- 1 user1 user1 1295 Aug 11 21:21 .zshrc
│lrwxrwxrwx 1 user1 user1 10 Aug 11 21:18 myapp -> /root/myapp