chmod permissions question

Red Squirrel

No Lifer
May 24, 2003
71,310
14,083
126
www.anyf.ca
Say I have a folder called parent and it's chmodded 700 and owned by "user:user"

If I put stuff in that folder and the permissions are say, 777 or some other permissions that others could access, would they be secure because of the parent folder's permissions?

In my testing it appears to be so, but just wondering if there's ways around that security that I'm not considering.

Here's what I need to do: I want to mount a CIFS shard to a linux directory, but I only want a specific user to have access to it, so I was thinking of making a folder, chmod it to 700 and make it owned by that user, then make another folder in that folder, and use it as the mount point.

Will this be secure from other users?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Depends. They wouldn't be able to cwd into the parent directory because of the 700 permissions, but they could still read the child directory if they knew it's name. So 'cd /blah' would fail but 'ls /blah/insecure' would work fine.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Actually it looks like I'm wrong, you need execute on all of the parent directories regardless.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
FWIW, you need 'r' permissions on a directory to list subdirectories.

Edit: r not rx
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
FWIW, you need 'r' permissions on a directory to list subdirectories.

You need r to read a directory, but you need x to read it's subdirectories.