EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 30


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 Answer
Correct Answer:

To create a shared directory /home/admins with the described characteristics, follow these steps: First, create the directory using the command 'mkdir /home/admins'. Next, if the group 'adminuser' does not already exist, create it using the command 'groupadd adminuser'. Then, change the group ownership of the directory to 'adminuser' with the command 'chown :adminuser /home/admins'. Following this, set the permissions to allow the group members to read and write but also set the setgid bit so new files inherit the group with 'chmod g+rws /home/admins'. This combination ensures that the directory belongs to the group 'adminuser', it is readable and writable by group members, and any files created within the directory will automatically have the group 'adminuser'.

Discussion

8 comments
Sign in to comment
jahute27
Sep 15, 2021

mkdir -p /home/admins groupadd adminuser chown :adminuser /home/admins setfacl -m g:adminuser:rwx /home/admins chmod g+s /home/admins/

Brabus
Feb 3, 2023

This directory can be read and written, so setfacl -m g:adminuser:rw- /home/admins

sazz82
Apr 29, 2023

chmod -R g+s /home/admins/ > what about this option ?

kitkat
Jun 14, 2022

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

dax
Dec 18, 2020

mkdir /home/admins groupadd adminuser ls -ld /home/admins chgrp adminuser /home/admins ls -ld /home/admins chmod g+w /home/admins

blackmrx
Jun 27, 2021

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

kitkat
Jun 14, 2022

question only talks about read, write and there is no mention of execute. Why were we giving execute permission ?

Dewitts68
May 15, 2023

execute permissions on a folder = Can Access

kenkct
Mar 2, 2022

$ sudo su # mkdir -p /home/admins # groupadd adminuser # chown :adminuser /home/admins # chmod g+rws /home/admins # getfacl /home/admins

Harvard
Jul 7, 2021

why not use chown :adminuser /admins as opposed to chgrp?

tester27
May 17, 2022

they're the same

kenkct
Mar 2, 2022

$ sudo su # mkdir /home/admins # groupadd adminuser # chown :adminuser /home/admins # chmod g+rws /home/admins # getfacl /home/admins

Javier_Cruz
Apr 10, 2022

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