Move SELinux policies

Replicate SELinux policies

Firstly create a file with all the SELinux customization/settings, to create it execute the following command,

$ sudo semanage -o /root/local.selinux

Now transfer this file the second system on which we want same SELinux policies as the first system,

$ scp -rv /root/local.selinux root@192.168.1.100:/root

After the file has been copied to second machine, we need to restore that file. So, ssh into the second machine,

$ ssh root@192.168.1.100

After we have accessed the system, restore file using the following command,

# semanage -i /root/local.selinux

That’s it , this will restore the SELinux policies of first machine onto the second machine.