How to disable SELinux without restart?
I need to disable SELinux but cannot restart the machine
i followed this link where i get bellow command
setenforce 0
But after running this command i checked for that
sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: disabled
Policy version: 24
Policy from config file: targeted
Is there any other option?
rhel selinux
add a comment |
I need to disable SELinux but cannot restart the machine
i followed this link where i get bellow command
setenforce 0
But after running this command i checked for that
sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: disabled
Policy version: 24
Policy from config file: targeted
Is there any other option?
rhel selinux
4
setenforce 0
<- did you run it from root or withsudo
?
– UVV
Aug 7 '14 at 6:51
1
@UVV yes i am doing all this from root
– Vikas Hardia
Aug 7 '14 at 13:01
add a comment |
I need to disable SELinux but cannot restart the machine
i followed this link where i get bellow command
setenforce 0
But after running this command i checked for that
sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: disabled
Policy version: 24
Policy from config file: targeted
Is there any other option?
rhel selinux
I need to disable SELinux but cannot restart the machine
i followed this link where i get bellow command
setenforce 0
But after running this command i checked for that
sestatus
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: disabled
Policy version: 24
Policy from config file: targeted
Is there any other option?
rhel selinux
rhel selinux
edited Sep 22 '15 at 9:59
Vikas Hardia
asked Aug 7 '14 at 6:39
Vikas HardiaVikas Hardia
345148
345148
4
setenforce 0
<- did you run it from root or withsudo
?
– UVV
Aug 7 '14 at 6:51
1
@UVV yes i am doing all this from root
– Vikas Hardia
Aug 7 '14 at 13:01
add a comment |
4
setenforce 0
<- did you run it from root or withsudo
?
– UVV
Aug 7 '14 at 6:51
1
@UVV yes i am doing all this from root
– Vikas Hardia
Aug 7 '14 at 13:01
4
4
setenforce 0
<- did you run it from root or with sudo
?– UVV
Aug 7 '14 at 6:51
setenforce 0
<- did you run it from root or with sudo
?– UVV
Aug 7 '14 at 6:51
1
1
@UVV yes i am doing all this from root
– Vikas Hardia
Aug 7 '14 at 13:01
@UVV yes i am doing all this from root
– Vikas Hardia
Aug 7 '14 at 13:01
add a comment |
6 Answers
6
active
oldest
votes
sestatus
is showing the current mode as permissive
.
In permissive
mode, SELinux will not block anything, but merely warns you. The line will show enforcing
when it's actually blocking.
I don't believe it's possible to completely disable SELinux without a reboot.
1
I think you can disable it without a reboot by directly editing the /etc/selinux/config file and setting SELINUX=disabled
– dmohr
Mar 2 '18 at 19:40
1
@dmohr - If you read this Centos document it tells you that it only works on the next reboot.
– garethTheRed
Mar 2 '18 at 19:50
add a comment |
Disabling SELinux
without reboot is not possible. But I guess making it in permissive
mode is going to satifsy your requirement.
The output of sestatus
shows SELinux
is enabled but also shows it is in Permissive
mode, which is what you just did with the setenforce
command.
add a comment |
On CentOS 7:
echo 0 > /sys/fs/selinux/enforce
2
fwiw, this didn't work for me, Centos 7.2:# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive # echo 0 > /sys/fs/selinux/enforce # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted
– datakid
Oct 4 '16 at 3:23
add a comment |
At the time of writing what OP did should work. On Fedora 26:
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
As user doesn't work.
[aries@csibesz]$ setenforce 0
setenforce: setenforce() failed
As root, it does:
[aries@csibesz]$ sudo setenforce 0
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
The same applies to CentOS 7 and RedHat EL 7: it is working without reboot.
add a comment |
Best way to disable selinux is by using following command:
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
OR
vi /etc/sysconfig/selinux
, setselinux=disabled
OR
set enforce 0 sestatus
Though in certain cases restart will be required.
add a comment |
For CentOS 6 (not 7):
echo 0 > /selinux/enforce
1
Does not work on centos 7. Only works on centos 6 and under
– shreddd
Oct 19 '16 at 19:35
1
This answer is correct for centos 6. Please double check before downvoting.
– ora-600
Jun 12 '17 at 16:07
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f148890%2fhow-to-disable-selinux-without-restart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
sestatus
is showing the current mode as permissive
.
In permissive
mode, SELinux will not block anything, but merely warns you. The line will show enforcing
when it's actually blocking.
I don't believe it's possible to completely disable SELinux without a reboot.
1
I think you can disable it without a reboot by directly editing the /etc/selinux/config file and setting SELINUX=disabled
– dmohr
Mar 2 '18 at 19:40
1
@dmohr - If you read this Centos document it tells you that it only works on the next reboot.
– garethTheRed
Mar 2 '18 at 19:50
add a comment |
sestatus
is showing the current mode as permissive
.
In permissive
mode, SELinux will not block anything, but merely warns you. The line will show enforcing
when it's actually blocking.
I don't believe it's possible to completely disable SELinux without a reboot.
1
I think you can disable it without a reboot by directly editing the /etc/selinux/config file and setting SELINUX=disabled
– dmohr
Mar 2 '18 at 19:40
1
@dmohr - If you read this Centos document it tells you that it only works on the next reboot.
– garethTheRed
Mar 2 '18 at 19:50
add a comment |
sestatus
is showing the current mode as permissive
.
In permissive
mode, SELinux will not block anything, but merely warns you. The line will show enforcing
when it's actually blocking.
I don't believe it's possible to completely disable SELinux without a reboot.
sestatus
is showing the current mode as permissive
.
In permissive
mode, SELinux will not block anything, but merely warns you. The line will show enforcing
when it's actually blocking.
I don't believe it's possible to completely disable SELinux without a reboot.
answered Aug 7 '14 at 7:14
garethTheRedgarethTheRed
24.6k36380
24.6k36380
1
I think you can disable it without a reboot by directly editing the /etc/selinux/config file and setting SELINUX=disabled
– dmohr
Mar 2 '18 at 19:40
1
@dmohr - If you read this Centos document it tells you that it only works on the next reboot.
– garethTheRed
Mar 2 '18 at 19:50
add a comment |
1
I think you can disable it without a reboot by directly editing the /etc/selinux/config file and setting SELINUX=disabled
– dmohr
Mar 2 '18 at 19:40
1
@dmohr - If you read this Centos document it tells you that it only works on the next reboot.
– garethTheRed
Mar 2 '18 at 19:50
1
1
I think you can disable it without a reboot by directly editing the /etc/selinux/config file and setting SELINUX=disabled
– dmohr
Mar 2 '18 at 19:40
I think you can disable it without a reboot by directly editing the /etc/selinux/config file and setting SELINUX=disabled
– dmohr
Mar 2 '18 at 19:40
1
1
@dmohr - If you read this Centos document it tells you that it only works on the next reboot.
– garethTheRed
Mar 2 '18 at 19:50
@dmohr - If you read this Centos document it tells you that it only works on the next reboot.
– garethTheRed
Mar 2 '18 at 19:50
add a comment |
Disabling SELinux
without reboot is not possible. But I guess making it in permissive
mode is going to satifsy your requirement.
The output of sestatus
shows SELinux
is enabled but also shows it is in Permissive
mode, which is what you just did with the setenforce
command.
add a comment |
Disabling SELinux
without reboot is not possible. But I guess making it in permissive
mode is going to satifsy your requirement.
The output of sestatus
shows SELinux
is enabled but also shows it is in Permissive
mode, which is what you just did with the setenforce
command.
add a comment |
Disabling SELinux
without reboot is not possible. But I guess making it in permissive
mode is going to satifsy your requirement.
The output of sestatus
shows SELinux
is enabled but also shows it is in Permissive
mode, which is what you just did with the setenforce
command.
Disabling SELinux
without reboot is not possible. But I guess making it in permissive
mode is going to satifsy your requirement.
The output of sestatus
shows SELinux
is enabled but also shows it is in Permissive
mode, which is what you just did with the setenforce
command.
answered Aug 7 '14 at 7:34
beginerbeginer
2,0581117
2,0581117
add a comment |
add a comment |
On CentOS 7:
echo 0 > /sys/fs/selinux/enforce
2
fwiw, this didn't work for me, Centos 7.2:# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive # echo 0 > /sys/fs/selinux/enforce # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted
– datakid
Oct 4 '16 at 3:23
add a comment |
On CentOS 7:
echo 0 > /sys/fs/selinux/enforce
2
fwiw, this didn't work for me, Centos 7.2:# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive # echo 0 > /sys/fs/selinux/enforce # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted
– datakid
Oct 4 '16 at 3:23
add a comment |
On CentOS 7:
echo 0 > /sys/fs/selinux/enforce
On CentOS 7:
echo 0 > /sys/fs/selinux/enforce
edited Aug 2 '16 at 1:26
DarkHeart
3,52132340
3,52132340
answered Aug 2 '16 at 1:12
rsnowrsnow
10112
10112
2
fwiw, this didn't work for me, Centos 7.2:# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive # echo 0 > /sys/fs/selinux/enforce # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted
– datakid
Oct 4 '16 at 3:23
add a comment |
2
fwiw, this didn't work for me, Centos 7.2:# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive # echo 0 > /sys/fs/selinux/enforce # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted
– datakid
Oct 4 '16 at 3:23
2
2
fwiw, this didn't work for me, Centos 7.2:
# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive # echo 0 > /sys/fs/selinux/enforce # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted
– datakid
Oct 4 '16 at 3:23
fwiw, this didn't work for me, Centos 7.2:
# sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive # echo 0 > /sys/fs/selinux/enforce # sestatus SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted
– datakid
Oct 4 '16 at 3:23
add a comment |
At the time of writing what OP did should work. On Fedora 26:
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
As user doesn't work.
[aries@csibesz]$ setenforce 0
setenforce: setenforce() failed
As root, it does:
[aries@csibesz]$ sudo setenforce 0
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
The same applies to CentOS 7 and RedHat EL 7: it is working without reboot.
add a comment |
At the time of writing what OP did should work. On Fedora 26:
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
As user doesn't work.
[aries@csibesz]$ setenforce 0
setenforce: setenforce() failed
As root, it does:
[aries@csibesz]$ sudo setenforce 0
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
The same applies to CentOS 7 and RedHat EL 7: it is working without reboot.
add a comment |
At the time of writing what OP did should work. On Fedora 26:
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
As user doesn't work.
[aries@csibesz]$ setenforce 0
setenforce: setenforce() failed
As root, it does:
[aries@csibesz]$ sudo setenforce 0
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
The same applies to CentOS 7 and RedHat EL 7: it is working without reboot.
At the time of writing what OP did should work. On Fedora 26:
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
As user doesn't work.
[aries@csibesz]$ setenforce 0
setenforce: setenforce() failed
As root, it does:
[aries@csibesz]$ sudo setenforce 0
[aries@csibesz]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 30
The same applies to CentOS 7 and RedHat EL 7: it is working without reboot.
answered May 26 '17 at 8:12
Janos FeherJanos Feher
7111
7111
add a comment |
add a comment |
Best way to disable selinux is by using following command:
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
OR
vi /etc/sysconfig/selinux
, setselinux=disabled
OR
set enforce 0 sestatus
Though in certain cases restart will be required.
add a comment |
Best way to disable selinux is by using following command:
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
OR
vi /etc/sysconfig/selinux
, setselinux=disabled
OR
set enforce 0 sestatus
Though in certain cases restart will be required.
add a comment |
Best way to disable selinux is by using following command:
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
OR
vi /etc/sysconfig/selinux
, setselinux=disabled
OR
set enforce 0 sestatus
Though in certain cases restart will be required.
Best way to disable selinux is by using following command:
sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config
OR
vi /etc/sysconfig/selinux
, setselinux=disabled
OR
set enforce 0 sestatus
Though in certain cases restart will be required.
edited Nov 24 '17 at 9:39
peterh
4,463113158
4,463113158
answered Nov 24 '17 at 9:12
Divyani SinghDivyani Singh
593
593
add a comment |
add a comment |
For CentOS 6 (not 7):
echo 0 > /selinux/enforce
1
Does not work on centos 7. Only works on centos 6 and under
– shreddd
Oct 19 '16 at 19:35
1
This answer is correct for centos 6. Please double check before downvoting.
– ora-600
Jun 12 '17 at 16:07
add a comment |
For CentOS 6 (not 7):
echo 0 > /selinux/enforce
1
Does not work on centos 7. Only works on centos 6 and under
– shreddd
Oct 19 '16 at 19:35
1
This answer is correct for centos 6. Please double check before downvoting.
– ora-600
Jun 12 '17 at 16:07
add a comment |
For CentOS 6 (not 7):
echo 0 > /selinux/enforce
For CentOS 6 (not 7):
echo 0 > /selinux/enforce
edited Jun 20 '17 at 8:35
Alexander
5,99322144
5,99322144
answered May 6 '16 at 1:14
user169151user169151
411
411
1
Does not work on centos 7. Only works on centos 6 and under
– shreddd
Oct 19 '16 at 19:35
1
This answer is correct for centos 6. Please double check before downvoting.
– ora-600
Jun 12 '17 at 16:07
add a comment |
1
Does not work on centos 7. Only works on centos 6 and under
– shreddd
Oct 19 '16 at 19:35
1
This answer is correct for centos 6. Please double check before downvoting.
– ora-600
Jun 12 '17 at 16:07
1
1
Does not work on centos 7. Only works on centos 6 and under
– shreddd
Oct 19 '16 at 19:35
Does not work on centos 7. Only works on centos 6 and under
– shreddd
Oct 19 '16 at 19:35
1
1
This answer is correct for centos 6. Please double check before downvoting.
– ora-600
Jun 12 '17 at 16:07
This answer is correct for centos 6. Please double check before downvoting.
– ora-600
Jun 12 '17 at 16:07
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f148890%2fhow-to-disable-selinux-without-restart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
setenforce 0
<- did you run it from root or withsudo
?– UVV
Aug 7 '14 at 6:51
1
@UVV yes i am doing all this from root
– Vikas Hardia
Aug 7 '14 at 13:01