EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 98


SIMULATION -

Configure the permissions of /var/tmp/fstab

Copy the file /etc/fstab to /var/tmp/fstab. Configure the permissions of /var/tmp/fstab so that: the file /var/tmp/fstab is owned by the root user. the file /var/tmp/fstab belongs to the group root. the file /var/tmp/fstab should not be executable by anyone. the user natasha is able to read and write /var/tmp/fstab. the user harry can neither write nor read /var/tmp/fstab. all other users (current or future) have the ability to read /var/tmp/fstab.

Show Answer
Correct Answer:

To configure the permissions of /var/tmp/fstab as specified, follow these steps: 1. Copy the file /etc/fstab to /var/tmp/fstab using 'cp /etc/fstab /var/tmp/fstab'. 2. Ensure the file is owned by the root user and group using 'chown root:root /var/tmp/fstab'. 3. Make sure the file is not executable by anyone, which it is by default for this type of file. To be safe, use 'chmod a-x /var/tmp/fstab'. 4. Allow the user natasha to read and write the file using 'setfacl -m u:natasha:rw /var/tmp/fstab'. 5. Make sure the user harry has no permissions using 'setfacl -m u:harry:0 /var/tmp/fstab'. 6. Ensure all other users have read permissions using 'chmod o+r /var/tmp/fstab'. These steps collectively achieve the described permission setup for the file /var/tmp/fstab.

Discussion

2 comments
Sign in to comment
PENNSHARK
Jan 13, 2024

cp /etc/fstab /var/tmp/fstab chown root /var/tmp/fstab chown :root /var/tmp/fstab chmod 666 setfacl -m u:natasha:rw- /var/tmp/fstab setfacl -m u:harry:--- /var/tmp/fstab chmod o-w /var/tmp/fstab

gaven186
Jul 5, 2024

# cp -p /etc/fstab /var/tmp/fstab # chown root:root /var/tmp/fstab # chmod a-x /var/tmp/fstab # setfacl -m u:natasha:rw /var/tmp/fstab # setfacl -m u:harry:0 /var/tmp/fstab # chmod o+r /var/tmp/fstab