Beginner question about sharing with CIFS

Status
Not open for further replies.

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
Hi,

Just started using FreeNAS-9.2.1.3-RELEASE-x64

We used to have a serveur using SAMBA where I could configure shares based on directories.

Now I'm following this:
http://doc.freenas.org/index.php/Windows_(CIFS)_Shares#Creating_CIFS_Shares

And I get to the point where, following the documentation, I set the permission at the volume level.

And then the rest of the documentation is on other topics I don't need.

So I've been creating DATASETS and ZVOLS but none seem to allow me to create different permissions?

And that'd be ok if I could configure a CIFS share to have specific permission (R/W/E for specific users or groups)

In the "Advanced Mode" I see Hosts Allow and Deny fields, but I figured it is in relation with IP addresses or hostnames, and not anything to do with users or groups!


So in conclusion I'm looking to specify permissions for users or groups at the share level, using CIFS... how can I do that in the GUI please?


Thanks!
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
When you create shares, you can create an owner and a group. If you make a user that has your Windows username/password in FreeNAS, and make it the owner, you can then go in a set permissions through Windows. Make sure you restart the CIFS service after you make any changes to the FreeNAS permissions (before you make any changes in Windows), and after you make all your changes in Windows.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
When you create shares, you can create an owner and a group. If you make a user that has your Windows username/password in FreeNAS, and make it the owner, you can then go in a set permissions through Windows. Make sure you restart the CIFS service after you make any changes to the FreeNAS permissions (before you make any changes in Windows), and after you make all your changes in Windows.


Thanks for your reply !

So if I understand correctly, I need to make is so my LDAP users are the same as the usernames used in Windows computers?
And I can make those users part of groups, and I can make CIFS shares use those groups...

So up to now it seems all good...

But WHERE can I set the permissions in the CIFS services?

Because the only place I see anything about permissions is at the Volume level.

What I'm looking for is to set permission per CIFS share.
Or per zfs dataset !
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
All you can set from within FreeNAS is the owner and group. Other permissions must be set from a Windows computer (or, at least, that's the easiest way to do it without delving into ACLs and whatnot from the command line).
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
okay, very interesting... so if I understand correctly, the best practice would be to :

A) Create the shares from FreeNAS and give them the administration's user name as owner

B) Then authenticate with this user from a Windows computer, and configure the permission of each share

Is that right?

I'll have to experiment, I'm used to the good ol' VIM SAMBA.CONF
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
okay, very interesting... so if I understand correctly, the best practice would be to :

A) Create the shares from FreeNAS and give them the administration's user name as owner

B) Then authenticate with this user from a Windows computer, and configure the permission of each share

Is that right?

That's how I did it, and it works for me. There may be a better way, but I've not found one that works as reliably. Other ways I've tried to do this cause erratic behavior and failed connections. Make sure to restart CIFS if you make any changes to the owner/group in FreeNAS.

I'll have to experiment, I'm used to the good ol' VIM SAMBA.CONF

This is probably why you're having problems. Changing the config files behind the GUI's back is asking for trouble.
 

BlazeStar

Patron
Joined
Apr 6, 2014
Messages
383
This is probably why you're having problems. Changing the config files behind the GUI's back is asking for trouble.


I understand your point, but I should have been clearer.

I meant BEFORE USING FREENAS, I use to configure CIFS using straight SAMBA server with text config file.

Now I'm trying to go along with using FreeNAS and configuring EVERYTHING from the GUI
 

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
Gotcha :)

I read that as *using* instead of *used to*. My bad.

As far as FreeNAS goes, when I make my shares I:
  1. Make the volume, and set the owner/group to the desired owner/group.
  2. Create the share.
  3. Restart CIFS.
  4. Log in to the share as the owner.
  5. Change the permissions on the root level for the share.
  6. (Double check (or remove) the Everyone permission because it has an extraneous special permission that allows anonymous users to delete files and folders)
 
Status
Not open for further replies.
Top