Red Hat Certified System Administrator (RHCSA) Exam Questions

Here you have the best Red Hat EX200 practice exam questions.

Some things you may want to keep in mind about this practice exam questions:

  • You have 109 total questions to study from
  • Each page has 5 questions, making a total of 22 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on September 11, 2024

Question 1 of 109


SIMULATION -

Configure your Host Name, IP Address, Gateway and DNS.

Host name: station.domain40.example.com

/etc/sysconfig/network

hostname=abc.com

hostname abc.com

IP Address:172.24.40.40/24 -

Gateway172.24.40.1 -

DNS:172.24.40.1 -

    Correct Answer:

    To configure the Host Name, IP Address, Gateway, and DNS, follow these steps: To set the hostname to station.domain40.example.com, edit the file /etc/sysconfig/network: 'HOSTNAME=station.domain40.example.com'. For the IP Address, Gateway, and DNS configuration, navigate to /etc/sysconfig/network-scripts/ and edit the ifcfg-eth0 file to include the following: IPADDR=172.24.40.40, PREFIX=24, GATEWAY=172.24.40.1, and DNS1=172.24.40.1. Applying these settings through editing configuration files ensures the network settings are preserved across reboots.

Question 2 of 109


SIMULATION -

Add 3 users: harry, natasha, tom.

The requirements: The Additional group of the two users: harry, Natasha is the admin group. The user: tom's login shell should be non-interactive.

    Correct Answer:

    To add three users and meet the specified requirements, follow these steps systematically. First, create an 'admin' group if it doesn't already exist, which is needed for the additional groups of Harry and Natasha. Add Harry and Natasha to the system, making sure they are also part of the 'admin' group. Add Tom to the system with a non-interactive login shell. Then verify the changes. Here are the commands you would use, along with verification steps: 1. `groupadd admin` (Creates the 'admin' group if it doesn't exist). 2. `useradd -G admin harry` (Creates the user 'harry' and adds 'harry' to the 'admin' group). 3. `useradd -G admin natasha` (Creates the user 'natasha' and adds 'natasha' to the 'admin' group). 4. `useradd -s /sbin/nologin tom` (Creates the user 'tom' and sets the shell to non-interactive). 5. `id harry; id natasha` (Displays the user information to verify additional groups). 6. `cat /etc/passwd | grep tom` (Displays the user information to verify the login shell is non-interactive). This sequence ensures that the requirements are met and verified.

Question 3 of 109


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.

    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.

Question 4 of 109


SIMULATION -

Configure a task: plan to run echo hello command at 14:23 every day.

    Correct Answer:

    To configure a task to run the 'echo hello' command at 14:23 every day, you would use the cron job scheduler in Linux. The correct steps are as follows: 1. Open the cron job editor by running 'crontab -e'. 2. Add the line '23 14 * * * /bin/echo hello' to the file. This line schedules the 'echo hello' command to run at 14:23 every day. The fields in the line represent: minute (23), hour (14), day of the month (*), month (*), and day of the week (*). 3. Save the file and exit the editor. 4. To verify the scheduled cron job, you can run 'crontab -l'.

Question 5 of 109


SIMULATION -

Find the files owned by harry, and copy it to catalog: /opt/dir

    Correct Answer:

    To find all files owned by the user 'harry' and copy them to the directory /opt/dir, you can use the following set of commands: 1) Change to the /opt directory using the command cd /opt. 2) Create the directory if it does not already exist using mkdir -p dir. 3) Use the find command to locate all files owned by 'harry' and copy them to /opt/dir using find / -type f -user harry -exec cp -p {} /opt/dir/ \;. The -p option in the cp command preserves the attributes of the files. So, the complete set of commands will be: cd /opt; mkdir -p dir; find / -type f -user harry -exec cp -p {} /opt/dir/ \;.