Page 1 of 1

Permissions for samba share

Posted: 09 Feb 2010, 19:15
by gandi
Hello,

I'd like to mount my Bubba|Two on my Laptop (which runs Ubuntu 9.10). This works fine, but when I copy files from the laptop to Bubba the file permissions are screwed up.

Here's the corresponding line in my /etc/fstab:

Code: Select all

//192.168.1.100/home /mnt/bubba cifs credentials=/home/gandi/.smbcredentials,uid=gandi,gid=gandi 0 0
The user 'gandi' exists on both laptop and Bubba.

When I copy a simple text file from my laptop to Bubba, via

Code: Select all

cp -a file.txt /mnt/bubba/gandi/
for some reason its permissions are changed from -rw-r--r-- to -rwxrwxrwx.

Any help / suggestions how I can keep the correct permissions are appreciated!

Re: Permissions for samba share

Posted: 10 Feb 2010, 07:05
by RandomUsername
I had a similar problem.

Have a look here http://forum.excito.net/viewtopic.php?f ... 98&start=0

Basically, try adding wither "nodfs" or "nounix" to your fstab line. The first one worked for me.

[EDIT]Also, I no longer mount my shares with fstab. Instead I use this method - http://ubuntuforums.org/showthread.php?t=1186877
It has the advantage that your credentials are encrypted with the Gnome keyring.

Re: Permissions for samba share

Posted: 21 Feb 2010, 20:13
by gandi
RandomUsername wrote:I had a similar problem.
Basically, try adding wither "nodfs" or "nounix" to your fstab line. The first one worked for me.
Thanks, 'nodfs' worked for me too! At least my own user permissions are kept now, not necessarily the group permissions though. A

Code: Select all

cp -a <source-file> /mnt/bubba/gandi/
still gives me a 'permission denied'. Could that be related to the fact that my bubba user has another primary group?
RandomUsername wrote: [EDIT]Also, I no longer mount my shares with fstab. Instead I use this method - http://ubuntuforums.org/showthread.php?t=1186877
It has the advantage that your credentials are encrypted with the Gnome keyring.
This doesn't seem to keep the permissions intact though.

Re: Permissions for samba share

Posted: 22 Feb 2010, 07:34
by RandomUsername
Permissions for samba shares are controlled by /etc/samba/smb.conf. You'll probably need to make some adjustments to that.

I pasted mine here: http://forum.excito.net/viewtopic.php?f ... rt=0#p9394

The man page for smb.conf is very extensive. You should be able to tweak it to your satisfaction.