Secure /etc/fstab in Linux

by | Jan 12, 2015 | RHEL / CentOS

Its best to secure /etc/fstab as it contains all the mount locations and can lead to boot issues if any novice person tinkers/plays around with it. The secure mode can only be enabled /disabled by root user only and completely secure. There is a simple one line command for that as given.

# chattr +i /etc/fstab

Now if you try to edit /etc/fstab it would give you this message

"/etc/fstab"
"/etc/fstab" E212: Can't open file for writing
Press ENTER or type command to continue

To turn off the security on it run this command

# chattr -i /etc/fstab

If you encounter any errors during the process, let us know via Contact Us and will get it resolved promptly.

Related Articles….