RH302 Premium Bundle

RH302 Premium Bundle

Red Hat Certified Engineer on Redhat Enterprise Linux 5 (Labs) Certification Exam

4.5 
(30570 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
November 23, 2024Last update

Red-Hat RH302 Free Practice Questions

Q1. CORRECT TEXT

neo user tried by:

dd if=/dev/zero of=/home/neo/somefile bs=1024 count=70

files created successfully. Again neo tried to create file having 70K using following command:

dd if=/dev/zero of=/home/neo/somefile bs=1024 count=70

But he is unable to create the file. Make the user can create the file less then 70K.

Answer and Explanation:

Very Tricky question from redhat. Actually question is giving scenario to you to implement quota to neo user. You should apply the quota to neo user on /home that neo user shouldn't occupied space more than 70K.

1. vi /etc/fstab

LABEL=/home /home ext3 defaults,usrquota 0 0 à To enable the quota on filesystem you should mount the filesystem with usrquota for user quota and grpquota for group quota.

2. touch /home/aquota.user àCreating blank quota database file.

3. mount -o remount /home à Remounting the /home with updated mount options. You can verify that /home is mounted with usrquota options or not using mount command.

4. quotacheck -u /home à Initialization the quota on /home

5. edquota -u neo /home à Quota Policy editor

See the snapshot

Disk quotas for user neo (uid 500):

Filesystem blocks soft hard inodes soft hard

/dev/mapper/vo-myvol 2 30 70 1 0 0

Can you set the hard limit 70 and soft limit as you think like 30.

Verify using the repquota /home command.

Answer:

Q2. CORRECT TEXT

Make Secondary belongs the jeff and marion users on sysusers group. But harold user should not belongs to sysusers group.

Answer and Explanation:

1. usermod -G sysusers jeff

2. usermod -G sysuser marion

3. Verify by reading /etc/group file

Using usermod command we can make user belongs to different group. There are two types of group one primary and another is secondary. Primary group can be only one but user can belongs to more than one group as secondary.

usermod -g groupname username à To change the primary group of the user

usermod -G groupname username à To make user belongs to secondary group.

Answer:

Q3. CORRECT TEXT

Run the squid proxy server on port 8080 by allowing internet access to 192.168.0.0/24 and block msn.com site to access.

Answer and Explanation:

1. vi /etc/squid/squid.conf

#detault:

http_port 8080

#Recommended minimum configuration:

# Near the src acl src section

acl allownet src 192.168.0.0/255.255.255.0

acl msnnet dstdomain .msn.com

#Default:

# http_access deny all

#Under Here

http_access deny msnnet

http_access allow allownet

2. service squid start

3. chkconfig squid on

squid is a proxy caching server, using squid we can share the internet, block the internet, to certain network. First we should define the port for squid, the standard port for squid is 3128. We can run squid on different port by specifying http_port portnumber.

To block or allow the Internet access to hosts, we should create the acl (Access Control List). In this file we can specify only the IP address.

Example: acl aclname src IP/Netmask

After creating acl we can block or allow the Internet to specified acl.

http_access allow | deny alcname

Answer:

Q4. CORRECT TEXT

There is a NFS server 192.168.0.254 and all required packages are dumped in /var/ftp/pub of that server and the /var/ftp/pub directory is shared. Install the Redhat Enterprise Linux 5 by creating following partitions:

/ 1000

/boot 200

/home 1000

/var 1000

/usr 4000

swap 2X256 (RAM SIZE)

Answer and Explanation:

Note: Examiner will provide you the Installation startup CD. And size may vary see on the exam paper.

1. Insert the CD on CD-ROM and start the system.

2. In Boot: Prompt type linux askmethod

3. It will display the language, keyboard selection.

4. It will ask you for the installation method.

5. Select the NFS Image from the list

6. It will ask the IP Address, Net mask, Gateway and Name Server. Select Use

Dynamic IP Configuration: because DHCP Server will be configured in your exam lab.

7. It will ask for the NFS Server Name and Redhat Enterprise Linux Directory.

Specify the NFS Server: 192.168.0.254

Directory: /var/ftp/pub

8. After Connecting to the NFS Server Installation start in GUI. Go up to the partition screen by selecting the different Options.

9. Create the partition According to the Question because Size and what-what partition should you create at installation time is specified in your question

10. Then select the MBR Options, time zone and go upto package selections.

It is another Most Important Time of installation. Due to the time limit, you should care about the installation packages. At Exam time you these packages are enough.

X-Window System

GNOME Desktop

(these two packages are generally not required)

Administration Tools.

System Tools

Windows File Server

FTP Servers

Mail Servers

Web Servers

Network Servers

Editors

Text Based Internet

Server Configuration Tools

Printing Supports

When installation will complete, your system will reboot. Jump for another Question.

Answer:

Q5. CORRECT TEXT

Your LAN is connected to WAN also. You want to deny the ssh coming from WAN. Configure using iptables to allow ssh connection only from the Local LAN where you LAN IP address is 192.168.0.0/24.

Answer and Explanation:

1. iptables -t filter -A INPUT -s ! 192.168.0.0/24 -p tcp --dport 22 -j DROP

iptables is the build-in firewall tools, used to filter the packets and for nat. By identifying Source Address, Destination Address, type of protocol, source and destination port we can filter the packets.

-sà Source Address

-dà Destination Address

-p à Layer 3 Protocol

-dàDestination Address

--sportà Source Prot

--dportàDestination Port

-ià Incoming Interface

-oà Outgoing Interface

-t à Table either filter or nat or mangle

-Aà Chain can be either INPUT, OUTPUT, FORWARD, PREROUTING, POSTROUTING.

ssh service use the 22 port so we can block connection from outside the LAN.

Answer:

Q6. CORRECT TEXT

Who ever creates the files/directories on /archive group owner should be automatically should be the same group owner of /archive.

Answer and Explanation:

1. chmod g+s /archive

2. Verify using: ls -ld /archive

Permission should be like:

drwxrws--- 2 root sysuser 4096 Mar 16 18:08 /archive

If SGID bit is set on directory then who every users creates the files on directory group owner automatically the owner of parent directory.

To set the SGID bit: chmod g+s directory

To Remove the SGID bit: chmod g-s directory

Answer:

Q7. CORRECT TEXT

There are three Disk Partitions /dev/hda8, /dev/hda9, /dev/hda10 having size 100MB of each partition. Create a Logical Volume named testvolume1 and testvolume2 having a size 250MB.

Mount each Logical Volume on lvmtest1, lvmtest2 directory.

Answer and Explanation:

Steps of Creating LVM:

1. pvcreate /dev/hda8 /dev/hda9 /dev/hda10

àpvdisplay command is used to display the information of physical volume.

2. vgceate test0 /dev/hda8 /dev/hda9 /dev/hda10

àvgdisplay command is used to display the information of Volume Group.

3. lvcreate -L 250M -n testvolume1 test0

à lvdisplay command is used to display the information of Logical Volume.

4. lvcreate -L 250M -n testvolume2 test0

5. mkfs -t ext3 /dev/test0/testvolume1

6. mkfs -t ext3 /dev/test0/testvolume2

7. mkdir /lvtest1

8. mkdir /lvtest2

9. mount /dev/test0/testvolume1 /lvtest1

10. mount /dev/test0/testvolume2 /lvtest2

11. vi /etc/fstab

/dev/test0/testvolume2 /lvtest2 ext3 defaults 0 0

/dev/test0/testvolume1 /lvtest1 ext3 defaults 0 0

To create the LVM( Logical Volume Manager) we required the disks having '8e' Linux LVM type.

First we should create the physical Volume, then we can create the Volume group from disks belongs to physical Volume. lvcreate command is used to create the logical volume on volume group. We can specify the size of logical volume with -L option and name with -n option.

Answer:

Q8. CORRECT TEXT

Boot your System Successfully on run level 3.

Answer and Explanation:

After completing the Boot loader problem, you will boot the system, but it goes to emergency mode. Remember that if System boots on Emergency mode that means file system problem.

You will get the Shell, remount the / filesystem with read and write mode.

1. First Find out the / filesystem using e2lable /dev/hda1, e2lable /dev/hda2 etc

2. mount -o remount,defaults /dev/hda? /

3. vi /etc/fstab

You will get like:

/root / ext3 defaults 1 1

or / /root ext3 defaults 1 1

4. Edit the file like:

/ / ext3 defaults 1 1

5. Configure the /etc/grub.conf file if just booting system by editing grub from grub prompt.

6. Reboot the system.

Answer:

Q9. CORRECT TEXT

Your Local Domain is example.com. Configure the send mail server for you local LAN.

Answer and Explanation:

1. vi /etc/mail/local-host-names

example.com

2. vi /etc/mail/sendmail.mc

dnl # DEAMON_OPTIONS(`Port=smtp,Addr=127.0.0.1,Name=MTA`)dnl

3. m4 /etc/mail/sendmail.mc >/etc/mail/sendmail.cf

4. vi /etc/mail/access

example.com RELAY

192.168.0 RELAY

5. service sendmail start | restart

6. chkconfig sendmail on

/etc/mail/local-host-names file contains the aliases to hostname. Mail server program reads the

/etc/mail/sendmail.cf. To change the configuration on mail server, we should edit the

/etc/mail/sendmail.mc file and should generate the sendmail.cf using m4 command.

By default sendmail server allows to connect to local host only. So we should edit the

/etc/mail/sendmail.mc file to allow connect to other hosts.

By default sendmail server will not forward mail. we should specify on /etc/mail/access to relay or to block mail coming from domain or network or individual email address.

Answer:

Q10. CORRECT TEXT

Fill up the Form through http://server1.example.com/form.php

Answer and Explanation:

1. Open the Browser and type the above URL.

2. Fill the form as required all information.

Answer:

Q11. CORRECT TEXT

You have DHCP server, which assigns the IP, gateway and DNS server ip to Clients. There are two DNS servers having MAC address (00:50:FC:98:8D:00, 00:50:FC:98:8C:00), in your LAN, But they always required fixed IP address (192.168.0.254, 192.168.0.253). Configure the DHCP server to assign the fixed IP address to DNS server.

Answer and Explanation:

1. vi /etc/dhcpd.conf

ddns-update-style none;

option routers 192.168.0.1;

option domain-name "example.com";

option domain-name-servers 192.168.0.254;

default-lease-time 21600;

max-lease-time 43200;

subnet 192.168.0.0 netmask 255.255.255.0

{

range 192.168.0.1 192.168.0.254;

host dns1 {

hardware ethernet 00:50:FC:98:8D:00;

fixed-address 192.168.0.254;

}

host dns2 {

hardware ethernet 00:50:FC:98:8C:00;

fixed-address 192.168.0.253;

}

}

/etc/dhcpd.conf file is used to configure the DHCP. Some global options i.e Gateway,

domainname, DNS server specified using option keyword. To assign as static ip from dhcp server,

required the mac address of interface.

2. Check the SELinux Context, should be like this:

-rw-r--r-- root root system_u:object_r:dhcp_etc_t /etc/dhcpd.conf

3. Use the restorecon -R /etc command to restore the selinux context of the file.

4. service dhcpd start | restart

Answer:

Q12. CORRECT TEXT

Set the Hostname station?.example.com where ? is your Host IP Address.

Answer and Explanation:

4. hostname station?.example.com àThis will set the host name only for current session. To set hostname permanently.

5. vi /etc/sysconfig/network

HOSTNAME=station?.example.com

6. service network restart

Answer:

Q13. CORRECT TEXT

Change the root Password to redtophat

Answer and Explanation: 

Boot the system in Single user modeUse the passwd command

Answer:

Q14. CORRECT TEXT

Your System is configured in 192.168.0.0/24 Network and your Domain nameserver is 192.168.0.254. Make successfully resolve to server1.example.com.

Answer and Explanation:

Very Easy question, nameserver is specified in question,

1. vi /etc/resolv.conf

nameserver 192.168.0.254

2. host server1.example.com

Answer:

Q15. CORRECT TEXT

Create the group named sysadmin.

Answer and Explanation:

1. groupadd sysadmin

groupadd command is used to create the group and all group information is stored in /etc/group file.

Answer:

START RH302 EXAM