Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Samba Shares for Windows

  1. #1
    Join Date
    Mar 2020
    Location
    Essex, United Kingdom
    Posts
    26

    Angry Samba Shares for Windows

    Hi All,

    I have tried in vain to sort this myself but have now got into a BIG mess (why does it have to be so **** hard ?).

    On my machine I have the following partition setup

    File System: NTFS
    Mount Point: /tmp/Folly_Data
    Mount By: Volume Label
    Label: Folly_Data
    UUID: 26E71D7E25588

    This is mounted, I have configured smb.conf with the following

    [global]
    workgroup = Folly.Office
    netbios name = Folly_Data
    server string = ""
    local master = yes
    os level = 65
    passdb backend = tdbsam
    printing = cups
    printcap name = cups
    printcap cache time = 750
    cups options = raw
    map to guest = Bad User
    usershare allow guests = No
    ldap admin dn =
    wins server =
    wins support = No

    [Folly_Data]
    available = Yes
    browseable = Yes
    inherit acls = No
    path = /tmp/Folly_Data
    read only = No
    guest ok = Yes

    and restarted smb.service/nmb.service

    I can see the share from my Windows machine but have no permission to write to it (Permission Denied), I have tried

    sudo chmod -R 777 /tmp/Folly_Data
    sudo chown -R "myusername /tmp/Folly_Data

    This hasn't worked , Dolphin still shows the owner and group as root (I am guessing that this is what my problem is but dont really know)

    Can someone point me in the right direction please ? - Sensible answers please

    Regards

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,451

    Default Re: Samba Shares for Windows

    NTFS is a non-Linux file system type. It has no ownership, nor permission bits. To make it (more or less) usable inside Linux, user/owner and permission bits are faked. These fakes are decided at mount. I am not sure how you mount this one, when it is using an /etc/fsatb entry, then better post it. In
    Code:
    man mount
    you can find how to use mount options to set another users:group then the default and same for permissions.

    But why do you use an NTFS file system? As I see it you are not using it for direct access by a MS Windows system (in multi-boot).

    I do not know much about Samba (no MS systems in the house), but I think with a Samba server you can share data from a Linux system and data on a Linux system is normally stored on a Linux file system.

    ==========

    I see you are rather new here. Welcome and the following message:

    There is an important, but not easy to find feature on the forums.

    Please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

    An example is here: Using CODE tags Around your paste.
    Last edited by hcvv; 06-Apr-2021 at 12:51.
    Henk van Velden

  3. #3
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    22,861
    Blog Entries
    1

    Default Re: Samba Shares for Windows

    Quote Originally Posted by hcvv View Post
    NTFS is a non-Linux file system type. It has no ownership, nor permission bits. To make it (more or less) usable inside Linux, user/owner and permission bits are faked.
    Good catch Henk. I didn't even notice that while reading the reported issue.


    That notwithstanding, here's a few of practical samba guides...
    https://websiteforstudents.com/lesso...-10-via-samba/
    https://www.swerdna.net.au/linhowtosambacifs.html
    https://wiki.samba.org/index.php/Set...ndalone_Server
    openSUSE Leap 15.2; KDE Plasma 5

  4. #4
    Join Date
    Jun 2011
    Location
    Germany
    Posts
    295

    Default Re: Samba Shares for Windows

    Ah, I haven't seen this new thread when replying here:
    https://forums.opensuse.org/showthread.php/552377-Disk-Partitioning-Question?p=3019358#post3019358
    In a nutshell, no need to use NTFS.

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,451

    Default Re: Samba Shares for Windows

    Seeing the other thread I guess the OP mises some basic understanding about the one directory tree of Unix/Linux, how to build it with mounting file systems (and what is mounting) on one side and what is exactly exporting (to other Unix/linux systems) or sharing (to non-Linux systems) of parts of that directory tree.

    It may also be that he did not adhere enough to the rule: When going to Linux, forget everything you learned about Windows.

    I have some written some basic material about this, but it is all in Dutch and i assume there is enough about this in English to be found.
    Henk van Velden

  6. #6
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,056

    Default Re: Samba Shares for Windows

    Quote Originally Posted by GOKIWI View Post
    I can see the share from my Windows machine but have no permission to write to it (Permission Denied),
    You need to map the user on the Windows machine to a suitable user on the Linux machine – possibly the one who owns the Samba Share or, a user who is a member of the Samba Share user group – with “write” permissions on the shared directory.

  7. #7
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    22,861
    Blog Entries
    1

    Default Re: Samba Shares for Windows

    Quote Originally Posted by dcurtisfra View Post
    You need to map the user on the Windows machine to a suitable user on the Linux machine – possibly the one who owns the Samba Share or, a user who is a member of the Samba Share user group – with “write” permissions on the shared directory.
    While this is true, there is additional consideration needed when sharing an NTFS filesystem via samba as Henk already mentioned. This is really the cause of the issue the OP has run into. Various mount options (including umask, fmask, dmask), can be employed to essentially emulate the ownership as required. Some info on this...


    https://wiki.archlinux.org/index.php/NTFS-3G

    Code:
    man mount.ntfs-3g
    openSUSE Leap 15.2; KDE Plasma 5

  8. #8
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,056

    Cool Re: Samba Shares for Windows

    Quote Originally Posted by GOKIWI View Post
    Dolphin still shows the owner and group as root
    Please, please, please, never, ever, consider setting up a Samba Share where the owner of the exported directory which shall be writeable by the clients on the network, is the Linux (or UNIX®) user “root” – you'll have to map the users on the clients to the Linux (system) user “root” – which is something that Samba doesn't allow anyway …


    • My personal preference is, to create sub-directories below the Linux system's top level directories – which are usually owned by “root” …
    • The owners of the sub-directories, which are exported either as Samba Shares or NFS exports, are non-system (UID > 499 – GID > 999) pseudo-users – no login (the login shell is ‘/usr/sbin/nologin’), the home directory is the directory to be exported and, the password is locked and doesn't exist …
    • The (writeable by the network clients) user directories included either in the Samba Share or, the NFS export, are owned by the Linux users who wish have their directories written by network clients …

    It comes down to the UNIX® and Linux system philosophy that, the entire system shall not be visible to the network.


    • The Redmond folks needed quite some time before, they also realised that, the idea is a sensible one …

  9. #9
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    22,861
    Blog Entries
    1

    Default Re: Samba Shares for Windows

    Quote Originally Posted by dcurtisfra View Post
    Please, please, please, never, ever, consider setting up a Samba Share where the owner of the exported directory which shall be writeable by the clients on the network, is the Linux (or UNIX®) user “root” – you'll have to map the users on the clients to the Linux (system) user “root” – which is something that Samba doesn't allow anyway …
    If you care to re-read the GOKIWI's opening post, you'll see that was not their intention. However the chmod and chown commands failed because NTFS does not support *nix permissions. They need to be emulated (or faked if you will) as already described. Best not to use that file system for sharing in a samba context.
    openSUSE Leap 15.2; KDE Plasma 5

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    28,451

    Default Re: Samba Shares for Windows

    Like @deano_ferrari already explained, the problem reported is due to using a non-Linux file system on Linux.
    I see no use for a non-Linux file sytem here at all, the more because the OP has not explained why he uses an NTFS file system.

    Until now this is not a Samba question/problem at all. As soon as it becomes one, I will quit from the thread due to lack of my knowledge about the finery of Samba serving.
    Henk van Velden

Page 1 of 2 12 LastLast

Posting Permissions

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