Exam EX200 All QuestionsBrowse all questions from this exam
Question 88

SIMULATION -

Copy /etc/fstab document to /var/TMP directory. According the following requirements to configure the permission of this document.

✑ The owner of this document must be root.

✑ This document belongs to root group.

✑ User mary have read and write permissions for this document.

✑ User alice have read and execute permissions for this document.

✑ Create user named bob, set uid is 1000. Bob have read and write permissions for this document.

✑ All users has read permission for this document in the system.

    Correct Answer:

    To copy the /etc/fstab document to the /var/TMP directory and configure its permissions according to the requirements, follow these steps: 1. Copy the document: cp /etc/fstab /var/TMP 2. Change the owner and group to root: chown root:root /var/TMP/fstab 3. Ensure all users have read permission: chmod o+r /var/TMP/fstab 4. Set specific permissions for user mary: setfacl -m u:mary:rw /var/TMP/fstab 5. Set specific permissions for user alice: setfacl -m u:alice:rx /var/TMP/fstab 6. Create user bob with UID 1000: useradd -u 1000 bob 7. Set specific permissions for user bob: setfacl -m u:bob:rw /var/TMP/fstab. These steps ensure that the document is correctly copied, ownership is set, and the required permissions are assigned to each specified user.

Discussion
STFN2019

Full solution: # cp /etc/fstab /var/tmp # chown root:root /var/tmp/fstab # useradd mary # useradd alice # useradd -u 1000 bob # setfacl -m u:mary:rw- /var/tmp/fstab # setfacl -m u:alice:r-x /var/tmp/fstab # setfacl -m u:bob:rw- /var/tmp/fstab # chmod o+r-- /var/tmp/fstab # getfact /var/tmp/fstab (to verify all permissions) # ls -ltr /var/tmp/fstab (to verify all permissions)

gigimakis

they dont ask to create mary and alice

adolfoale

# mkdir /var/tmp # useradd -g 1000 bob # setfacl -m u:mary:rw /var/tmp/fstab # setfacl -m u:alice:rx /var/tmp/fstab # setfacl -m u:bob:rw /var/tmp/fstab # setfacl -m o::r /var/tmp/fstab

FaridShakhh

Set UID #useradd -u 1000 bob

jahute27

the only thing i would change is: useradd -u 1000 bob

mattd81

Copy /etc/fstab document to /var/TMP directory. It says to copy to the /vat/TMP folder why are all the comments making changes to the /var/tmp/fstab directory?

tester27

fstab is not a directory, it is a file. so the file you'll modify and have now is the fstab under /var/tmp location

wizojlo

Since /var/tamp always exists anyway, no need to create it. #cp /etc/fstab /var/tmp #chown :root /var/tmp/fstab #useradd mary #useradd alice #useradd -u 1000 bob #setfacl -m u:mary:rw-,u:alice:r-x,u:bob:rw-,o::r /var/tmp/fstab

frusty

useradd -u 1000 --non-unique bob --in case the uid 1000 is already used