Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Can't enable SElinux
PostPosted: Mon Apr 06, 2015 11:06 pm 
Offline
Senior Newbie

Joined: Mon Apr 06, 2015 10:59 pm
Posts: 5
Hi,

I'm new to unix administration. Please don't blame me asking anything stupid.

I'm trying to enable selinux on CentOS7 server.

I've tried to edit /etc/selinux/config

SELINUX=permissive
SELINUXTYPE=targeted


I've tried enforcing too. Nothing works. When I type getenforce I get
Disabled

I've looked into similar topics but I can't move forward. Some topics suggest to check grub file. But I don't have it. Everytime I try to fix something I need another fix which requires another fix, etc.

I'll appreciate any help.


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Mon Apr 06, 2015 11:27 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
I don't think Linode builds SELINUX into their kernels - with a default install, no matter what distro, you're actually running on top of a Ubuntu kernel.

Not sure if the solution is as simple as using pv-grub to install your own CentOS kernel.

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Mon Apr 06, 2015 11:50 pm 
Offline
Senior Newbie

Joined: Mon Apr 06, 2015 10:59 pm
Posts: 5
vonskippy wrote:
I don't think Linode builds SELINUX into their kernels - with a default install, no matter what distro, you're actually running on top of a Ubuntu kernel.

Not sure if the solution is as simple as using pv-grub to install your own CentOS kernel.


Honestly it's not simple for me.

My goal is to install a mail server and I use this instruction:

https://z0z0.me/2014/10/26/install-postfix-dovecot-auth-tls-mysql-postfixadmin-spamassassin-and-clamav-on-centos7/

I followed the instruction (didn't use nginx and used apache). I reached the line where I need to do
systemctl restart firewalld

The problem is that when I start firewalld my website becomes unavailable. I thought it can be related with SElinux.

What I'm doing wrong? Maybe I can find some logs?


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Tue Apr 07, 2015 12:43 am 
Offline
Senior Newbie

Joined: Mon Apr 06, 2015 10:59 pm
Posts: 5
The firewall-cmd --zone=public --list-all output is:

interfaces:
sources:
services: dhcpv6-client http ssh
ports: 80/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:


And I run firewall-cmd --reload but that doesn't help


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Tue Apr 07, 2015 1:06 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Firewall and SELinux are two different things.

Very simply put - Firewall controls traffic access, SELinux controls Application access

The link you posted gives me "502 Bad Gateway - nginx"

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Tue Apr 07, 2015 1:12 am 
Offline
Senior Newbie

Joined: Mon Apr 06, 2015 10:59 pm
Posts: 5
Thanks for clarification. Now it's clear the Firewall is the issue.

The website just went down. Hopefully it will get back soon.

Anyway I opened port 80 but it keeps blocking my requests. Don't know what else I can try.


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Tue Apr 07, 2015 9:59 am 
Offline
Senior Newbie

Joined: Mon Apr 06, 2015 10:59 pm
Posts: 5
The problem is fixed. Not sure how I've fixed it. I was playing around, disabled and re-enabled port 80, couple of restarts. Not sure what solved the issue but it works now. Thanks


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Wed Apr 15, 2015 3:51 pm 
Offline
Newbie

Joined: Wed Apr 15, 2015 3:28 pm
Posts: 3
vahan wrote:
The problem is fixed. Not sure how I've fixed it. I was playing around, disabled and re-enabled port 80, couple of restarts. Not sure what solved the issue but it works now. Thanks

Could you explain, what problem was fixed: do you turn on selinux or fix firewall problem?


Top
   
 Post subject: Re: Can't enable SElinux
PostPosted: Tue Apr 21, 2015 6:26 am 
Offline

Joined: Tue Apr 21, 2015 6:20 am
Posts: 1
vahan wrote:
The firewall-cmd --zone=public --list-all output is:

interfaces:
sources:
services: dhcpv6-client http ssh
ports: 80/tcp
masquerade: no
forward-ports:
icmp-blocks:
rich rules:


And I run firewall-cmd --reload but that doesn't help


It seams that you don't have interface assigned to the zone. Therefore it won't apply the rule.

You can add the interface by using:
Code:
#firewall-cmd --zone=public --add-interface=eth0 --permanent


the run the reload command.

_________________
https://z0z0.me


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group