I accidentally enabled SELINUX and reboot the system without knowing it's consequence. Now, I can't access the login system in my CENTOS 7 unit.

What I've tried so far:


kernel /boot/vmlinuz-2.6.32-358.2.1.el6.x86_64 ro root=/dev/xvda1 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto console=tty0 selinux=0

and this

# cat /etc/grub.conf
    root (hd0,0)
    kernel /vmlinuz-2.6.32-279.el6.x86_64 root=/dev/md3 selinux=0
    initrd /initramfs-2.6.32-279.el6.x86_64.img

but after I reboot the system, I still can't login.

Also what is the purpose of root=/dev/xda or /dev/md3.

Update: I access the kernel boot and said that I should set selinux=0 in grub.cfg but when I went to grub.cfg it is readonly and the source path from the article is different from the path of the grub.cfg.

  • Welcome to U&L. SELinux is enabled by default on a new CentOS installation. Did you take additional steps to disable it before? Also, when you say that you cannot login, I guess the system offers you a login prompt, but does not accept your user credentials as valid. Is it possible that you simply have the wrong credentials? – Haxiel Mar 1 at 7:43
  • @Haxiel the login prompt is missing. It was disabled already and when I enabled it after rebooting, i cannot access using putty that is why I went to the actual machine and found out that the login form is missing. – Earvin Nill Castillo Mar 1 at 7:56
  • @Haxiel currently im in the kernel boot mode but can't rewrite the grub.cfg to set selinux=0 due to readonly. – Earvin Nill Castillo Mar 1 at 7:57
  • If you reboot the system, you can go back to the GRUB prompt where you'll get a chance to edit the boot configuration. You'll be able to edit the kernel boot configuration there. It's not persistent, but it should at least tell you if you're on the right track. If the rghb quiet parameters are present, you can remove them as well so that you can see the logs during startup. – Haxiel Mar 1 at 8:01
  • try adding 1 for single user mode kernel /vmlinuz-2.6.32-279.el6.x86_64 root=/dev/md3 selinux=0 1 – jsotola Mar 1 at 8:07

I thought I need to type the information on the source in grub. What I did is very simple, I just type Ctrl+X then add selinux=0 on the edited selected kernel version. Spent hours looking for solution and exploring at boot loader to edit grub.cfg. Sorry I'm a newbie to not thinking that the selinux=0 will just add in Ctrl+X.

  • Please do note that changes made this way will not be persistent. You'll need to redo them on each boot. – Haxiel Mar 1 at 9:03
  • Stressful last day of work. – Earvin Nill Castillo Mar 1 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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