Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Following this guide I was able to get my Samba share to mount on my Ubuntu 12.04 system. I can navigate the folders just fine. However I cannot create a directory nor create a file. I get the following error:

mkdir: cannot create directory `ServerBackups': Permission denied

Looking at the directory permissions, I see

drwxr-xr-x  1 root root    0 Aug 14 22:34 stora

I have tried to change that to root:sambashare with no errors with sudo chown :sambashare stora/, however when I confirm it completed, it is back to root:root. This is what I added to my /etc/fstab:

\\10.0.1.20\mylibrary   /media/stora    cifs    credentials=/etc/samba/user,noexec  0       0

Mounting the drive works fine. I want a regular user (primarily me) to be able to write to this mount.

What could I be missing?

share|improve this question
add comment

2 Answers 2

Do you add these onyou share section?

writeable = yes #important
read only = no
browseable = yes
locking = no
###create mask is very important :
create mask = 0666
guest ok = yes #important if you have user set no

Then umount you smb directory and chown to your samba user.Of course, at first add your samba user to /etc/passwd.

share|improve this answer
    
The server side is a NetGear Stora. I can read/write just fine on my Mac. It is on the Ubuntu computer I am having issues when connecting to the Stora. –  Mike Wills Aug 23 '12 at 15:44
    
You should mount smbfs not cifs. –  Mohsen Pahlevanzadeh Aug 23 '12 at 16:07
    
    
Thanks! I'll take a look. –  Mike Wills Aug 23 '12 at 16:20
1  
smbfs is rubbish; use CIFS whenever you need to access Windows shares. –  Mel Boyce Jun 22 '13 at 15:54
show 2 more comments

Assuming the user in the credentials file has read/write access, try this as a test:

mount.cifs //server/share/name /mnt/somewhere -o user=username,file_mode=0664,dir_mode=0775

If that works, add the file_mode and dir_mode options to your fstab. There might be other options which interest you in the manpage: man 8 mount.cifs.

Edit: oh, and don't mess around with non-native filesystem perms or ownership - your mounter should always be responsible for setting the owner:group and permissions.

share|improve this answer
add comment

Your Answer

 
discard

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

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