Cannot set up subdirectories of a share in Samba Properly

I can perfectly edit smb.conf to create shares and fully control file access of the share. and if users access files or folders within the share can tweak the permissions perfectly.
Problem is I cannot set permissions properly on subdirectories within the share. If i share every single folder I can make it work. But I do not think I should have to. in windows you can right click on a non shared folder within a shared folder, and set ntfs and share permissions, to control access to that folder.
How can I do this with samba. It is driving me crazy
I can’t seem to find a straight answer to this question anywhere

help appreciated,
Bill;)

On Thu December 18 2008 09:16 am, bperrotta wrote:

>
> I can perfectly edit smb.conf to create shares and fully control file
> access of the share. and if users access files or folders within the
> share can tweak the permissions perfectly.
> Problem is I cannot set permissions properly on subdirectories within
> the share. If i share every single folder I can make it work. But I do
> not think I should have to. in windows you can right click on a non
> shared folder within a shared folder, and set ntfs and share
> permissions, to control access to that folder.
> How can I do this with samba. It is driving me crazy
> I can’t seem to find a straight answer to this question anywhere
>
> help appreciated,
> Bill;)
>
>
Bill;
The default mode for creating directories through Samba is 0755,(drwxr-xr-x).
This means that only the owner can write to the directory, but this can be
changed. It’s not clear from your post which permissions you desire. Try:


man smb.conf

Look at the usage of the following parameters, to see if any of these do what
you want.

directory mask
force directory mode
inherit permissions
inherit acls
force user

Of course acls require that the volume containing the shares is mounted with
acl support. If you still have questions, please post a typical share and
tell us what permissions you would like on the subdirectories.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Thanks will look at that.
I mean when I create a directory from the server, if it is a non shared directory inside a samba share how do I give the user of my choice the full rights to it over the network. simply put. and deny everyone else access to it. I cannot not get this to work on non shared folders.
in windows like i said you canjust right click a directory you create and set the permissions on it. how do i do this with samba.

like Users share = everyone read works fine
but inside users share Bob Ed
these are not shared if i chown these folders to
the users in linux, they still can’t access them
however if i share the folders i can give full access to ed to his folder and deny everyone else access no problem. but only if it is shared and it shows up in \samba\ed. if you go users ed then it denies access altogether.

On Thu December 18 2008 10:46 am, bperrotta wrote:

>
> Thanks will look at that.
> I mean when I create a directory from the server, if it is a non shared
> directory inside a samba share how do I give the user of my choice the
> full rights to it over the network. simply put. and deny everyone else
> access to it. I cannot not get this to work on non shared folders.
> in windows like i said you canjust right click a directory you create
> and set the permissions on it. how do i do this with samba.
>
>
Bill;

This should be a matter of setting the “nix” permissions. You need to change
the owner, group and the ugo permissions. For details see:


man chmod
man chown

In KDE3.5.x, I often use “File Manager-Super User Mode”. Right
click on a folder/file, choose “properties” from the drop down menu, and then
choose the permission tab. There must be something similar in gnome.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

I am trying the file manager to create a folder I give read and write to my user all others forbidden. but it only allows me to view the folder. when i try to create
something inside the folder, it says access denied.>:(

By the way when i chown the directory to my user the group remains as root. owner changes to my user name

Actually i can change it to users now but i still can’t write anything directly to the folder unless it is directly shared. what permission can i add to the samba share users which is where the folder i am trying to create is contained to allow me to write to folders within because i can browse and open the folder but if ui try to create anything inside i get access denied error.

Could be a glitch now all of a sudden i can do it.
i put in force directory mode = yes
then #ed it out to see if that really was allowing it to work. set the permissions on the folder for owner access only, group others forbidden, and now it seems to work. No actually wait i am inheriting the no writable probably from the users folder is there a way not to inherit permissions from the share? Or should i say how do i shut off permission inheritance on the smb share. so that none of the subfolders inherit it’s permissions?

On Thu December 18 2008 11:56 am, bperrotta wrote:

>
> Actually i can change it to users now but i still can’t write anything
> directly to the folder unless it is directly shared. what permission
> can i add to the samba share users which is where the folder i am trying
> to create is contained to allow me to write to folders within because i
> can browse and open the folder but if ui try to create anything inside i
> get access denied error.
>
>
Bill;
Please post the contents of the [global] and [share under question] portion of
your /etc/samba/smb.conf. Also the ‘nix’ owners and permissions. You can
substitute values for any sensitive information. At this time I’m kind of
thinking your user may be authenticating as “guest” (nix user nobody).
Seeing your smb.conf may help diagnose this. But just in case, have you
added the user to Samba with:


smbpasswd -a <username>

?

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On Thu December 18 2008 12:16 pm, bperrotta wrote:

>
> Could be a glitch now all of a sudden i can do it.
> i put in force directory mode = yes
> then #ed it out to see if that really was allowing it to work. set the
> permissions on the folder for owner access only, group others forbidden,
> and now it seems to work.
>
>
Bill;

I had not seen this when I wrote my last post.

  1. The force directory mode is not a yes/no but rather numeric; it should be
    something like “force directory mode = 750” or what ever you want. These are
    the octal permissions for ugo with r=4,w=2,x=1. 7=4+2+1; 5=4+1, 3= 2+1 etc.
    (In the example above the owner(u) is rwx, the group(g)is r-x and the
    other(o) is —). This only effects permissions for the clients when they
    create a directory.
  2. It may be that the clients (or Samba) had cached the earlier permissions
    and not actually applied your new permissions.

Glad it all works now.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

To change the group, use chgrp.

Or do both the owner and group at once with:

chown owner:group file1 directory1 ...