Preventing other users from seeing directory listings

Status
Not open for further replies.

abasel

Dabbler
Joined
Oct 1, 2012
Messages
10
I am using FreeNAS-9.10.2-U3 (e1497f269).

I have a folder with the following permissions on mnt/MainStore/HomeShare:
Apply Owner (user): checked
Owner (user): root
Apply Owner (group): checked
Owner (group): MyUsers
Apply Mode: Checked
Mode: 750
Permission Type: Unix
Set Permission Recursively: unchecked

I then have a Windows (SMB) share on mnt/MainStore/HomeShare called HomeShare
User as home share: unchecked
Apply Default Permission: checked
Allow Guest Access: Unchecked

I then have two users with the following home directories:
user1: /mnt/MainStore/HomeShare/user1 (with permissions 755)
user2: /mnt/MainStore/HomeShare/user2 (with permissions 755)

Both users are part of the group MyUsers

Each user can connect to a browse both shares but can only read the contents of the files in there own directories. If they try read the other files they get permission denied (which is good).

I however do not what them to be able to list the contents of each others drivers but only those of their own. I can sort of understand why this is happening as but I am not sure how to fix it.

=====================
I have just realised that while the users do not appear to be able to create directories or read files in each others root folders, they can in fact do so in each others sub folders.. I am very confused.
 
Last edited:

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I am using FreeNAS-9.10.2-U3 (e1497f269).

I have a folder with the following permissions on mnt/MainStore/HomeShare:
Apply Owner (user): checked
Owner (user): root
Apply Owner (group): checked
Owner (group): MyUsers
Apply Mode: Checked
Mode: 750
Permission Type: Unix
Set Permission Recursively: unchecked

I then have a Windows (SMB) share on mnt/MainStore/HomeShare called HomeShare
User as home share: unchecked
Apply Default Permission: checked
Allow Guest Access: Unchecked

I then have two users with the following home directories:
user1: /mnt/MainStore/HomeShare/user1 (with permissions 755)
user2: /mnt/MainStore/HomeShare/user2 (with permissions 755)

Both users are part of the group MyUsers

Each user can connect to a browse both shares but can only read the contents of the files in there own directories. If they try read the other files they get permission denied (which is good).

I however do not what them to be able to list the contents of each others drivers but only those of their own. I can sort of understand why this is happening as but I am not sure how to fix it.

=====================
I have just realised that while the users do not appear to be able to create directories or read files in each others root folders, they can in fact do so in each others sub folders.. I am very confused.

Why are you using Unix permissions on a Samba share? The answer to your problem is of course to set permissions correctly. :) Unix permissions + samba in FreeNAS requires some workarounds, and is generally not a good option unless you must configure FreeNAS in that way.
 

Vito Reiter

Wise in the Ways of Science
Joined
Jan 18, 2017
Messages
232
I think the answer to this is to go into your Users, in each of the users set the home path (or whatever that setting is called) to their respective directories, so when they access the server it should bring them right where you tell it to and not to a parent directory.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I think the answer to this is to go into your Users, in each of the users set the home path (or whatever that setting is called) to their respective directories, so when they access the server it should bring them right where you tell it to and not to a parent directory.
I believe the parent directory will still be available but hidden even if you do this. \\SERVER\HOMES If you want to lock down Samba home directories, you need to set permissions correctly.
 
Status
Not open for further replies.
Top