Information Security

SELinux prevented ruby from reading files stored on a NFS filesytem

While working on a server farm for a client I kept running into some issues with one of the servers. The issue appeared to be a single CentOS Linux server in a cluster of ten CentOS Linux servers configured exactly the same as the other nine CentOS Linux servers was having issues writing to a network storage device. Initially I figured that the CentOS Linux server having the issues had some permission issues with the directory that was mounted to the SAN (Storage Area Network) however after minimal troubleshooting it was verified that the permissions were identical to the other servers. I started looking through other logs on the server having the issue and located some SELinux errors that were noticeably related to the issue at hand. Below I describe where the SELinux error was located, what the specific errors were, and how I was able to resolve the errors on this specific CentOS Linux server.

Technology Insights

How to Turn Off SELinux on a CentOS Server

Follow the below directions to turn off selinux on a CentOS server. SeLinux can cause many issues and if your server is behind a properly configured firewall as well as the systems administrator only opens necessary ports that are configured properly your risks should be minimal.

  1. Modify selinux Configuration:Modify the selinux config file by issuing the command below and changing the SELINUX option to disabled as shown below.
  2. bash

    1. [root@server ~]#vi /etc/selinux/config