Restrict access to a web page

Rex is a RHEL Sysdamin at Djere Services Group. Djere_RHEL_Server_01 hosts the Djere website: There are several groups on the server:

  • admins
  • web_designers
  • web_developers
  • authors
  • front_end_engineers

Rex wants to set it so that all groups have read access to, but web_developers only have read-write access once they authenticate with the password "1465865_pass_293404#@!".  How is Rex going to set this up?

To achieve the desired access control setup on Djere_RHEL_Server_01, Rex can follow these steps:

  1. Grant read access to all groups: First, Rex needs to ensure that all groups have read access to the Djere website. He can set the appropriate file permissions using the following command:
    • sudo chmod -R g+r /path/to/
    • This command recursively grants read access (g+r) to all files and directories within the /path/to/ directory.

  2. Create a separate directory for web_developers: Rex can create a specific directory where web_developers will have read-write access once they authenticate. For example:
    • sudo mkdir /path/to/
  3. Set read-only access for web_developers initially: Rex can restrict web_developers' access to read-only by changing the file permissions on the web_developers directory:
    • sudo chmod -R 550 /path/to/
    • This command sets read and execute permissions for the owner (Rex), and no permissions for the group (web_developers) and others.
  4. Set password authentication for write access: Rex can enable password authentication specifically for the web_developers group on the web_developers directory. He can accomplish this by creating an .htaccess file and configuring it to require a password:
    • sudo htpasswd -c /path/to/ web_developers
    • This command creates an .htpasswd file and adds the web_developers group with the password "1465865_pass_293404#@!".
  5. Grant write access to authenticated web_developers: Finally, Rex needs to modify the file permissions to allow write access to the web_developers group when they authenticate with the correct password:
    • sudo chmod -R 570 /path/to/
    • This command grants read, write, and execute permissions to the owner (Rex), read and execute permissions to the group (web_developers), and no permissions for others.

By following these steps, Rex can ensure that all groups have read access to the Djere website, while web_developers can obtain read-write access by authenticating with the specified password.

You should also read:

Access remote systems using SSH

Context: RHCSA certification Access remote systems using SSH In the context of the RHCSA (Red Hat Certified System Administrator) certification, SSH (Secure Shell)…