Samba new file ownership, permissions configuration

Posted by Martin Melka on Ask Ubuntu See other posts from Ask Ubuntu or by Martin Melka
Published on 2013-11-12T21:21:12Z Indexed on 2013/11/12 22:03 UTC
Read the original article Hit count: 297

Filed under:
|
|

I have recently installed Samba on my server. Now I have a question about permissions and how to set it up. Currently I mount the Samba shared drive to my laptop with this line in /etc/fstab:

//<host>/share /mnt/melka-server-data/ cifs username=<usrname> password=<passwd> _netdev 0 0

This works, as I can read from the files and create them (as root). The problem is when I want to create files as a regular user. I always get a Permission Denied error.

These are ll outputs of the mounted folder:

magicmaster@magicmaster-kubuntu:/mnt$ ll
total 8
drwxr-xr-x  3 root        root        4096 lis 11 14:15 ./
drwxr-xr-x 26 root        root        4096 ríj 26 11:01 ../
drwxrwxrwx  8 magicmaster magicmaster    0 lis 12 22:12 melka-server-data/

and the inside:

magicmaster@magicmaster-kubuntu:/mnt/melka-server-data$ ll
total 4
drwxrwxrwx  8 magicmaster magicmaster    0 lis 12 22:12 ./
drwxr-xr-x  3 root        root        4096 lis 11 14:15 ../
drwxrwxrwx  5 magicmaster magicmaster    0 lis 12 09:35 downloads/
drwxrwxrwx  2 magicmaster magicmaster    0 ríj 28 12:57 lost+found/
drwxrwxrwx 15 magicmaster magicmaster    0 lis 12 09:45 movies/
drwxrwxrwx  2 magicmaster magicmaster    0 lis  1 21:15 newest/
drwxrwxrwx  3 magicmaster magicmaster    0 lis  2 23:14 photos/
drwxrwxrwx  2 magicmaster magicmaster    0 ríj 30 12:44 software/
-rw-r--r--  1 nobody      nogroup        0 lis 12 22:12 zdar

I called sudo chown -R magicmaster:magicmaster melka-server-data/ to try and change all the files to belong to me. Then the file zdar was created by magicmaster just by calling touch. I got the Permission Denied, but it was still created, though it belongs to nobody and I can't write into it.

When I create a file as root, it still belongs to nobody, but at least I can write into it.

What am I missing? I didn't notice anything in Samba config that would be related to this and I don't like the idea of having to log on as root in order to copy files..

Thanks

© Ask Ubuntu or respective owner

Related posts about server

Related posts about permissions