fduran

Linux protecting critical directories

Apr 21st, 2011
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.29 KB | None | 0 0
  1. # protecting critical linux directories my making them immutable
  2. # www.fduran.com
  3.  
  4. chattr +i dir
  5.  
  6. # system dirs to protect:
  7. /sbin
  8. /bin
  9. /usr/sbin
  10. /usr/lib
  11.  
  12. # also a tar of /etc/
  13.  
  14. # remove immutability by 'chattr -i dir' before installing programs or packages (apt-get/yum install etc)
Advertisement
Add Comment
Please, Sign In to add comment