組權限未生效


1

我已將用戶添加到組中。

[email protected]:/localdata/harvard$ groups chwinn
chwinn : chwinn perma

然後我遞歸地更改了目錄的組:

sudo chgrp -R perma /localdata/harvard-OCR
[email protected]:/localdata/harvard$ sudo chgrp -R perma /localdata/harvard-OCR
[email protected]:/localdata/harvard$ ls -la /localdata | grep harvard-OCR
drwxr-x---   4 pwan     perma            4096 Dec 17  2012 harvard-OCR

但是我的用戶仍然無法訪問該目錄

[email protected]:/localdata/harvard$ sudo su chwinn
[email protected]:/localdata/harvard$ cd /localdata/harvard-OCR
bash: cd: /localdata/harvard-OCR: Permission denied

知道發生了什麼事和/或如何解決?

編輯:嘗試了A.B.的建議。仍然獲得許可被拒絕。

[email protected]:~$ ls -la / |grep localdata
drwxrwxr-x 131 root perma  4096 Aug 25 15:19 localdata
[email protected]:~$ ls -la /localdata |grep harvard
drwxrwx--x  13 pwan     perma            4096 Nov 16  2013 harvard
drwxr-x---   5 pwan     perma            4096 Feb 27  2013 harvard-csv
drwxr-x---   4 pwan     perma            4096 Dec 17  2012 harvard-OCR
[email protected]:~$ sudo su chwinn
[sudo] password for selah: 
[email protected]:/home/selah$ ls /localdata/harvard
ls: cannot open directory /localdata/harvard: Permission denied
0

The folder localdata has the wrong permissions. To change the permission of a subfolder is not enough. The whole path need the right permissions.

Either you change the group for /localdata too via

sudo chgrp perma /localdata

and to be sure

sudo chmod g+x /localdata

or you set the the search permission for directories x for all users

sudo chmod o+x /localdata

0

In the case of an NFS server, the server controls who has access to a file. This means that you need to set the permissions on the server, not locally. So basically you need to ask your server admin to create a perma group and add you to it.