Samba Sharing Fedora 24

asked 2016-09-01 14:39:11 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I've followed step by step this: https://ask.fedoraproject.org/en/ques...

My computer has two disks. If the share is on the filesystem "/dev/mapper/fedora-home" works fine. When the share is in another filesystem "/dev/sdc2" in my case, I cant access the folder.

This is my smb.conf

[global]
;       unix charset = utf-8
        workgroup = WORKGROUP
        security = user
        null passwords = yes
        map to guest = Bad User

        log file = /var/log/samba/log.%m
        log level = 3
        max log size = 50

[back]
        path = /home/sdc1/back
;       read only = no
        writeable = yes
;       browseable = yes
        guest ok = yes

[shared]
        path = /home/shared
;       read only = no
        writeable = yes
;       browseable = yes
        guest ok = yes

Here is a detail of my fstab

/dev/mapper/fedora-home    53G    20G   31G  40% /home
/dev/sdc1                 1,4T   735G  571G  57% /home/sdc1

The share named "shared" works fine but my share named "back" does not work. Windows cannot access.

Details of the logfile when windows access denied to "back" share

./source3/smbd/service.c:199(set_current_service)
  chdir (/home/sdc1/back) failed, reason: Permission denied
[2016/09/01 21:29:22.964405,  3] ../source3/smbd/smb2_server.c:3098(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../source3/smbd/smb2_server.c:2450
edit retag flag offensive close merge delete

Comments

What are your permissions for /home/sdc1 and /home/sdc1/back ? Seems to me like linux permissions are not set correctly. It's the same as in Windows you have permissions on share level and on filesystem level.

pbogu gravatar imagepbogu ( 2016-09-02 03:34:32 -0500 )edit

selinux? Try temporarely disabling selinux: sudo setenforce 0 to see what happens. Read /etc/samba/smb.conf to learn about selinux related issues using samba.

fcomida gravatar imagefcomida ( 2016-09-02 05:22:18 -0500 )edit

Thank you for the answers, chmod 777 was set on both shared folders but only can access to /home/shared.

I also did:

  • $ semanage fcontext -a -t samba_share_t "/home/sdc1/back(/.*)?"
  • Setting selinux to permissive with $ setenforce 0

Same result

julianito gravatar imagejulianito ( 2016-09-02 12:40:13 -0500 )edit

check permissions on each directory component (e.g., /home, /home/sdc1, /home/sdc1/back, etc) using namei -l /home/sdc1/back. Also verify selinux contexts for each component.

cschanzle gravatar imagecschanzle ( 2016-09-03 08:58:03 -0500 )edit

It's working after changing the /dev/sdc1 device mount point.

When mounted in /home/sdc1/back share does not work. After changing mount point to /mnt/sdc1/back (also in smb.conf) it works!

Samba sometimes drives me crazy. o_O

julianito gravatar imagejulianito ( 2016-09-05 02:42:03 -0500 )edit