diff --git a/src/rhcsa.md b/src/rhcsa.md index 8624382..ec8125f 100644 --- a/src/rhcsa.md +++ b/src/rhcsa.md @@ -582,4 +582,23 @@ pool 2.rhel.pool.ntp.org iburst # Add the RHEL time server sudo systemctl start chronyd # Start the chrony service sudo systemctl enable chronyd # Enable the chrony service to start on boot +``` + +## Secure Linux Systems + +### lsattr +```bash +lsattr # List the attributes of the files and directories + +lsattr /etc/passwd # List the attributes of the /etc/passwd file +``` + +### chattr +```bash +chattr +i /etc/passwd # Set the immutable attribute on the /etc/passwd file +chattr -R +i /etc/ # Set the immutable attribute on the /etc/ directory and all its contents +chattr +a /etc/passwd # Set the append only attribute on the /etc/passwd file + +chattr -i /etc/passwd # Remove the immutable attribute on the /etc/passwd file +chattr -R -i /etc/ # Remove the immutable attribute on the /etc/ directory and all its contents ``` \ No newline at end of file