Results 1 to 4 of 4

Thread: Help to set access rights to share folders in SAMBA

  1. #1
    Join Date
    Jun 2013
    Beans
    27

    Help to set access rights to share folders in SAMBA

    Hi all,
    I am starting a different thread on this same issue to see if I explain it better than my first, and maybe I can get your expert help.

    I have a folder on an EXT4 partition on a RAID6 mount. The folder is called "share".
    From an smb.conf side, I
    have just reloaded Ubuntu 12.04 (after much frustration) and have the default SAMBA config, except:

    I set up the workgroup to my internal name (LHOME)
    and enabled (removed the comments character from) the line Security = User.


    What I am trying to achieve is:
    1. User "tm" to have admin rights to the share from Windows 8 client
    2. User "lf" to have read only access to the share from Windows 8 client
    3. No guest visibility to the shares

    I would be OK with:
    1. User "tm" to have admin rights to the share from Windows 8 client
    2. Guests (any incorrect user other than"tm") to have read only access to the share from Windows 8 client
    I have reloaded the Server (after much frustration) and on a default SAMBA config, I set up the workgroup to my internal name and enabled Security = User.

    I have created the user "tm" during installation and it is the default / admin user on the Server. I have created the user "lf" via:
    root@LSERVER:~# useradd lf
    root@LSERVER:~# passwd lf
    root@LSERVER:~# smbpasswd -a lf
    If I add the following share:
    [share]
    comment = Ubuntu File Server Share
    path = /storage/share
    browsable = yes
    guest ok = yes
    read only = no
    create mask = 0755

    Then I run:

    root@LSERVER:~# chown nobody.nogroup /storage/share
    root@LSERVER:~# restart smbd
    root@LSERVER:~# restart nmbd

    I can then copy, read, delete from the share from Windows 8, without having to log in to do this.


    Can you suggest a share layout for smb.conf and then the steps on the folder rights so that this is achieved please?

    I will put you on my Christmas card list, I promise!
    I am really stuck after hours of noob trial and errors... your help is hugely appreciated!

    M
    Last edited by MarcusL; June 22nd, 2013 at 10:37 AM.

  2. #2
    Join Date
    Dec 2009
    Beans
    6,772

    Re: Help to set access rights to share folders in SAMBA

    What I am trying to achieve is:
    1. User "tm" to have admin rights to the share from Windows 8 client
    2. User "lf" to have read only access to the share from Windows 8 client
    3. No guest visibility to the shares
    Then change your share definition to this:
    [share]
    comment = Ubuntu File Server Share
    path = /storage/share
    browsable = yes
    guest ok = no
    read only = no
    create mask = 0755
    And change ownership to this:
    Code:
    chown tm:tm /storage/share
    And permissions to this:
    Code:
    chmod 755 /storage/share
    There's a delicate ballet that occurs between samba authorizations and Linux permissions. In this example the share is set up to allow all authenticated users ( non-guests ) access with write permissions but Linux permissions have been set up to allow write to only one of them.

  3. #3
    Join Date
    Jun 2013
    Beans
    27

    Re: Help to set access rights to share folders in SAMBA

    Hi Morbius1,
    Address please... for the Christmas card! THANK YOU SO MUCH.

    Re the "ballet" as you describe it, what I was trying to achieve is not so out of the ordinary (I would have thought!) so did I miss a good step by step process somewhere on the web to achieve this? In other words did I need to set up users, pwds and smbpwds as I did? I assume yes.

    Thanks again! Champion!

    M

  4. #4
    Join Date
    Dec 2009
    Beans
    6,772

    Re: Help to set access rights to share folders in SAMBA

    Quote Originally Posted by MarcusL View Post
    Hi Morbius1,
    Address please... for the Christmas card! THANK YOU SO MUCH.

    Re the "ballet" as you describe it, what I was trying to achieve is not so out of the ordinary (I would have thought!) so did I miss a good step by step process somewhere on the web to achieve this? In other words did I need to set up users, pwds and smbpwds as I did? I assume yes.

    Thanks again! Champion!

    M
    You still needed to set up users and then add them to the samba password database.

    I think the problem was the original HowTo you were using. There is only one HowTo in the known universe that tells its reader to set ownership to nobody:nogroup and it's this one: https://help.ubuntu.com/12.04/server...ileserver.html

    There's a strange convoluted logic to it and it will in fact work but it sets up a Samba File Server with a guest accessible share that will break the moment you create a private share or ( if the clients are Windows ) the moment you add a samba user matching the Windows user.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •