Results 1 to 8 of 8

Thread: openSUSE does not retain folder share setting for SAMBA (and other SAMBA stories)

  1. #1

    Default openSUSE does not retain folder share setting for SAMBA (and other SAMBA stories)

    Hi

    Some time ago I started making plans to create a home server and asked for some general advice (https://forums.opensuse.org/showthre...ce-for-my-SOHO). Well, I'm now getting round to doing it and falling into the inevitable problems, so I'm seeking advice.

    Problem number one is to do with Samba. I created an LVM partition with a permanent mount point on my openSUSE 13.1 installation. I've configured Samba (i.e. configured Samba server under YaST with workgroup name, not DC controller, NetBios hostname, created file share with guest access and not reed only, and opened port in firewall). The result is that I am able to see and view the folder from the other PCs on the network (both Windows 7), but not edit it.

    From Dolphin I've changed the properties to share with Samba, set name, allow guests, and set 'Everyone' to 'Full Control'... and this is where it's going wrong. I can hit save, but the settings are not retained (when I next go in, the 'Everyone' 'Full Control' setting is lost and the other PCs are still unable to edit the folder).

    Suggestions?

    Also, what I'm attempting above is a simple proof of concept. I'd really like to apply stricter security, such that only specified users or PCs can access the file share (there will be only three users). There's so much documentation on Samba that it's confusing rather than helping me, especially in the command line / config files vs. GUI situations (I'd prefer to magage it via GUI, but I can cope with command lines and editing config files).

    Again, suggestions for resources to look at / approaches?

    Thanks

    Stuart

  2. #2
    Join Date
    Nov 2009
    Location
    ND, USA
    Posts
    1,131

    Default Re: openSUSE does not retain folder share setting for SAMBA (andother SAMBA stories)

    On 3/25/2014 6:36 AM, phual wrote:
    >
    > Hi
    >
    > Some time ago I started making plans to create a home server and asked
    > for some general advice (http://tinyurl.com/my3gq6z). Well, I'm now
    > getting round to doing it and falling into the inevitable problems, so
    > I'm seeking advice.
    >
    > Problem number one is to do with Samba. I created an LVM partition with
    > a permanent mount point on my openSUSE 13.1 installation. I've
    > configured Samba (i.e. configured Samba server under YaST with workgroup
    > name, not DC controller, NetBios hostname, created file share with guest
    > access and not reed only, and opened port in firewall). The result is
    > that I am able to see and view the folder from the other PCs on the
    > network (both Windows 7), but not edit it.
    >
    > From Dolphin I've changed the properties to share with Samba, set name,
    > allow guests, and set 'Everyone' to 'Full Control'... and this is where
    > it's going wrong. I can hit save, but the settings are not retained
    > (when I next go in, the 'Everyone' 'Full Control' setting is lost and
    > the other PCs are still unable to edit the folder).
    >
    > Suggestions?
    >
    > Also, what I'm attempting above is a simple proof of concept. I'd really
    > like to apply stricter security, such that only specified users or PCs
    > can access the file share (there will be only three users). There's so
    > much documentation on Samba that it's confusing rather than helping me,
    > especially in the command line / config files vs. GUI situations (I'd
    > prefer to magage it via GUI, but I can cope with command lines and
    > editing config files).
    >
    > Again, suggestions for resources to look at / approaches?
    >
    > Thanks
    >
    > Stuart
    >
    >

    Stuart;

    What version of openSUSE?
    Is Apparmor running? There is a recent post that AppArmor can interfere with share access

    What are the permissions on the share:

    Code:
    ls -ld <path to share>


    --
    P.V.
    "We're all in this together, I'm pulling for you" Red Green

  3. #3
    Join Date
    Nov 2009
    Location
    ND, USA
    Posts
    1,131

    Default Re: openSUSE does not retain folder share setting for SAMBA (andother SAMBA stories)

    On 3/25/2014 10:00 PM, PV wrote:
    > Is Apparmor running? There is a recent post that AppArmor can interfere with share access


    See: http://forums.opensuse.org/showthrea...e-from-windows

    --
    P.V.
    "We're all in this together, I'm pulling for you" Red Green

  4. #4

    Default Re: openSUSE does not retain folder share setting for SAMBA (andother SAMBA stories)

    Quote Originally Posted by venzkep View Post
    Stuart;

    What version of openSUSE?
    Is Apparmor running? There is a recent post that AppArmor can interfere with share access

    What are the permissions on the share:

    Code:
    ls -ld <path to share>
    Hi venzkep

    I'm running openSUSE 13.1 under KDE 4. Apparmor is indeed running, though I've tried turning it off to no avail.

    The permissions are as follows:
    Code:
    drwxr-xr-x 3 myusername users 4096 Mar 24 15:33 /FileServer
    Thanks for the link (my problem was so generic I had no luck searching for an existing post). I'm working through some of the suggestions, but have so far found that:
    1. If I create a new (Linux) user and give them Samba access (
      Code:
      smbpasswd -a username
      ), then they can read and write their home directory via Windows 7, but only read /FileServer.
    2. Disabling (and restarting) AppArmor makes no difference.
    3. Adding /FileServer to /usr/sbin/smbd under AppArmor with rw permissions makes no difference.


    Stuart

  5. #5
    Join Date
    Sep 2012
    Location
    Canada
    Posts
    112

    Default Re: openSUSE does not retain folder share setting for SAMBA (and other SAMBA stories)

    Hi phual,

    Quote Originally Posted by phual
    [...]

    The permissions are as follows:
    Code:
    drwxr-xr-x 3 myusername users 4096 Mar 24 15:33 /FileServer
    According to the permissions of the share, only the user mysusername have read, write and execute rights. The members of the group users and the other users only have read and execute rights.

    By default, the Samba guest account is mapped to the user nobody with nobody primary group. In consequence, Samba guests would only be able to read and execute the files on the share. This is confirmed by what you described next:

    Quote Originally Posted by phual
    [...]

    If I create a new (Linux) user and give them Samba access (
    Code:

    smbpasswd -a username

    ), then they can read and write their home directory via Windows 7, but only read /FileServer.
    Users' have read, write and execute rights to their home directory (hopefully). This is why when you added a user to the Samba user database using smbpasswd and connected to your Samba server with this Samba user's credentials you could read, write and execute files in his home share. Why you couldn't write to your share /FileServer may was because the Samba user wasn't the same as the owner of the share or because the share has the parameter guest only = yes.

    In either case, a quick and dirty solution to your issue would be to add write and execute rights to everyone on /FileServer:

    Code:
    # chmod -R ugo=rwx /FileServer
    You could also change the ownership of the share so Samba guests own it:
    Code:
    # chown -R nobody:nobody /FileServer
    Kalten

  6. #6
    Join Date
    Nov 2009
    Location
    ND, USA
    Posts
    1,131

    Default Re: openSUSE does not retain folder share setting for SAMBA (andother SAMBA stories)

    On 3/26/2014 8:36 PM, kalten wrote:
    >
    > Hi phual,
    >
    > phual Wrote:
    >>
    >> [...]
    >>
    >> The permissions are as follows:
    >>>

    > Code:
    > --------------------
    > > >

    > > drwxr-xr-x 3 myusername users 4096 Mar 24 15:33 /FileServer
    > >

    > --------------------
    >>>

    >>

    >
    > According to the permissions of the share, only the user mysusername
    > have read, write and execute rights. The members of the group users and
    > the other users only have read and execute rights.
    >
    > By default, the Samba guest account is mapped to the user nobody with
    > nobody primary group. In consequence, Samba guests would only be able to
    > read and execute the files on the share. This is confirmed by what you
    > described next:
    >
    > phual Wrote:
    >>
    >> [...]
    >>
    >> If I create a new (Linux) user and give them Samba access (
    >> Code:
    >>
    >> smbpasswd -a username
    >>
    >> ), then they can read and write their home directory via Windows 7, but
    >> only read /FileServer.
    >>

    >
    > Users' have read, write and execute rights to their home directory
    > (hopefully). This is why when you added a user to the Samba user
    > database using smbpasswd and connected to your Samba server with this
    > Samba user's credentials you could read, write and execute files in his
    > home share. Why you couldn't write to your share /FileServer may was
    > because the Samba user wasn't the same as the owner of the share or
    > because the share has the parameter guest only = yes.
    >
    > In either case, a quick and dirty solution to your issue would be to add
    > write and execute rights to everyone on /FileServer:
    >
    >
    > Code:
    > --------------------
    >
    > # chmod -R ugo=rwx /FileServer
    >
    > --------------------
    >
    >
    > You could also change the ownership of the share so Samba guests own it:
    >
    > Code:
    > --------------------
    >
    > # chown -R nobody:nobody /FileServer
    >
    > --------------------
    >
    >

    phual;

    If the suggestions made by kalten do not fix your problem, please post the contents of /etc/samba/smb.conf.

    --
    P.V.
    "We're all in this together, I'm pulling for you" Red Green

  7. #7

    Default Re: openSUSE does not retain folder share setting for SAMBA (andother SAMBA stories)

    Thanks for the responses.

    After another issue that diverted me for a while, I was able to confirm that the issue was (as kalten said) as simple as not setting the folder permissions in Linux (nothing to do with Samba at all). After changing the permissions as follows, it worked fine:

    • Owner: can view and modify
    • Group: can view and modify
    • Others: forbidden
    • Ownership - user: myusername
    • Ownership - group: users


    For the assistance of those who may follow (for what use it might be), this was my whole process to have a (semi-) secure samba network. My starting point was a partition formatted as LVM and mounted to /FileServer.



    1. In YaST, choose Samba Server
      1. Workgroup = 'SomeWorkGroupName'
      2. Not a domain controller
      3. NetBios hostname = 'NameYouWantForServer'
      4. Start during boot
      5. Open port in firewall
      6. Create /FileServer as a file share (don't need to change default settings)
      7. Disable all other file shares (not necessary for my needs, though other may want them)
      8. Okay

    2. Change permissions on the FileServer folder so that the owning user is not root and owning group is 'users'.
    3. Create new users:
      1. YaST, user and group management, create new Linux users
      2. From command line (as root), add these users to Samba (smbpasswd -a username)



    That was it!

    Thanks all. Now onto my next problem (of what may be many).

    Stuart

  8. #8
    Join Date
    Sep 2012
    Location
    Canada
    Posts
    112

    Default Re: openSUSE does not retain folder share setting for SAMBA (andother SAMBA stories)

    Quote Originally Posted by phual View Post
    [...]

    Thanks all. Now onto my next problem (of what may be many).

    Stuart
    Thanks for the feedback and the summary.

    Have a lot of fun with openSUSE!
    Kalten

Posting Permissions

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