exam questions

Exam EX200 All Questions

View all questions & answers for the EX200 exam

Exam EX200 topic 1 question 30 discussion

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

SIMULATION -
Create a Shared Directory.
Create a shared directory /home/admins, make it has the following characteristics:
/home/admins belongs to group adminuser
This directory can be read and written by members of group adminuser Any files created in /home/ admin, group automatically set as adminuser.

Show Suggested Answer Hide Answer
Suggested Answer: See explanation below.
mkdir /home/admins
chgrp -R adminuser /home/admins
chmodg+w /home/admins
chmodg+s /home/admins

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
jahute27
Highly Voted 3 years, 2 months ago
mkdir -p /home/admins groupadd adminuser chown :adminuser /home/admins setfacl -m g:adminuser:rwx /home/admins chmod g+s /home/admins/
upvoted 8 times
Lazylinux
3 months, 3 weeks ago
you answer is correct i.e. however you missed on -R as by using -R you are ensuring that permissions are applied recursively - down the driectory. However no NEED to use setfacl at all in this case as this command will suffice chmod g+rwxs or if you like chmod g=rwxs will suffice. You only need to use setfacl if there is speciall requirement i.e. granting access to another user or group that are not members of the group adminuser => lets say you want to allow user max read only in this case setfacl -m u:max:r--
upvoted 1 times
...
sazz82
1 year, 7 months ago
chmod -R g+s /home/admins/ > what about this option ?
upvoted 1 times
Lazylinux
3 months, 3 weeks ago
U are correct just read my above point
upvoted 1 times
...
...
Brabus
1 year, 10 months ago
This directory can be read and written, so setfacl -m g:adminuser:rw- /home/admins
upvoted 3 times
Lazylinux
3 months, 3 weeks ago
Incorrect, you MUST assign the execute permission too on directory as without x - even if you have RW you still will NOT be able to access the directory and hence access denied, you can try it to confirm your doubt => so setfacl -m g:adminuser:rwx /home/admins is correct
upvoted 1 times
...
...
...
kitkat
Most Recent 2 years, 5 months ago
mkdir -p /home/admins cd /home chown :adminuser /home/admins chmod g+rws/home/admins --to test useradd -g adminuser test su - test cd /home/admins touch testfile ls -ltr
upvoted 4 times
...
Javier_Cruz
2 years, 7 months ago
groupadd adminuser mkdir /home/admins chown :adminuser /home/admins chmod 770 /home/admins chmod g+s /home/admins With any user in adminuser group touch /home/admins/file ls -ltr /home/admins -rw-r--r--. 1 test1 adminuser 0 Apr 9 20:19 file
upvoted 1 times
...
kenkct
2 years, 9 months ago
$ sudo su # mkdir -p /home/admins # groupadd adminuser # chown :adminuser /home/admins # chmod g+rws /home/admins # getfacl /home/admins
upvoted 3 times
...
kenkct
2 years, 9 months ago
$ sudo su # mkdir /home/admins # groupadd adminuser # chown :adminuser /home/admins # chmod g+rws /home/admins # getfacl /home/admins
upvoted 1 times
Lazylinux
3 months, 3 weeks ago
Incorrect as you had missed on the x permission on the directory - users will get access denied with out the x regardless if they have rw or NOT => so should be chmod g+rwxs
upvoted 1 times
...
...
Harvard
3 years, 5 months ago
why not use chown :adminuser /admins as opposed to chgrp?
upvoted 2 times
tester27
2 years, 6 months ago
they're the same
upvoted 1 times
...
...
blackmrx
3 years, 5 months ago
mkdir /home/admins groupadd adminuser chgrp adminuser /home/admins chmod g=rwx /home/admins chmod g+s /home/admins To test for it : useradd -g adminuser test sudo -u test touch /home/admins/test sudo -u test ls
upvoted 3 times
kitkat
2 years, 5 months ago
question only talks about read, write and there is no mention of execute. Why were we giving execute permission ?
upvoted 2 times
Dewitts68
1 year, 6 months ago
execute permissions on a folder = Can Access
upvoted 1 times
...
...
...
dax
3 years, 11 months ago
mkdir /home/admins groupadd adminuser ls -ld /home/admins chgrp adminuser /home/admins ls -ld /home/admins chmod g+w /home/admins
upvoted 3 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 ...