Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

\\\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

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

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. – PersianGulf Aug 23 '12 at 16:07
smb client on linux machines – PersianGulf Aug 23 '12 at 16:13
Thanks! I'll take a look. – Mike Wills Aug 23 '12 at 16:20
smbfs is rubbish; use CIFS whenever you need to access Windows shares. – Mel Boyce Jun 22 '13 at 15:54

Your Answer


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.