Task- File Permission Correction
Problem:
After conducting a security audit within the
Stratos DC
, the Nautilus security team discovered misconfigured permissions on critical files. To address this, corrective actions are being taken by the production support team. Specifically, the file named/etc/hostname
onNautilus App 3
server requires adjustments to its Access Control Lists (ACLs) as follows:1. The file's user owner and group owner should be set to
root
.2.
Others
should possessread only
permissions on the file.3. User
siva
must not have any permissions on the file.4. User
rod
should be grantedread only
permission on the file.
Please ensure to review the task instructions carefully and modify the commands according to your specific server, username, and other relevant details.
Solution:
ssh into
app server3
Set the user owner and group owner to root:
sudo chown root:root /etc/hostname
Set the file permissions to ensure 'others' have read-only access:
sudo chmod 644 /etc/hostname
Ensure user
siva
has no permissions on the file:sudo setfacl -m u:siva:--- /etc/hostname
Grant user
rod
read-only permission on the file:sudo setfacl -m u:rod:r-- /etc/hostname
Explanation:
chown root: Sets the owner and group of the file to
root
.chmod 644: Sets the file permissions so that the owner can read and write, the group can read, and others can read the file.
setfacl -m u:siva:---: Modifies the ACL to ensure that the user
siva
has no permissions on the file.setfacl -m u:rod:r--: Modifies the ACL to grant read-only permission to the user
rod
.
Verify the ACLs and Permissions
To verify that the permissions and ACLs have been set correctly, you can use the following commands:
Check file ownership and permissions:
ls -l /etc/hostname
You should see
-rw-r--r--
androot root
as the owner and group.Check ACLs on the file:
getfacl /etc/hostname
The output should show the ACLs, including the entries for
siva
androd
.
About me
Hi, I am Sachin Khamitkar and I am a passionate devops engineer and an Expert Support Engineer. As a DevOps enthusiast and technology fan, I am passionate about automating workflows, optimizing infrastructure, and improving deployment processes. I love sharing insights on cloud strategies, containerization, and continuous delivery. With 6 years of experience in Technical and Application Support, I have a strong foundation in DevOps practices. I excel in root cause analysis, SLA adherence, and enhancing software stability. My skills include log analysis, SQL reporting, and CI/CD pipeline optimization. I have a proven track record in deploying builds, patches, and maintaining production environments. Additionally, I bring expertise in incident, problem, and change management following ITIL standards. If you're as excited about DevOps as I am, let's connect ๐ me on LinkedIn๐๐ผ, GitHub๐ป๐, and Email๐ง for more tech tips, tutorials, and exciting projects! Let's innovate together and drive the future of DevOps! ๐๐ฉโ๐ป๐ก
Subscribe to my newsletter
Read articles from Sachin Khamitkar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Sachin Khamitkar
Sachin Khamitkar
Hi there, I am a learner first and then an IT enthusiast. I have started exploring and ocean of DevOps Tools and tech.