Can't write to samba share

I try to setup a samba file server, but whatever I do I can't get write access to work (reading works fine). This is my current situation:

I have a local fileserver with 3 harddisks mounted at /mnt/share/disk<nr>. 2 of these use the ext4 filesystem, the third one is ntfs. This file server runs Fedora 18 32-bit. The root folders of these harddisks are owned by superman:superman, and testparm outputs the following:

[global]
workgroup = WORKGROUP
netbios name = FILE_SERVER
server string = Samba Server Version %v
interfaces = lo, eth0, 192.168.123.191/8
log file = /var/log/samba/log.%m
max log size = 50
unix extensions = No
load printers = No
idmap config * : backend = tdb
hosts allow = 192.168.123.
cups options = raw
wide links = Yes
[share]
comment = Home Directories
path = /home/share/
write list = superman, @users
force user = superman
read only = No
create mask = 0777
directory mask = 0777
inherit permissions = Yes
guest ok = Yes

I've tried a lot to get this to work: the disk are chmodded to 777, I've tried turning off selinux, I've added the samba_share_t label to the disks and as can be seen in the above output I tried to make the smb config as permissive as I could, but still I cannot write to the share (tried from Windows 7 and another Fedora installation).

What can I try to be able to write to the shares?

EDIT: The replies I got so far are mostly concerned with the smb.conf. I have however tried a lot of different setup, ready made configs, and solutions to similar problems for the smb.conf file, so I suspect that the real problem is somewhere else.

4

9 Answers

I had the same problem. from xp i had complete access while W7 showed read and write permission, but could not actually create new files or edit existings. I had:

read only = no 

already in the smb.conf
by adding

writeable = yes 

(beware! not writable ) windows7 can modify existing files and create new files.

2

for what it is worth, I couldn't access my samba share, maybe you have forgotten to add you username to the samba password group (for lack of beter description phrase)

this is what I did to get mine to work

smbpasswd -a username

after by using nautilus, shared my drive/folder with right-click, sharing, etc.

create your password, and use your username and passsword (which you just entered) to access your samba drive, you can also map this drive in Windows

hope this could help

Are the group and owner of the shared folder set properly for the samba user? Should be the same, or try

$ chown -R nobody:nogroup sharedfolder

for testing purposes...

1

You say the root directory is owned by user superman but also group superman. Is that not a problem? If superman is member of the group users you should make the group of the root directory users (and force this for all other users) or else all other users will not have access.

So force the shared directories to superman:users.

After that you could also try changing/adding the following:

valid users = @users
create mode = 0660
directory mode = 0770
force create mode = 0660
force directory mode = 0770
force user = superman
force group = users

This is, if superman is a member of group users. If not then add superman to valid users.

1

You might want to take a look at how you have /mnt/share/disk linked to /home/share.

The path that you have in SMB.conf doesn't match what your mount points are for the drives.

If you are using a symbolic link you might want to check the permissions there.

1

The reason can be SELinux.

Try to disable it temporarily and check again.

How to disable:

Hot to setup:

You need to use samba_share_t in semanage command.

Check the permissions on the file/folders you're attempting to write

I had been struggling with an issue similar to this. I was attempting to copy folders into the samba share and running into permission issues. I found the problem to be with the folders I was copying. The folders were read-only directories, which resulted in the directories being copied, but failing to create the files within them. This is because the permissions were copied with the directories.

I fixed this by changing the permissions on the folders I was moving before attempting to copy them over and then everything worked just fine.

Here is an example of one of my shares. Take note of the writable option.

[rails]
create mask = 0777
directory mask = 0777
browseable = yes
writeable = yes
path = /var/rails
2

Had same problem, actually very frustrating, could browse with all users but remained read only until ..... changed the creat & directory mask to 0777, and did the chmod 777 /{path} and it worked.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like