Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by rwniceing
at 2024-09-11 14:11:55
Point:500 Replies:7 POST_ID:829233USER_ID:12079
Topic:
Linux;PHP Scripting Language;Apache Web Server
I try to enable Selinux from this site,http://wiki.eri.ucsb.edu/sysadm/SELinux , but it didn't work, On linux shell, I tried this command as follows
root@vps# getenforce
Disabled
root@vps#setenforece 1
setenforce: SELinux is disabled
root@vps# getenforce
Disabled
change the file at /etc/sysconfig/selinux from changing SELINUX=enforcing to SELINUX=disabled
reboot, but it didn't work.
On the link instruction, why turn on Selinux need to SELINUX=disabled ?
And how I know selinux is enabled or not ?
Please advise
root@vps# getenforce
Disabled
root@vps#setenforece 1
setenforce: SELinux is disabled
root@vps# getenforce
Disabled
change the file at /etc/sysconfig/selinux from changing SELINUX=enforcing to SELINUX=disabled
reboot, but it didn't work.
On the link instruction, why turn on Selinux need to SELINUX=disabled ?
And how I know selinux is enabled or not ?
Please advise
Author: rwniceing replied at 2024-09-11 15:26:57
Thanks for all of your reply
Accepted Solution
Expert: exploitedj replied at 2024-09-11 15:23:25
200 points EXCELLENT
I just commented there and came here to double check that the virtualization was with OpenVZ. Guess so since you are the question asker in both?
Author: rwniceing replied at 2024-09-11 15:14:21
savone and exploitedj thanks for your reply, exploitedj ,command result as follows
root@vps [~]# sestatus
SELinux status: disabled
Please read this post
http://www.experts-exchange.com/OS/Linux/Q_28516844.html
You agree hosting company has such ability ?
root@vps [~]# sestatus
SELinux status: disabled
Please read this post
http://www.experts-exchange.com/OS/Linux/Q_28516844.html
You agree hosting company has such ability ?
Assisted Solution
Expert: exploitedj replied at 2024-09-11 15:12:38
200 points EXCELLENT
Ok, the first thing to check is what does sestatus return for the "SELinux status: "
If that line returns disabled that means that you disabled it before a reboot. Think of this like the main breaker on your house. If it is off, the circuit breakers between enforcing and permissive won't mean much.
If that is the case you can set your /etc/sysconfig/selinux to "SELINUX=enforcing" then reboot.
The sestatus "SELinux status: " should now return "enabled". Now you can use set enforce to switch between enforcing and permissive.
Permissive is different than Disabled. It is SUPER IMPORTANT to understand how "Disabling" impacts policies relabeling. This is not uncommon and can lead to many headaches. Fedora documentation does a good job describing this. As do Dan Walsh's blogs. He is pretty much "the Man" with SeLinux.
Note - This may not fall into this thread but you typically want to avoid Disabling in SeLinux, even when troubleshooting, as you can undo a lot of policy label changes if you didn't set them properly. Go with Permissive as you gain your footing and if you need to figure out if SElinux is messing something up.
If that line returns disabled that means that you disabled it before a reboot. Think of this like the main breaker on your house. If it is off, the circuit breakers between enforcing and permissive won't mean much.
If that is the case you can set your /etc/sysconfig/selinux to "SELINUX=enforcing" then reboot.
The sestatus "SELinux status: " should now return "enabled". Now you can use set enforce to switch between enforcing and permissive.
Permissive is different than Disabled. It is SUPER IMPORTANT to understand how "Disabling" impacts policies relabeling. This is not uncommon and can lead to many headaches. Fedora documentation does a good job describing this. As do Dan Walsh's blogs. He is pretty much "the Man" with SeLinux.
Note - This may not fall into this thread but you typically want to avoid Disabling in SeLinux, even when troubleshooting, as you can undo a lot of policy label changes if you didn't set them properly. Go with Permissive as you gain your footing and if you need to figure out if SElinux is messing something up.
Author: rwniceing replied at 2024-09-11 14:48:24
Whatever I try, I always get this
root@vps#setenforece 1
setenforce: SELinux is disabled
root@vps#setenforece 1
setenforce: SELinux is disabled
Author: rwniceing replied at 2024-09-11 14:46:45
Yes I did,
but when getenforce it still echo
Disabled
I talk to my hosting company said
Is the main reason from the hosting company statement that is why
always get "Disabled" from getenforce ?
but when getenforce it still echo
Disabled
I talk to my hosting company said
We use OpenVZ virtualization (most popular VPS virtualization system), which doesn't support selinux for security reasons, i am sorry, but we have no option to enable it.
Is the main reason from the hosting company statement that is why
always get "Disabled" from getenforce ?
Assisted Solution
Expert: savone replied at 2024-09-11 14:43:59
100 points EXCELLENT
Edit /etc/selinux/config and make sure it is enforcing.
The file should look like this when done:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Reboot the system to load selinux.
The file should look like this when done:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Reboot the system to load selinux.