exam questions

Exam EX200 All Questions

View all questions & answers for the EX200 exam

Exam EX200 topic 1 question 23 discussion

Actual exam question from RedHat's EX200
Question #: 23
Topic #: 1
[All EX200 Questions]

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

Show Suggested Answer Hide Answer
Suggested Answer: See explanation below.
# cp /etc/fstab /var/tmp/
# chgrp admin /var/tmp/fstab
# setfacl -m u:user1:rwx /var/tmp/fstab
# setfacl -m u:user2:--- /var/tmp/fstab
# ls -l
-rw-rw-r--+ 1 root admin 685 Nov 10 15:29 /var/tmp/fstab

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
adolfoale
Highly Voted 3 years, 10 months ago
# cp /etc/fstab /var/tmp/ # setfacl -m u:user1:rw- /var/tmp/fstab # setfacl -m u:user2:--- /var/tmp/fstab
upvoted 12 times
safodz
3 years, 1 month ago
to mainte the right I think need use cp with the -r option ?
upvoted 1 times
Testo321
1 year ago
To mainte owner/group/right it is -p option.
upvoted 1 times
...
...
Gbecker
3 years, 7 months ago
I agree with you. The question never says that you must change owner group.
upvoted 3 times
STFN2019
3 years, 2 months ago
Exactly. Perhaps it says with file named admin but then you never know. Will stick with adolfoale's answer for now.
upvoted 1 times
...
...
...
maxim_sk
Highly Voted 2 years, 4 months ago
# 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
upvoted 8 times
...
loloski
Most Recent 4 months, 3 weeks ago
cp /etc/fstab /var/tmp/admin setfacl -m u:user1:rw- /var/tmp/admin setfacl -m u:user2:--- /var/tmp/admin
upvoted 1 times
...
gaven186
7 months ago
"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.
upvoted 1 times
...
14_aman
2 years, 6 months ago
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.
upvoted 1 times
...
mattd81
2 years, 8 months ago
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?
upvoted 1 times
...
vira5489
3 years ago
-- 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
upvoted 2 times
xXxM__JxXx
2 years, 8 months ago
why include do not create home on the user creation? is this required?
upvoted 1 times
...
...
gunwantk
3 years, 1 month ago
Please correct the question statement.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...