Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble configuring SELinux to allow sending mail.

Reading the SELinux documentation I've found I can manage ports via the semanage command, but the command can't be found.

Is there another way to manage ports using SELinux, or a way for me to find this command? Worst case: Is there a way to disable SELinux, or switch to permissive mode without rebooting?

I'm running Fedora.


share|improve this question
up vote 0 down vote accepted

SELinux is a complicated beast I have managed to avoid so far (it's on the todo list somewhere!). However the one command most sysadmins will learn is the one to disable it:

setenforce 0

You can then use this command to check the status of SELinux:


A quick google turned up this page on the subject of installing semanage, looks pretty simple.

share|improve this answer
That definitely worked. Im testing to see if it solves my mail issue. – CMaury Mar 8 '11 at 20:35
Mail still not working but at least now I know its not Selinux... Thanks for the help. Accepting answer. – CMaury Mar 8 '11 at 23:01

Its pretty late (3 years on) but turning off selinux isn't the 'right' answer. You'll find semanage in the policycoreutils-python package, which dosen't seem to be installed by default.

However port forwarding should be handled by firewalld - the one time I needed to use semanage was to set the selinux flags for a samba share.I use the gui for firewalld, but firewall-cmd --permanent [--zone=<zone>] --add-port=<port>[-<port>]/<protocol> should add a port permanantly and firewall-cmd --reload should load it. As always, RTFM for more details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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