June 8, 2013

How to Disable/Enable and SELinux on RHEL 6

On test laptops you are not always interesting in having all security enabled, e.g. when developing or testing a applications. And that is true for SELinux.

To see if SELinux is active

To temporarily disable SELinux - 1 (enable) or 0 (disable).

To permanently disable SELinux, edit /etc/selinux/config and set SELINUX=disabled.

After saving you need to reboot your machine.

2 comments:

Johannes Schmidt said...

thanks for this ideas, Magnus!
Did you ever run a JBoss EAP 6 on a SELinux-secured environment? On enforcing-level my server does not even start ... Any ideas?

Magnus K Karlsson said...

Sure. We run every server with SELinux in enforcing mode.

Install jboss via rpm, that will fix all you problem. I would say, that is the preferred way to install jboss eap 6 on rhel 6 servers.

Add rpm repo channel
# rhn-channel --add --channel=jbappplatform-6-x86_64-server-6-rpm --user=${RHNREG_USERNAME} --password=${RHNREG_PASSWORD}

Install
# yum groupinstall jboss-eap6

Done. Start stop
# service jbossas [start|stop|restart|status]

Logs are default written to
/var/log/jboss/standalone/server.log

To change default startup mode, standalone vs domain, jboss home, standard parameters, etc.
/etc/jbossas/jbossas.config