2

I am having a Samba share on a bananapi. On the pi I have created the user samba. Since the shares are also shared by owncloud, I have added samba to the group www-data.

If I am using Nautilus with the command smb://samba@cavalorn/data/ everything works just fine. I can read, write and navigate in every folder.

Then I want to add the shares to the fstab. I did this by adding the following line to the file:

//cavalorn/data /media/data cifs credentials=/home/daniel/.smbcredentials,iocharset=utf8,sec=ntlm,file_mode=0770,dir_mode=0770 0 0

With correct credentials in the referenced .smbcredentials file.

If I am using mount -a no error if thrown and the folder appears in the launcher. But I am not able to read or write any data.

Why can Nautilus do it, but mount somehow broke. Doesn't mount try to use samba as a user?

PS: I am using Ubuntu 15.10.

  • Since I want to mount the shares automatically... – Daniel Hitzel Mar 20 '16 at 12:37
  • 2
    I'm not an expert but I mount samba shares in fstab and they work. My fstab line differs from yours in that I have permissions set to 0777 instead of 0770, and I have uid=myusername,gid=myusername in the line as well. I am not sure what these differences mean, only that they work for me. – Organic Marble Mar 20 '16 at 12:44
  • I noticed that at my mount point the folders are listed as root:root, where it actually should be www-data:www-data – Daniel Hitzel Mar 20 '16 at 13:12
  • That could be a factor too. The mount points I use for the samba shares are listed as myusername:myusername whereas the mount points for my internal drives are root:root They all have the same permissions though, drwxrwxrwx – Organic Marble Mar 20 '16 at 13:16
  • 1
    Thanks using uid and gid solved it. At first I tried to use the uid and gid of the remote machine, but I have to use the ids of my local machine! – Daniel Hitzel Mar 20 '16 at 14:41
2

As @Organic Marble mentioned in the comments, the problem was, that the folder was mounted with root:root, so my user could not read or write it. Using uid and gid in my fstab mounted it as daniel:daniel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.