EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 23


SIMULATION -

Copy /etc/fstab to /var/tmp name admin, the user1 could read, write and modify it, while user2 without any permission.

Show Answer
Correct Answer:

To achieve the requirements specified in the question, you need to perform the following steps: First, copy the file /etc/fstab to /var/tmp and name it admin. Then, set the access control list (ACL) to grant user1 read, write, and execute permissions and ensure user2 has no permissions. Here is how you can do it: 1. # cp /etc/fstab /var/tmp/admin 2. # setfacl -m u:user1:rwx /var/tmp/admin 3. # setfacl -m u:user2:--- /var/tmp/admin 4. # ls -l /var/tmp/admin These commands will copy the file and set the necessary permissions for user1 and user2.

Discussion

8 comments
Sign in to comment
adolfoale
Jan 17, 2021

# cp /etc/fstab /var/tmp/ # setfacl -m u:user1:rw- /var/tmp/fstab # setfacl -m u:user2:--- /var/tmp/fstab

Gbecker
May 3, 2021

I agree with you. The question never says that you must change owner group.

STFN2019
Sep 16, 2021

Exactly. Perhaps it says with file named admin but then you never know. Will stick with adolfoale's answer for now.

safodz
Oct 20, 2021

to mainte the right I think need use cp with the -r option ?

Testo321
Nov 13, 2023

To mainte owner/group/right it is -p option.

maxim_sk
Jul 9, 2022

# I think that in question is to name the file admin cp /etc/fstab /var/tmp/admin #to check try: cat /var/tmp/admin setfacl -m u:user1:rw-,u:user2:--- /var/tmp/admin #check correct permission with getfacl getfacl /var/tmp/admin

gunwantk
Oct 15, 2021

Please correct the question statement.

vira5489
Nov 24, 2021

-- lets assume you do not have any user yet. useradd -M user1 useradd -M user2 cp /etc/fstab /vat/tmp/ setfacl -m u:user1:rw- /var/tmp/fstab setfacl -m u:user2:--- /vat/tmp/fstab

xXxM__JxXx
Mar 25, 2022

why include do not create home on the user creation? is this required?

mattd81
Mar 30, 2022

Why are the setfacl changes being made to the /var/tmp/fstab folder? Isn't it just asking to change the permissions on /var/tmp?

14_aman
May 31, 2022

I have many doubts in this question . the question does not say for making owner to admin. and I think question says admin and user1 give r w x permission, after seeing this question.

gaven186
May 5, 2024

"to /var/tmp name admin" cp -p /etc/fstab /var/tmp/admin chown user1 /var/tmp/admin chmod 700 /var/tmp/admin this way user1 as owner, user2 is considered as 'other' without access permission.

loloski
Jul 11, 2024

cp /etc/fstab /var/tmp/admin setfacl -m u:user1:rw- /var/tmp/admin setfacl -m u:user2:--- /var/tmp/admin