Here are all the actual test exam dumps for IT exams. Most people prepare for the actual exams with our test dumps to pass their exams. So it's critical to choose and actual test pdf to succeed.

Exam EX200 Topic 5 Question 53 Discussion

Actual exam question for RedHat's EX200 exam
Question #: 53
Topic #: 5
Part 1 (on Node1 Server)
Task 4 [Controlling Access to Files]
Create collaborative directory /mnt/shares with the following characteristics:
Group ownership of /mnt/shares should be sharegrp.
The directory should be readable, writable and accessible to member of sharegrp but not to any other user. (It is understood that root has access to all files and directories on the system) Files created in /mnt/shares automatically have group ownership set to the sharegrp group.

Suggested Answer:

* [root@node1 ~]# mkdir -p /mnt/shares
[root@node1 ~]# ls -lrt /mnt/
[root@node1 ~]# chgrp sharegrp /mnt/shares/
[root@node1 ~]# chmod 2770 /mnt/shares/
[root@node1 ~]# ls -lrt /mnt/
### For Checking ###
[root@node1 ~]# su - harry
[harry@node1 ~]$ cd /mnt/shares/
[harry@node1 shares]$ touch harry
[harry@node1 shares]$ logout
[root@node1 ~]# su - natasha
[natasha@node1 ~]$ cd /mnt/shares/
[natasha@node1 shares]$ touch natasha
[natasha@node1 shares]$ ls -lrt
-rw-rw-r--. 1 harry sharegrp 0 Mar 21 06:03 harry
-rw-rw-r--. 1 natasha sharegrp 0 Mar 21 06:03 natasha

by whitebeard pirate at Nov 24, 2024, 11:10 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
whitebeard pirate
2024-12-22 17:13:06
#create dir
mkdir -p /mnt/shares
groupadd sharegrp (if not existing)

#make sharegrp group the owner
chgrp sharegrp /mnt/shares
or
chown :sharegrp /mnt/shares

#grant the sharegrp and thus its members the right to read and write and block other users
chmod 2770 /mnt/shares
or
chmod 770 /mnt/shares and chmod g+s /mnt/shares

#verify
ls -ld /mnt/shares
You should see something like:
drwxrws--- 2 root sharegrp 4096 <date> /mnt/shares
upvoted 1 times
...
whitebeard pirate
2024-11-24 11:10:54
1
Create the Directory /mnt/shares
Log in to the Node1 server as a root user or use a user with sudo privileges.
Create the directory:
mkdir -p /mnt/shares
2
Create the Group sharegrp
Check if the group already exists:
getent group sharegrp
If it doesn't exist, create it:
groupadd sharegrp
3
Change the Group Ownership of the Directory
Set the group ownership of /mnt/shares to sharegrp:
chown :sharegrp /mnt/shares
4
Set Directory Permissions
Use chmod to allow only members of the group to read, write, and access the directory:
chmod 2770 /mnt/shares
2: Sets the setgid bit so that files created in this directory inherit the group ownership (sharegrp).
7: Full permissions (read, write, execute) for the owner.
7: Full permissions for the group.
0: No permissions for others.
5
Verify Permissions
Check the permissions using:
ls -ld /mnt/shares
You should see something like:
drwxrws--- 2 root sharegrp 4096 <date> /mnt/shares
6
Add Users to the Group
Add users who need access to sharegrp:
usermod -aG sharegrp <username>
Replace <username> with the actual username.
Verify the user's group membership:
groups <username>
7
Test the Setup
Switch to a user who is a member of sharegrp and try creating a file:
su - <username>
touch /mnt/shares/testfile
Confirm the file's group ownership is sharegrp:
ls -l /mnt/shares/testfile
Switch to a user who is not a member of sharegrp and verify they cannot access the directory:
su - <non_group_user>
cd /mnt/shares
upvoted 1 times
...
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.