setfacl

Adrea is a RHEL Sysdadmin who has been tasked with the following:

  • Create a group named developers.
  • Create a new user name marquisj to the group. Marquis should have the default home directory and /bin/bash as his shell.
  • Create a new directory named /home/developers/mydocs.
  • Give the group developers read-only access to mydocs (using setfacl command).
  • Give Marquis read-write access to mydocs (using setfacl command).
  • Give all others no access to mydocs (using setfacl command).

Here are the commands that Adrea can use to complete the task:

  1. Create the developers group:
    • sudo groupadd developers
  2. Create the new user Marquis and add him to the developers group:
    • sudo useradd -m -s /bin/bash -G developers marquisj
  3. Create the new directory and set the owner to Marquis and the group to developers:
    • sudo mkdir /home/developers/mydocs
    • sudo chown marquisj:developers /home/developers/mydocs
  4. Give the group developers read-only access to mydocs using setfacl command:
    • sudo setfacl -m g:developers:r /home/developers/mydocs
  5. Give Marquis read-write access to mydocs using setfacl command:
    • sudo setfacl -m u:marquisj:rw /home/developers/mydocs
  6. Give all others no access to mydocs using setfacl command:
    • sudo setfacl -m o::--- /home/developers/mydocs

With these commands, Adrea has created the developers group, added the user Marquis to the group, created a new directory with the appropriate permissions, and used the setfacl command to give the developers group read-only access to the directory, Marquis read-write access, and all others no access.

You should also read:

setfacl

Charlie "Bird" Parker is a genius-level jazz alto saxophonist. He has just read a book about setfacl, in fact he memorized the entire…

setfacl

Charles Parker Jr. is a genius with an IQ somewhere north of 150. He leads his jazz quintet by night (in which he…

setfacl

Andre is a new employee at Red Hat who is struggling with copying ACLs from one file to another using getfacl and setfacl…

setfacl

Demea is a Master Linux Sysadmin at Red Hat. She has a multi-part task in from of her. Please list all of the…