0

I have a server with samba installed. I need to share some directories under the /var/spool path. But I faced with strange trouble: I can not get access to /var/spool with samba.

There is /etc/smb.conf (I have shared "/" for testing purposes. I had "/var/spool/asterisk/monitor" there earlier):

############SMB.CONF##############
[global]
workgroup = DOMAIN
server string = DPM
netbios name = DPM
netbios aliases = fileserver
security = user
username map = /etc/samba/smbusers
encrypt passwords = yes
map to guest = bad user
hosts allow = 192.168.1.10
load printers = no
disable spoolss = yes
local master = no
unix charset = utf-8
dos charset = cp866
unix extensions = No
wide links = Yes
follow symlinks = Yes

[recordings]
  path = /
  writeable = no
  guest ok = yes
  browseable = yes

I have access to /var and /home/asterisk_recordings from the samba share.

but I have no access to /asterisk_recordings and /var/spool

This is their stat output:

[root@mistral home]# stat /asterisk_recordings/
  File: «/asterisk_recordings/»
  Size: 4096            Blocks: 8          IO Block: 4096   каталог
Device: 902h/2306d      Inode: 44564481    Links: 2
Access: (0775/drwxrwxr-x)  Uid: (  498/asterisk)   Gid: (  498/asterisk)
Access: 2016-10-15 04:07:42.351252721 +0700
Modify: 2016-10-15 04:08:13.475252709 +0700
Change: 2016-10-15 04:26:09.004783795 +0700

[root@mistral home]# stat /home/asterisk-recordings/
  File: «/home/asterisk-recordings/»
  Size: 4096            Blocks: 8          IO Block: 4096   каталог
Device: 902h/2306d      Inode: 11796594    Links: 2
Access: (0775/drwxrwxr-x)  Uid: (  498/asterisk)   Gid: (  498/asterisk)
Access: 2016-10-15 04:25:21.600783813 +0700
Modify: 2016-10-15 03:28:01.698832140 +0700
Change: 2016-10-15 04:02:58.235252829 +0700

[root@mistral home]# stat /var
  File: «/var»
  Size: 4096            Blocks: 8          IO Block: 4096   каталог
Device: 902h/2306d      Inode: 38797313    Links: 18
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-10-14 22:17:06.070466036 +0700
Modify: 2016-10-02 20:33:45.489395585 +0700
Change: 2016-10-02 20:33:45.489395585 +0700

[root@mistral home]# stat /var/spool
  File: «/var/spool»
  Size: 4096            Blocks: 8          IO Block: 4096   каталог
Device: 902h/2306d      Inode: 38797581    Links: 10
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-10-15 02:15:24.569158693 +0700
Modify: 2016-10-15 00:26:50.642447066 +0700
Change: 2016-10-15 00:47:54.304488080 +0700

What could be a wrong?

0

Well, SELinux settings were the reason.

setsebool -P samba_export_all_ro 1 solved my problem.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.