Make a file immutable
Nobody, not even root, can change the file until the flag is removed with chattr -i. Good for when something keeps rewriting resolv.conf behind your back.
chattr +i /etc/resolv.conf && lsattr /etc/resolv.conf
- tool
- linux133 commands
More linux commands
-
lsattr -R /etc/ 2>/dev/null | grep -v '^\-\-\-\-'List files in /etc/ that have non-default attributes.
-
getfacl /srv/sharedShow POSIX ACL entries: owner, group and extra users.
-
setfacl -m u:alice:rwx /srv/sharedGive alice full access without changing the group owner.
-
find / -perm /6000 -type f -ls 2>/dev/nullFind setuid and setgid executables. Useful for a security audit.
-
pgrep -la nginxShow PIDs and full command lines of processes that match a name.