How to Install grsecurity kernel on CentOS

[Total: 7    Average: 4.4/5]

Grsecurity is an extensive security enhancement to the Linux kernel that defends against a wide range of security threats through intelligent access control, memory corruption-based exploit prevention, and a host of other system hardening that generally require no configuration.
In this artical we are going to share steps for How to Install grsecurity kernel on CentOS:

Setp 1. Downloading linux kernel

[root ~ ]# wget

Step 2. Downlaod latest Grsecurity patch
You can login to your panel to download Grsecurity patch or from

Step 3. Extract the kernel and patch with grsecurity

[root ~ ]#  tar xjf linux-
[root ~ ]#  cd linux-2.6.31
[root ~ ]#  patch -p0  savedefault –-default=0 –-once
[root ~ ]#  mv linux-2.6.31 linux-2.6.31-grsec
[root ~ ]#  make clean && make mrproper

Step 4. Edit your kernel as per your need

[root ~ ]# make menuconfig

Step 5. Building and installing grsecurity kernel

[root ~ ]# make bzImage && make modules
[root ~ ]# make modules_install && make install

step 6. Make sure it’s working ok.check with below command

[root ~ ]# depmod 2.6.31-grsec

Setp 7. Installing and booting the new kernel

[root ~ ]# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.31-grsec
[root ~ ]# cp /boot

Step 8. make changes in grub.conf file
Step 9. grub prompt after this and fire below command

grub > savedefault –-default=0 –-once

Step 10. Now reboot server

step 11. check the kernel version