Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    [SOLVED] Samba changing ownership to root

    I'm currently using Samba for my first time, so apologies in advance for being a noob.

    I've set up a client and server VM. On the server, I've created a share as follows:

    comment = test
    path = /myshare
    public = yes
    writable = yes
    printable = no

    In my client fstab, I have the following:

    //<IP>/myshare /mnt/mount3 smbfs username=testuser,password=testuser 0 0

    testuser is properly set up on the server via smbpasswd.

    The mount actually works, but it shows that root owns the files in the share even though they're really owned by testuser on the server (owner and group are both root). testuser exists on both the client and the server.

    I've chgrp -R's and chown-R'd the share on the server to be owned by testuser and it reflects it correctly but on the client side, root owns both the folder and all of the files inside. Also, the share on the server has full permissions for everybody so it's not the source of the issue.

    Strangely enough, the correct file permissions seem to be preserved by Samba as I verified through various testing methods.

    I'm just wondering why the correct owner would not be displayed and if there are any other sources that could possibly cause this other than the fstab and the smb.conf file.

    Thanks in advance.

  2. #2
    Just Joined!
    Join Date
    Oct 2008
    Tel Aviv,Israel
    Do you have create mask in your smb.conf?

  3. #3
    Thanks for the tip.

    That wasn't the issue - it turns out that when root mounts things out of fstab on startup, it sort of grabs the ownership so I was able to fix it by adding the uid and gid parameters in the fstab file.

  4. $spacer_open

Posting Permissions

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