{"id":5817,"date":"2019-12-14T23:23:03","date_gmt":"2019-12-15T04:23:03","guid":{"rendered":"https:\/\/www.rushworth.us\/lisa\/?p=5817"},"modified":"2019-12-14T23:23:03","modified_gmt":"2019-12-15T04:23:03","slug":"samba-and-selinux","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=5817","title":{"rendered":"Samba and SELinux"},"content":{"rendered":"<p>I had a horrendous time trying to get the Samba share on our new server <em>working<\/em>. It worked insomuchas I could map a drive to the share &#8230; but I couldn&#8217;t actually see any files. Increasing the log level (smb.conf)<\/p>\n<pre>log level = 10 passdb:5 auth:5<\/pre>\n<p>showed that, yeah, I was getting a lot of access denied errors.<\/p>\n<pre>[2019\/12\/14 23:04:53.249959, 10, pid=17854, effective(0, 0), real(0, 0)] ..\/..\/source3\/smbd\/open.c:5438(create_file_unixpath)\r\ncreate_file_unixpath: NT_STATUS_ACCESS_DENIED\r\n[2019\/12\/14 23:04:53.249982, 10, pid=17854, effective(0, 0), real(0, 0)] ..\/..\/source3\/smbd\/open.c:5716(create_file_default)\r\ncreate_file: NT_STATUS_ACCESS_DENIED\r\n[2019\/12\/14 23:04:53.250012, 3, pid=17854, effective(0, 0), real(0, 0), class=smb2] ..\/..\/source3\/smbd\/smb2_server.c:3254(smbd_smb2_request_error_ex)\r\nsmbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ..\/..\/source3\/smbd\/smb2_create.c:296\r\n[2019\/12\/14 23:04:53.250038, 10, pid=17854, effective(0, 0), real(0, 0), class=smb2] ..\/..\/source3\/smbd\/smb2_server.c:3142(smbd_smb2_request_done_ex)\r\nsmbd_smb2_request_done_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] body[8] dyn[yes:1] at ..\/..\/source3\/smbd\/smb2_server.c:3304<\/pre>\n<p>Many, <em>many<\/em> iterations of samba configs later, I wondered if SELinux was causing a problem. Temporarily disabling SELinux allowed files to be seen in the mapped drive &#8230; so that was the problem. I needed to tweak the SELinux settings to allow Samba to actually share files.<\/p>\n<pre>semanage fcontext -a -t samba_share_t \"\/data(\/.*)?\"<\/pre>\n<p>And<\/p>\n<pre>setsebool -P samba_export_all_rw=1<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I had a horrendous time trying to get the Samba share on our new server working. It worked insomuchas I could map a drive to the share &#8230; but I couldn&#8217;t actually see any files. Increasing the log level (smb.conf) log level = 10 passdb:5 auth:5 showed that, yeah, I was getting a lot of &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[867],"class_list":["post-5817","post","type-post","status-publish","format-standard","hentry","category-system-administration","tag-samba"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5817"}],"version-history":[{"count":1,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5817\/revisions"}],"predecessor-version":[{"id":5818,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/5817\/revisions\/5818"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}