RHEL6 RHCSA Sample exam 2

Share this link


This is a RHCSA sample exam. You’ve got 2 hours and half.

– 1GB of free space.

One precision: nobody checks your answers but solutions are provided.

1 Star2 Stars3 Stars4 Stars5 Stars (12 votes, average: 2.92 out of 5)
33 comments on “RHEL6 RHCSA Sample exam 2
  1. Matt says:

    You are setting/adding SELINUX contexts to the new /www/html folder….

    Couldn’t you have also used…

    chcon -R –reference=/var/www/html /www/html

    • CertDepot says:

      No, using the chcon command is not the best answer because changes could be removed after a reboot/relabel.
      With the semanage command, changes are definitive.

  2. Gianluca says:

    Hi, first thank you for your work on this site. It is very helpful
    On question 8, RHCSA sample 2, you suggest:
    1. # cd /home/tom
    2. # echo “/bin/echo Hello!” > cmd
    3. # setfacl -m u:steven:r-x cmd;
    4. # setfacl -m u:steven:–x ../tom
    5. # setfacl -m u:tom:— cmd
    6. # setfacl -m u:andrew:— cmd
    Since i’m using CentOS 6.4, the home directories are being created with 700 default permissions.
    For this reason, when another user try to access or execute a file inside tom’s directory, a “Permission denied” is received. Hence i think step 6 is useless.
    Correct me if i’m wrong.
    Best regards

    • CertDepot says:

      I think you are right. But, as there is no assumption regarding the home directories default permissions, I wouldn’t call step 6 useless but optional 😉

    • Saint says:

      An addition to meet the requirement “belonging to user and group root in tom‘s directory ”
      chown tom:root cmd

      Also we could alternatively use
      chmod 070 /home/tom/cmd in place of step 5.

      • CertDepot says:

        I don’t think you need to type ‘chown tom:root cmd‘. As you are root (assumed by the ‘#’ character), the file you create is owned by the root user and the root group.
        Concerning the step 5, as the owner is root, your solution can’t be valid.

  3. Ndi eddy says:

    A little bit confuse here. Is it chattr -d /root/dontcopy or chattr +d /root/dontcopy


    • CertDepot says:

      If I take the man page regarding chattr, it says:
      The operator “+” causes the selected attributes to be added to the
      existing attributes of the files; “-” causes them to be removed; and
      “=” causes them to be the only attributes that the files have.
      Also, the “d” option stands for “no dump”. Consequently, as we don’t want the file to be dumped, the option should be “+d”.
      You were right to be confuse, my answer was wrong. I’m correcting it right now.

  4. Saint says:

    For question 5, I am a little confused on size.
    what did you mean by 180PE (is it physical extents?)
    How is that size achieved with the command lvcreate –name lv_vol -l 180 vg?
    man page for lvcreate says that the default for size is megabytes.

    • CertDepot says:

      Yes, it is 180 Physical Extents. I have added this information for clarity.
      Concerning the lvcreate command, the -l option only takes a number of physical extents as argument or a pourcentage if you append %VG, %PVS, %FREE, %ORIGIN.

  5. barks says:

    First, a big thanks for the work put into this web page. It’s a great resource.
    Question 9 in Quiz 2
    The setfacl for access to Tom’s home dir for Steven; # setfacl -m u:steven:–x ../tom
    shouldn’t the command include r (read) so the files can be listed?
    # setfacl -m u:steven:r-x ../tom

  6. bazimov says:

    Hi, I would like to thank you for this website and your hard work. I have passed the RHCSA recently. I do not want to lay out the questions here but I had hard time on finding the device for creating Volume group plus swap. I was clearly good at LVM and Swap creation, but could not locate the device. Do you think device block is hidden or did I need special skills to locate the device?

    • CertDepot says:

      Hi, to get some information about the configuration, you could use the following commands:
      – ‘fdisk -l’: to know the available partitions,
      – ‘vgdisplay’/’vgs’: to get the list of volume groups and their free space,
      – ‘lvdisplay’/’lvs’: to get the list of logical volumes.
      Then, if no space was available, you had to create a new partition or decrease the size of an existing logical volume (with eventual reboot in single user mode if necessary).
      This is not always an easy operation 😉

      • bazimov says:

        Yeah, I probably spend much of my time looking for it then got short on time. I was following the saying of do the easiest ones first, and partitions were easiest ones in my mind. decreasing did not come to my mind. I could do that, decrease the root / dir and make me enough of a space for 1G or so. fdisk -l did not give any extra option. Well yeah I should have done some trick like that decrease and create that LV. But I am glad I have passed, that is really great feeling to see the ‘PASS’. Thanks for your materials here, I will try to use as much of these here and other books included.

  7. kyle.r says:

    Likely a preference, but instead of a REJECT statement in the iptables rules, you could have simply specified a source subnet from which to accept SSH traffic on port 22

    -A INPUT -s sourceCIDR -m tcp -p tcp –dport 22 -j ACCEPT

    • CertDepot says:

      Yes, you are right.

      • needingsleep3 says:

        When I saw that question, I thought about changing the commented ‘AddressFamily’ value on /etc/ssh/sshd_config with the required IP range. Do you guys reckon that it should do the trick, or does it have to be IPtables? Thanks.

        • CertDepot says:

          ‘AddressFamily’ doesn’t exist. AddressFamily only allows any, inet and inet6 values. This directive specifies which address family is used by ssh (see man sshd_config).
          ‘ListenAddress IPv4|IPv6’ specifies the local address, in fact the one assigned to the local network interface, sshd should listen on.
          Sorry, but both directives can’t satisfy the requirement.

  8. sherzod says:

    For question 5, if you need to find the location of the file, issue

    rpm -ql (lower case L) vsftpd | grep TUNING

  9. Neeraj says:

    Question 8: This command at line # 4 in the hint ” # cp -rp /var/www /www” seems to be incorrect.
    This is because when you do this, it copies the www directory as well to the destination “/www” directory. So the dir structure ends up becoming “/www/www” at the destination end. IT should instead of
    cp -rp /var/www/* /www

  10. jayc says:

    I passed my RHCSA recently with a score of 283/300. I just wanted to thank you for the many resources that you have available on your site. They helped me out tremendously.

  11. maksudur1 says:

    # echo “Hello world!” >/www/html/index.html —that doesn’t work on my rhel-6 machine but > /var/www/html/index.html is working.

  12. maksudur1 says:

    an easy way—
    #yum install httpd -y
    #yum install elinks -y
    #cd /var/www/html
    #vim index.html
    “hello world”
    #service httpd reload
    #elinks http://localhost

Leave a Reply

Upcoming Events (Local Time)

There are no events.

RHCSA7: Task of the day

Allowed time: 15 minutes.
Get an iso image of CentOS 7 (or a DVD) and set up a local repository.

RHCE7: Task of the day

Allowed time: 8 minutes.
Set up an iScsi target based on a block backstore of 100MB called lv_iscsi with basic authentication, ext4 filesystem and standard firewall configuration.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...