Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Samba (Cannot Write) issue

I have setup Samba between two linux boxes (Ubuntu Desktop 12.10 and Ubuntu Server 12.04). For some reason I cannot write to my samba share. To me it looks like I have the correct permissions. Below is my smb.conf, the filesystem permissions, and the steps I followed. I definitely have it misconfigured but I cannot find out how. Any help would be appreciated. Craig

  1. Created a user in ubuntu server (craig)
  2. Created a user and password in samba "smbuseradd -a craig" set the password
  3. Mounted the samba share from linux desktop. This seemed to mount just fine
  4. Attempted to write a file and it says that I don't have write permissions

Permissions on the server when viewed from the server "drwxrwxrwx 4 Craig Craig" Permissions when viewed from ubuntu desktop "drwxr-xr-x 0 root root"

[global]
follow symlinks = yes
wide links = yes
unix extensions = no

workgroup = Ubuntu Precise
security = user

unix password sync = yes

[homes]
comment = Home Directories
browseable = yes
writable=yes
create mask = 0777
directory mask = 0777
guest ok = yes

[share]
comment = Precise File Server
path = /home/craig
browsable = yes
guest ok = yes
read only = no
writable = yes
create mask = 0777
directory mask = 0777

EDIT: If I open my samba share as root then I can write to the folders. I tried doing a chmod and chgrp but that didn't seem to have any impact. I would prefer not to have to browse/write as root :)

like image 236
mornindew Avatar asked Dec 17 '25 07:12

mornindew


1 Answers

Ok, figured it out. It wasn't in my samba settings. The error was actually in how I was "permanently" mounting my samba share.

I was doing:

//192.168.1.11/craig /home/craig/musicServer cifs username=craig,password=MYPASSWORD 0 0

but I needed

//192.168.1.11/craig /home/craig/musicServer cifs username=craig,password=MYPASSWORD,file_mode=0777,dir_mode=0777 0 0 

Adding both file_mode and dir_mode solved it.

like image 143
mornindew Avatar answered Dec 19 '25 23:12

mornindew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!