temporarily switch off and disable selinux

January 5, 2008 at 3:12 pm 2 comments

SELinux has 3 modes: disabled, permissive, enforcing

termporarily switch off selinux
# echo 0 >/selinux/enforce
# newrole -r sysadm_r
switch back into enforcing mode
# echo 1 >/selinux/enforce
# cat /selinux/enforce
“0” or “1” for permissive or enforcing

For REHL or Fedora
Permanently change to permissive or disabled
# vi /etc/selinux/config
change SELINUX=enforcing to SELINUX=permissive
change SELINUX=enforcing to SELINUX=disable

For other linux that don’t have the /etc/selinux/config, just change the grub config to activiate the setting
# vi /boot/grub/grub.conf
##—– permissive
title SE-Linux Test System
root (hd0,0)
kernel /boot/vmlinuz-2.4.20-selinux-2003040709 ro root=/dev/hda1 nousb enforcing=0
#initrd /boot/initrd-2.4.20-selinux-2003040709.img

##—– disable
title SE-Linux Test System
root (hd0,0)
kernel /boot/vmlinuz-2.4.20-selinux-2003040709 ro root=/dev/hda1 nousb selinux=0
#initrd /boot/initrd-2.4.20-selinux-2003040709.img

if you want to re-enable the SELinux
1. change back the config file
2. after booting into permissive mode run
# fixfiles relabel
(Alternatively in Fedora or RHEL)
# touch /.autorelabel
and reboot or put
# autorelabel

Entry filed under: Linux, redhat.

Debian locale vsftpd

2 Comments Add your own

  • 1. Lekrearamok  |  April 16, 2009 at 11:17 pm

    Я новенький! Давайте дружить! =)

    Reply
  • 2. Lekrearamok  |  April 16, 2009 at 11:20 pm

    nice, really nice!

    Reply

Leave a comment

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

January 2008
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Most Recent Posts