Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Samba, public and private shares

  1. #11
    Join Date
    Dec 2009
    Beans
    5,387

    Re: Samba, public and private shares

    You have 2 options:

    [1] Change permissions on the directories themselves to allow everyone access and then use Samba to control who has access:
    Code:
    sudo chmod 0777 /srv/samba/share
    sudo chmod 0777 /srv/samba/private
    [2] This is more compliated but change the share definitions, permissions, and group membership:

    Change the [share] to this:
    [share]
    comment = backup share
    path = /srv/samba/share
    read only = No
    create mask = 0755
    guest ok = Yes
    force user = nobody
    Change [private] to this:
    [PRIVATE]
    path = /srv/samba/private
    guest ok = no
    read only = no
    force group = plugdev
    Change ownership to this:
    Code:
    sudo chown :plugdev /srv/samba/private
    Change permissions to this:
    Code:
     sudo chmod 0775 /srv/samba/private
    And then add your remote user to the plugdev group:
    Code:
    sudo gpasswd -a morbius plugdev
    You will have to logout and back again for the group membership to take affect.
    Last edited by Morbius1; January 30th, 2013 at 07:05 PM.

  2. #12
    Join Date
    Jan 2013
    Beans
    6

    Re: Samba, public and private shares

    Morbius1

    I did your second suggestion and was able to get permission to write to the public share after entering username and password for the private share, but still do not have write permission to the private share.

    Code:
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[share]"
    Processing section "[backup]"
    Processing section "[private]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
        workgroup = ALB_GROUP
        server string = %h server (Samba, Ubuntu)
        map to guest = Bad User
        obey pam restrictions = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        username map = /etc/samba/smbusers
        unix password sync = Yes
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        dns proxy = No
        usershare allow guests = Yes
        panic action = /usr/share/samba/panic-action %d
        idmap config * : backend = tdb
    
    [printers]
        comment = All Printers
        path = /var/spool/samba
        create mask = 0700
        printable = Yes
        print ok = Yes
        browseable = No
    
    [print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
    
    [share]
        comment = backup share
        path = /srv/samba/share
        force user = nobody
        read only = No
        create mask = 0755
        guest ok = Yes
    
    [backup]
        comment = backup dir
        path = /home/misty/backup
        valid users = misty
        read only = No
        create mask = 0755
    
    [private]
        path = /srv/samba/private
        valid users = misty
        force group = plugdev
        read only = No
    Code:
    total 16
    drwxr-xr-x 4 root   root    4096 Jan 30 08:36 .
    drwxr-xr-x 3 root   root    4096 Jan 24 13:44 ..
    drwxr-xr-x 2 root   plugdev 4096 Jan 30 08:36 private
    drwxr-xr-x 2 nobody nogroup 4096 Jan 31 08:21 share

  3. #13
    Join Date
    Dec 2009
    Beans
    5,387

    Re: Samba, public and private shares

    but still do not have write permission to the private share.
    You missed a step. Assuming "misty" is a member of the plugdev group your folder still doesn't allow a write to that group:

    drwxr-xr-x 2 root plugdev 4096 Jan 30 08:36 private
    Change it:
    Code:
    sudo chmod 0775 /srv/samba/private
    Another Alternative: If the only user that you want to grant access to the share is misty then change ownership of the folder to misty:
    Code:
    sudo chown misty:plugdev /srv/samba/private

  4. #14
    Join Date
    Jan 2013
    Beans
    6

    Re: Samba, public and private shares

    Morbius1

    That worked perfectly. You really know your stuff.

    I can't thank you enough for the help you have given me.

Page 2 of 2 FirstFirst 12

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
  •