LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   UNIX file permissions (can't see files) (http://www.linuxquestions.org/questions/linux-newbie-8/unix-file-permissions-cant-see-files-4175431415/)

ilesterg 10-09-2012 09:20 PM

UNIX file permissions (can't see files)
 
Hi,

I am currently logged in as user2, and i was able to navigate to a directory x. In this directory, user1 has files which have the following permissions:
-rw-r--r-- user1 user1
Given that I am not with the same group as user1, I expect that I could at least see the file when I list directory contents. Is this always true to Unix? Or are there some other way that the owner (user1) hides the files from other users (such as user2)?

Thanks in advance,
Lester.

ilesterg 10-09-2012 09:22 PM

Btw, the problem is that, I can't see the files when I list directory contents. However, user2 has sent me a screenshot that shows the files in the said directory, with the above permissions.

thesullster 10-09-2012 10:29 PM

Do you just want to see the directory/files or also be able to modify/write?

ilesterg 10-09-2012 11:09 PM

Hi thesullster,

I want to verify that the files are really in that directory, and based on those permissions that I had from a screenshot, I expect to see those files when I list the directory contents.

Thanks.

abhinav4 10-10-2012 12:46 AM

Quote:

Originally Posted by ilesterg (Post 4801790)
Hi thesullster,

I want to verify that the files are really in that directory, and based on those permissions that I had from a screenshot, I expect to see those files when I list the directory contents.

Thanks.

As I can see the directory x has read permission for group and others. To enter a directory you need to have the execute permission too along with the read permission.

abhinav4 10-10-2012 12:55 AM

so if user1 change the permission like this you can see the files inside the directory x

Quote:

-rw-r--r-x user1 user1

ilesterg 10-10-2012 01:38 AM

Quote:

Originally Posted by abhinav4 (Post 4801826)
so if user1 change the permission like this you can see the files inside the directory x

Hi,

That applies to directories, but I dont thinks the same applies to files. My issue is not with directory x since I was able to navigate inside it, obviously it has execute permissions for other users. My concern here are the files inside the directory x.

Thanks.

---------- Post added 10-10-12 at 02:39 PM ----------

Quote:

Originally Posted by ilesterg (Post 4801737)
Hi,
In this directory, user1 has files which have the following permissions:
-rw-r--r-- user1 user1
Lester.

additional note: the 'have' here refers to the files. :D

Thanks.

jayakrishnan 10-10-2012 04:55 AM

You cant even view other directory/files unless you are a SU / root

ilesterg 10-10-2012 05:37 AM

Quote:

Originally Posted by jayakrishnan (Post 4801964)
You cant even view other directory/files unless you are a SU / root

Even if the file permission for other is "r--" ?

thesullster 10-10-2012 11:37 PM

In Debian, I sometimes do this (change home directory to the directory I want to monitor/access) :

sudo usermod -d <path to the directory you want to view> <your username>


All times are GMT -5. The time now is 11:40 PM.