I'm working in Ubuntu 3.13.

The permissions on a drive are such that the owner can see directories and files with these permissions:

drwxrwxr-x    2 michael atlas    4096 Feb 15 12:34 temp2
drwxrwxr-x    2 michael atlas   12288 Mar 18 16:14 temp3

while another member (ubuntu) of the group 'atlas' sees this:

d????????? ? ? ? ?            ? temp2
d????????? ? ? ? ?            ? temp3

unless ubuntu uses sudo ls -l, then the owner, group, and permissions look the same as when michael does an ls -l.

Here it can be seen the two users are in the same group:

ubuntu@lincloud:~$ grep '^atlas' /etc/group

What is the cause of the problem? How do I fix it?

  • check LANG variable – Romeo Ninov Jun 2 '15 at 19:51
  • What's Ubuntu 3.13? Do you mean Ubuntu 13.04? – 200_success Jun 2 '15 at 19:59
  • uname -a 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux – Mike T Jun 2 '15 at 21:31
  • That's Ubuntu 14.04. 3.13 is the version of the kernel, not the Ubuntu version. – saiarcot895 Jun 2 '15 at 21:34
  • If not uname, what would I use to get the info that it's Ubuntu 14.04? – Mike T Jun 3 '15 at 13:51

The parent directory of temp2 and temp3 is where the issue lies.

Your atlas group has read permissions on the parent directory and you need read AND execute in order to see the files and their permissions.

if you're in the directory with temp2 and temp3 you can fix the issue with the following command:

sudo chmod g+x .
  • That worked. What is 'best practice'? – Mike T Jun 2 '15 at 21:31
  • It depends on what is in the directory and what security is needed. I'd say 750 or 770 (drwxr-x--- or drwxrwx--- respectively) – h3rrmiller Jun 2 '15 at 21:40

The attributes of file are stored in inode data structure which is related a inode number, such as permission, size, uid, gid( by ls -l and lsattr). file name isn't stored in the inode data structure. it is stored in the directory file, which is related a inode number. [luchaoqun@centos-7 ~]$ ls -i www 1704095 overflow_1 8722125 overflow_2

If both r and x permission are set on the directory, you can see the file name and inode information (by ls -i command). if there are r permission, not x permission, you only can see the file name, and can't see inode information in the directory.

[lu@centos-7 www]$ ls -l total 8 -rw-r--r--. 1 luchaoqun luchaoqun 0 Jun 3 13:19 overflow_1 -rw-r--r--. 1 luchaoqun luchaoqun 0 Jun 3 13:19 overflow_2

[lu@centos-7 ~]$chmod u-x [lu@centos-7 ~]$ ls -ld www drw-r-xr-x. 2 luchaoqun luchaoqun 40 Jun 3 13:19 www [lu@centos-7 ~]$ ls -l www ls: cannot access www/overflow_1: Permission denied ls: cannot access www/overflow_2: Permission denied total 0 ?????????? ? ? ? ? ? overflow_1 ?????????? ? ? ? ? ? overflow_2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.