Results 1 to 6 of 6

Thread: Help please to mount smaba share with write access for a specific user

  1. #1
    Join Date
    Jan 2016
    Location
    UK
    Posts
    579

    Default Help please to mount smaba share with write access for a specific user

    Running Tumbleweed KDE. I used to use SMB4K for managing mounting and unmounting my Samba shares but now it does not work because of the changes in Samba. So I've been trying to use mount.cifs to mount a share and get it to be owned by my user with write access. However everything I've tried will only mount it with root access. Also when unmounting it removes the directory used which I also do not want. I've tried adding options of user uid and gid but to no avail, the mounted share always ends up as root,root permissions. I do not want to have any of the shares mount at boot time as some of them will not be on the lan as they are on laptops etc which are not powered on all the time. I should point out the share can be accessed using the smb:// protocol in Dolphin but for what I need I have to have it mounted at a specific mount point.

    So can someone please point me in the right direction for a command which will mount a share with write access for a specific user and keep the used directory when unmounting the share?

    Stuart

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,972
    Blog Entries
    14

    Default Re: Help please to mount smaba share with write access for a specific user

    You can easily do that from Dolphin - Locations - Network - Add networkconnection. AFAIK
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3
    Join Date
    Jan 2016
    Location
    UK
    Posts
    579

    Default Re: Help please to mount smaba share with write access for a specific user

    I dont see that option, I do have Add Network Folder but that does not have an option for Samba shares. I'd really like a simple command line command to mount the share as I need it with write access.

    Stuart

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,539
    Blog Entries
    1

    Default Re: Help please to mount smaba share with write access for a specific user

    Quote Originally Posted by broadstairs View Post
    Running Tumbleweed KDE. I used to use SMB4K for managing mounting and unmounting my Samba shares but now it does not work because of the changes in Samba. So I've been trying to use mount.cifs to mount a share and get it to be owned by my user with write access. However everything I've tried will only mount it with root access. Also when unmounting it removes the directory used which I also do not want. I've tried adding options of user uid and gid but to no avail, the mounted share always ends up as root,root permissions. I do not want to have any of the shares mount at boot time as some of them will not be on the lan as they are on laptops etc which are not powered on all the time.
    On demand mounting can be facilitated with an entry in /etc/fstab and the appropriate options 'noauto' and 'x-systemd.automount' as described in these useful references...

    https://wiki.archlinux.org/index.php...t_with_systemd
    https://www.freedesktop.org/software...automount.html
    https://www.freedesktop.org/software...md.mount.html#

    I should point out the share can be accessed using the smb:// protocol in Dolphin but for what I need I have to have it mounted at a specific mount point.
    The dolphin 'smb-kio' does not mount samba shares as such. It uses libsmbclient to communicate with samba servers to access and manipulate files in an 'ftp-like' manner. So, if an application needs direct access to a mounted share it is not an option.

    https://www.samba.org/samba/docs/cur...bclient.7.html

    So can someone please point me in the right direction for a command which will mount a share with write access for a specific user and keep the used directory when unmounting the share?

    Stuart
    Can you explain a bit more about the shares you would like to mount? The OS are they hosted may be relevant here, (as that can impact on the samba protocol version and authentication protocols required.)

    https://michlstechblog.info/blog/sys...r-cifs-shares/
    openSUSE Leap 15.1; KDE Plasma 5

  5. #5
    Join Date
    Jan 2016
    Location
    UK
    Posts
    579

    Default Re: Help please to mount smaba share with write access for a specific user

    The shares are a mixture of Windows 7 and Linux, specifically Tumbleweed and Leap on laptops.

    Stuart

  6. #6
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,539
    Blog Entries
    1

    Default Re: Help please to mount smaba share with write access for a specific user

    Quote Originally Posted by broadstairs View Post
    The shares are a mixture of Windows 7 and Linux, specifically Tumbleweed and Leap on laptops.

    Stuart
    Something like the following...
    Code:
    //server/share /path_to/mount cifs noauto,x-systemd.automount,x-systemd.device timeout=30,_netdev,guest,uid=client_user,gid=users 0 0
    and if authentication required...
    Code:
    //server/share /path_to/mount cifs noauto,x-systemd.automount,x-systemd.device timeout=30,_netdev,username=server_user,password=secret,_netdev,uid=client_user,gid=users 0 0
    https://wiki.archlinux.org/index.php/fstab


    From swerdna's samba guide the following information is pertinent regarding Windows shares and Linux samba shares....

    Permanent Mounts: Prescribing the owner of the mount on the client

    So far, these commands haven’t specified an owner for the mount. If the client maps a Windows share-level share, the mount on the client will automagically assume permissions drwxrwxrwx and the ownership will stay with the Linux owner of the directory mount_point. If the client maps a Linux share the mount will automagically assume the permissions on the share on the server and will automagically switch ownership to match the owner on the server (which can be tricky if the owner on the Linux server doesn’t exist on the client).
    You can control this by specifying a new owner in the line/mount that you put in fstab. This owner is a Linux user on the client (who might not be a user on the server, that doesn’t matter), e.g. client_user. You can specify the group too, e.g. users. The line in fstab is now like this for a guest-accessible share:
    openSUSE Leap 15.1; KDE Plasma 5

Posting Permissions

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