-1

I have a quick question about how the read permission works. Does read permission mean I can open the file?

The situation is this: FTP server where I have an account that is not Root. There, files are owned by Root inside a 777 folder that have 604 permission -- so where "public" can "read".

Why can't I open those 604 files?

Does read mean only that you can see if the files exist?

Just curious if also there's a way to not showing the files at all to non-root users.

1 Answer 1

3

604 gives no permission to members of the file's group. If your account is a member of that group, it doesn't matter that the last digit is more permissive; you don't have these permissions.


To prevent users from accessing a file's contents, remove the read permission from the file. To hide a file, you can remove a directory's read permission. It can be entered, and files can be accessed and modified (given the correct permissions), but the directory contents will not be available.

4
  • but I tried to make a test on my server. I created a file with 604 permission owned by root:root. The user user1:users can read the 604 file because "public" have read permission Jan 22, 2012 at 18:12
  • @SandroAntonucci You didn't mention the file group in your question, so I had to assume. What's the error message when you try to open? Jan 22, 2012 at 18:14
  • you are right sorry, I didn't get your answer right and I didn't notice the group. I'm in the same group as the 604 files so that makes sense now. Isn't "stupid" giving access to public but not to an user in the same group? Jan 22, 2012 at 18:24
  • 3
    @SandroAntonucci On some Unixes, users are not able to change their group membership (i.e. leave a group). That makes it easy to create e.g. a quarantine group. There's a reason the octal digits in a file permission are usually descending. Also, it's easier if you think of owner/group/other, instead of owner/group/public. Jan 22, 2012 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .