7

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
  • What are the parameters for: security, map to guest, guest account, browseable.
    – harrymc
    Sep 25, 2013 at 13:25
  • Defaults. So security = user, map to guest = never, guest account = nobody, browseable = true.
    – Tiddo
    Sep 27, 2013 at 10:44
  • "security = user" requires correct username/password. Have you used smbpasswd? Better info in Chapter 9. Users and Security.
    – harrymc
    Sep 27, 2013 at 11:41
  • what happens if you remove the inherit permissions setting? it and the mask settings conflict. aslo could you please confirm that /home/share is 777, not just its contents? samba.org/samba/docs/using_samba/ch08.html Sep 27, 2013 at 11:44

9 Answers 9

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

2

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
  • 1
    Requests for clarification, diagnostic suggestions, and speculative solutions go in a comment. Answers are reserved for actual solutions.
    – fixer1234
    Sep 14, 2016 at 16:34
2

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
  • no, they are not supposed to be there of course. I edit this.
    – bigmarck
    Sep 16, 2016 at 11:39
  • Adding "writeable=yes" did allow to save from remote. Final conf: [********] comment = Samba on ***** path = /home/****/**** read only = no browsable =no writeable=yes
    – daniel_hck
    Nov 24, 2021 at 18:44
2

The reason can be SELinux.

Try to disable it temporarily and check again.

How to disable: https://www.tecmint.com/disable-selinux-temporarily-permanently-in-centos-rhel-fedora/

Hot to setup: https://www.lisenet.com/2016/samba-server-on-rhel-7/

You need to use samba_share_t in semanage command.

1

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.

0

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
  • Groups are not the problem, currently only the superman user should have access to the share. However, I tried you solution, but it didn't work unfortunately.
    – Tiddo
    Sep 27, 2013 at 10:37
0

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
  • That's a good catch! I'm currently not at home, but I'll look into it when I'm there.
    – Tiddo
    Sep 30, 2013 at 19:49
-1

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
  • I have writable=yes in my config, as well as read only = no. These 2 are synonymous to each other and hence only one is shown in the output. I suspect the problem isn't in my config file but somewhere else. However I have no idea where.
    – Tiddo
    Sep 21, 2013 at 10:58
  • 1
    I had the same problem and I fixed it by changing writable to writeable... Feb 14, 2014 at 23:51
-1

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
  • 2
    The question indicates that create mask and directory mask are already 0777, and that the OP has done chmod 777, so this is a non-answer. Nov 17, 2015 at 21:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .