我在为特定用户设置权限时遇到问题。
我有一个目录/srv/git/,我试图在其中创建一个test 包含一个文件testfile(由 拥有www:www-data)的子目录。testfile应该只能由用户和组而不是其他人读写。
[root@bartplatak ~]# cd /srv/git
[root@bartplatak git]# mkdir test && touch test/testfile
[root@bartplatak git]# chown -R www:www-data test
[root@bartplatak git]# chmod o= test/testfile
[root@bartplatak git]# chmod -R ug=rw test
[root@bartplatak git]# sync
[root@bartplatak git]# su www
Run Code Online (Sandbox Code Playgroud)
但是由于某些未知原因,我无法cd进入目录(并且列出它显示的信息非常不完整)
bash-4.1$ pwd
/srv/git
bash-4.1$ ls -la test
ls: cannot access test/.: Permission denied
ls: cannot access test/testfile: Permission denied
ls: cannot access test/..: Permission denied
total 0
d????????? ? …Run Code Online (Sandbox Code Playgroud)