EX200 Exam QuestionsBrowse all questions from this exam

EX200 Exam - Question 3


SIMULATION -

Create a catalog under /home named admins. Its respective group is requested to be the admin group. The group users could read and write, while other users are not allowed to access it. The files created by users from the same group should also be the admin group.

Show Answer
Correct Answer:

To accomplish the required tasks, the following commands should be executed: 1. First, create the directory under /home named admins: `mkdir /home/admins`. 2. Assign the directory to the admin group: `chown :admin /home/admins`. 3. Set the permissions so that admin group users can read and write, and set the sticky bit to ensure that files created inside the directory have the admin group by default: `chmod 2770 /home/admins`. Explanation: The `mkdir` command is used to create the directory. The `chown :admin` command assigns the directory to the admin group. The `chmod 2770` command sets the permissions: 2 ensures the sticky bit is set so that files created within inherit the group's ownership (sbit), 7 allows read, write, and execute permissions for the owner, 7 allows read, write, and execute permissions for the group, and 0 denies all permissions for other users. This setup conforms to the requirement that the group users should have read and write access while others are denied access, and that new files inherit the admin group.

Discussion

13 comments
Sign in to comment
Moram
Sep 12, 2020

If the group should only have read and write shouldn't the command be: chmod 760 /admins

kitkat
May 26, 2022

Permissions on the folder works different to that of files. Permissions needed are 2770 with 2760 users member of admin group will not be able to enter the folder.

Mari685
Jun 1, 2022

Hi can you give me some details about redhat

Joeytechn9t
Jun 4, 2021

#mkdir /home/admins #groupadd admin #chown root:admin /admins #chmod 770 /admins #chmod g+s

Rahul95
May 31, 2023

#mkdir -p /home/admins #chgrp admin /home/admins #chmod 770 /home/admins - 7 is for max permission for dir and 6 is for files #chmod g+s /home/admins #su - harry #touch /home/admins/testfile #ls-ltr /home/admins/ - to verify

RHEL
Feb 26, 2021

The right answer is chmod 770 because you need to have execution permission on the directory to have access to its content, so you can perform write and read process.

golem1987
Apr 13, 2021

2770 should be to allow also inheritance for group permissions

RedQuasar
Dec 12, 2020

mkdir /home/admins chown :admin /home/admins chmod u=rw,o=--- /home/admins chmod g+s /home/admins

adolfoale
Jan 16, 2021

For all of the above to work, the user must have the admin group as an additional group. Do the test.

AbidBajwa
Oct 6, 2021

mkdir admins groupadd admin chown :admin /home/admins chmod g+rw /home/admins chmod o-rwx /home/admins chmod g+s /homeadmins

cloudyhr
Jan 8, 2022

Did implemented practically and 770 is the correct answer chmod 2770 /home/admin same as above 3 chmod commands

stoobie
Feb 27, 2022

@cloudyhr Why do you have 2770 instead of just 770? And why is g+s necessary?

stoobie
Feb 27, 2022

I figured out the answer to my second question about g+s. The "s" (special permissions) is necessary so that files _created_ by users from the `admin` group are also _owned_ by the `admin` group.

kitkat
Aug 15, 2022

your first question's answer is same. 2 is equivalent of g+s

sugisho
Jul 11, 2021

which is correct permission /home/admin 760 or 770 ?

AluBhorta
Nov 27, 2021

2770 to be precise. it's because without exec permission, even group users won't be able to enter the dir (i.e. cd requires rx permission).

Mari685
Jun 5, 2022

can you help me in redhat need some details about it if possible dm me on instagram lvukhan123

yajala
Feb 23, 2024

I passed the RHSCA exam last week. This dump was useful but needs update for questions on writing simple shell scripts, container, Stratis and VDO. Thanks. Also, I think Redhat has increased the number of questions from 20 - 24. Mine were 24 questions on the exam. Thanks. https://medium.com/@darekhale91/latest-redhat-ex200-exam-dumps-2023-acd1c1922729

Rich102
Apr 4, 2024

They shut the medium link down. Under investigation. Can you provide another exam dump please ?

Nhan
Sep 19, 2020

2=Write 4 = read therefore r+w=6, Moran has the correct answer for setting chmod

Darion81
Oct 29, 2020

Depends. For directories - r - list files, w - add/del files, x - cd to that directory If yser should be able to enter it this dir should have x

syed2020
Jun 17, 2022

Without granting x permissions, group users will not be able to access the folder so it should be chmod 770 /home/admins

techzideas
Jan 31, 2023

mkdir -p /home/admins chown -R :admin /home/admins chmod 2070 /home/admins touch /home/admins/office.txt ll /home/admins Please Give me your views on this...

radwan_maazon
Feb 21, 2023

/home actualy exist so that you don't neet put -p

M_May87
Jun 5, 2024

# Create the directory mkdir /home/admins # Change the owner of the directory to root sudo chown root: /home/admins # Change the group of the directory to admin sudo chgrp admin /home/admins # Set the permissions so that the owner and the group can read and write, # but others cannot access it sudo chmod 770 /home/admins # Set the group ID on the directory so that files created within it # inherit the group of the directory (admin) rather than the group of the user that created the file sudo chmod g+s /home/admins