As you may already be familiar with SELinux or perhaps not but I won't go in to discussion what exactly it is, know though that the NSA from the USA created it years back and I am an avid user. I recently got my Raspberry PI and using Raspbian but had an abundant amount of time trying to figure out why every reboot and SSH/HDMI Output would cause a large X [cursor], like the old school GUI did when XFree86 GUI didn't work and this is when attempting to start selinux with no success. In short, I have a tutorial I made to help those who may want to try it out and notice it will NOT work out of the box, even if you use apt-get for all 3 required selinux packages.
GET SELINUX
Open up a terminal and launch:
Code: Select all
sudo apt-get install selinux-basics selinux-policy-defaultNow, you will normally have an issue here but go ahead and run the command:
Code: Select all
selinux-activatenow and should start to reboot.sudo reboot
CHECK SELINUX
Now, you may have to remotely SSH to your machine as you probably don't see anything but a grey background and big black X for a mouse cursor. If you don't have this problem, SELinux probably was a successful install (lucky you but doubtful). Either way, open a terminal and run the command:
Code: Select all
sudo check-selinux-installationThis obviously means SELinux was NOT successful. So, let's fix that!/usr/sbin/check-selinux-installation:19: DeprecationWarning: os.popen3 is deprecated. Use the subprocess module.
@staticmethod
/usr/sbin/check-selinux-installation:23: DeprecationWarning: os.popen2 is deprecated. Use the subprocess module.
def fix():
/etc/pam.d/login is not SELinux enabled
FSCKFIX is not enabled – not serious, but could prevent system from booting…
PERMISSIVE OR ENFORCING?
Now, I would tell you to try and enable permissive mode but it is extremely likely it won't work. So I want you to enable Enforcing Mode by typing:
Code: Select all
sudo selinux-config-enforcingNow we need to manually configure PAM and you could use vi or pico (sorry, I like pico!) so you can use your favorite text editor for the below command:
1). Edit PAM Login (/etc/pam.d/login)
Code: Select all
sudo pico /etc/pam.d/loginCode: Select all
session required pam_selinux.so multipleNow let's re-activate by typing:
Code: Select all
sudo selinux-activate2). EDIT INITSCRIPTS (/etc/default/rcS)
Go forth and type:
Code: Select all
sudo pico /etc/default/rcSCode: Select all
FSCKFIX=yesCode: Select all
EDITMOTD=noCHECK DEVPTS
Please run the code:
Code: Select all
sudo mount | grep devptsWe've successfully allowed SELinux to install and has been activated where prior it could not be. You could always setup a Cron job and other things as well but you should be OK now.[devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)/quote] or similar, you're good to go.
Now, remove the static nodes by typing:3). Go, Go Activate (selinux-activate)Code: Select all
sudo rm -f /dev/[tp]ty[abcdepqrstuvwxyz][0-9a-f]
Now that we added and saved everything, let's see if we did it successfully by typing:If you now see:Code: Select all
sudo selinux-activateActivating SE Linux
SE Linux is activated. You may need to reboot now.