Wednesday, 7 December 2016

Remove the Selinux file permissions linux

Remove the Selinux file permissions linux  


File start with  '.' permission means selinux permissions enabled for the file. if selinux enable to the file even some times we are not able to modify the files also. Please find below steps to remove the selinux file permissions .

-rwxr-xr-x . 1

1. First check selinux enabled or disabled . if enabled please disable the selinux.

# sestatus
SELinux status:                 disabled

#vi /etc/sysconfig/selinux

Open selinux file and set the status to 'SELINUX=disabled' . Some times reboot also required.

2. Remove the selinux file permission for single file.

setfattr -x security.selinux  filename

3. To remove the all selinux file permissions , Please use below one.

find / \( -fstype ext2 -o -fstype ext3 -o -fstype ext4 -o -fstype btrfs \) -exec setfattr -x security.selinux {} \; 

No comments:

Post a Comment