Exam EX200 All QuestionsBrowse all questions from this 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.

    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
jahute27

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

Brabus

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

sazz82

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

kitkat

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

kenkct

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

blackmrx

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

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

Dewitts68

execute permissions on a folder = Can Access

dax

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

Harvard

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

tester27

they're the same

Javier_Cruz

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

kenkct

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