
As an example, let's say you have one or more files in a directory named /var/opt/xst that you need to protect the attributes of (e.g. make them read only).
Here's how you would do it:
1) Set permissions for the file, or files in a directory.
e.g. chmod 444 /var/opt/xst/xst.ini OR chmod 444 /var/opt/xst/*
2) ls -la /var/opt/xst/ to confirm the permission was changed
3) To make the file permissions immutable:
chattr -i /var/opt/xst/xst.ini OR chattr -i 444 /var/opt/xst/*
4) To revert:
chattr +i /var/opt/xst/xst.ini OR chattr +i 444 /var/opt/xst/*
There's also the option to make the attributes for any file "append-only" (chattr +a).
Note: You can check current attributes by using lsattr.
0 comments:
Post a Comment
speak your mind, but keep it clean (the comment, not your mind).
no spam and no trolls please