Fixing Random Samba Share Lockouts

Ever had Samba shares on CentOS become randomly inaccessible? If so, I might have a cure… Turns out the culprit is (yet) again SELinux. Thank you SELinux for your super sensitive security policies…

It turns out that you might have lost extra important SELinux label on the share and sub-folders. Don’t ask me why and how? Perhaps a boot failure or power failure or random act of God?!

OK, here’s the solution you are looking for. Logon to your CentOS server and simply issue the chcon command. Be sure to do it recursively if you want to access sub-folders inside.

and that’s it! This will once again make that share accessible. Really… that simple!

EDIT: I figured out why lockouts were happening. It turns a Docker container was accessing these shares and resetting the label. If I set the label back to samba_share_t and make Docker container stop resetting it, then Docker container loses access to the folders. argh!

FacebookTwitterGoogleLinkedIn


Leave a Reply

Your email address will not be published. Required fields are marked *