Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ří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 ří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 ří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

share|improve this question
    
Just a note: username=<usrname> password=<passwd> _netdev shouldn't use spaces but commas. –  Braiam Nov 12 '13 at 21:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.