Secure /etc/fstab in Linux

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.

Most Read Articles

Add/Detect a new disk in ...

Written By Farooq Mohammed Ahmed on Sunday, 11 January 2015 19:22
Add/Detect a new disk in ...

Replace SSL Certificates ...

Written By Farooq Mohammed Ahmed on Friday, 16 December 2016 08:05
Replace SSL Certificates ...

Using awk in Alias Comman...

Written By Farooq Mohammed Ahmed on Friday, 19 February 2016 14:22
Using awk in Alias Comman...

Sed - Insert Text before ...

Written By Farooq Mohammed Ahmed on Monday, 20 November 2017 00:58
Sed - Insert Text before ...

Script to Monitor Nagios ...

Written By Farooq Mohammed Ahmed on Monday, 18 July 2016 22:48
Script to Monitor Nagios ...