RH302 Premium Bundle

RH302 Premium Bundle

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

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

Red-Hat RH302 Free Practice Questions

Q1. CORRECT TEXT

Add a job on Cron schedule to display Hello World on every two Seconds in terminal 8.

Answer and Explanation:cat >schedule

*/2 * * * * /bin/echo "Hello World" >/dev/tty8crontab scheduleVerify using: crontab -lservice crond restart

Cron helps to schedule on recurring events. Pattern of Cron is:

Minute Hour Day of Month Month Day of Week Commands

0-59 0-23 1-31 1-12 0-7 where 0 and 7 means Sunday.

Note * means every. To execute the command on every two minutes */2.

To add the scheduled file on cron job: crontab filename

To List the Cron Shedule: crontab -l

To Edit the Schedule: crontab -e

To Remove the Schedule: crontab -r

Answer:

Q2. CORRECT TEXT

There are two different networks, 192.168.0.0/24 and 192.168.1.0/24. Your System is in 192.168.0.0/24 Network. One RHEL 4 Installed System is going to use as a Router. All required configuration is already done on Linux Server. Where 192.168.0.254 and 192.168.1.254 IP Address are assigned on that Server. How will make successfully ping to 192.168.1.0/24 Network's Host?

Answer and Explanation:

1. vi /etc/sysconfig/network

GATEWAY=192.168.0.254

OR

vi /etc/sysconf/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=static

ONBOOT=yes

IPADDR=192.168.0.?

NETMASK=255.255.255.0

GATEWAY=192.168.0.254

2. service network restart

Answer:

Q3. CORRECT TEXT

Change the root Password to redtophat

Answer and Explanation:

Boot the system in Single user modeUse the passwd command

Answer:

Q4. CORRECT TEXT

Share the /data directory only to example.com members. These hosts should get read and write access on shared directory.

Answer and Explanation:

1. vi /etc/exports

/data *.example.com(rw,sync)

2. service nfs start

3. service portmap restart

4. chkconfig nfs on

5. chkconfig portmap on

In Linux to share the data we use the /etc/exports file. Pattern is:

Path client(permission)

Shared Directory Path, Client can be single host or domain name or ip address. Permission should specify without space with client lists in parentheses.

Answer:

Q5. CORRECT TEXT

Backup of the Redhat Enterprise Linux 5 is on /var/ftp/pub, /var/www/html/pub on server named server1.example.com. You can install all required packages using yum by creating the repository file.

Answer and Explanation:

1. Create the repository file

#vi /etc/yum.repos.d/server1.repo

[station?]

name=station?

baseurl=ftp://server1.example.com/pub/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

# yum install <packagename>

Answer:

Q6. CORRECT TEXT

Add a job on Cron schedule to display Hello World on every two Seconds in terminal 8.

Answer and Explanation:

1. cat >schedule

*/2 * * * * /bin/echo "Hello World" >/dev/tty8

3. crontab schedule

4. Verify using: crontab -l

5. service crond restart

Cron helps to schedule on recurring events. Pattern of Cron is:

Minute Hour Day of Month Month Day of Week Commands

0-59 0-23 1-31 1-12 0-7 where 0 and 7 means Sunday.

Note * means every. To execute the command on every two minutes */2.

To add the scheduled file on cron job: crontab filename

To List the Cron Shedule: crontab -l

To Edit the Schedule: crontab -e

To Remove the Schedule: crontab -r

Answer:

Q7. CORRECT TEXT

You are giving RHCE exam. Examiner gave you the Boot related problem and told to you that make successfully boot the System. While booting system, you saw some error and stop the boot process by displaying some error messages.

Kernel Panic - not syncing: Attempted to kill init!

And no further boot process. What you will do to boot the system.

Answer and Explanation:

To understand the role of a boot loader, take a step back from Linux. When you boot your computer, the BIOS starts by detecting basic hardware, including your hard drives. Once it's done, it looks for the boot loader on the Master Boot Record of the first available disk. If you're working with an older PC, the BIOS can't find your boot loader unless it's located within the first 1,024 cylinders of the hard disk.

Newer BIOSes overcome this problem with Logical Block Addressing, which is also known as LBA mode. LBA mode reads 'logical' values for the cylinder, head, and sector, which allows the BIOS to 'see' a larger disk drive.

If you have multiple hard drives, there is one more caveat. If your drives are IDE hard drives, the /boot directory must be on a hard drive attached to the primary IDE controller. If your drives are all SCSI hard drives, the /boot directory must be located on a hard drive with SCSI ID 0 or ID 1. If you have a mix of hard drives, the /boot directory must be located on either the first IDE drive or a SCSI drive with ID 0. In other words, this is not an issue on the Red Hat exams unless the computer that you're tested on has more than two hard drives. And I believe that's less likely, as that would increase the cost of the exam.

If you are getting the Kernel panic error, it means it is boot loader related problem. Redhat Enterprise Linux uses the GRUB boot loader. You can pass the kernel parameter from the boot loader as well as you can correct the kernel parameter passing from boot loader from GRUB screen at boot time.

GRUB boot loader configuration file is: /etc/grub.conf

And Correct Configuration is:

default=0

timeout=5

splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu

title Red Hat Enterprise Linux ES (2.6.9-5.EL)

root (hd0,0)

kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/ rhgb quiet

initrd /initrd-2.6.9-5.EL.img

Probably miss-configured the boot loader, so giving this problem. You can pass the correct parameter from GRUB prompt:

If you know all parameters and sequence of the boot loader you can enter in command prompt also.

Press c on GRUB screen.

Grub> root (hd0,0)

grub> kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/ rhgb quiet

grub> initrd /initrd-2.6.9-5.EL.img

grub>boot

Answer:

Q8. CORRECT TEXT

Your System is going to use as a Router for two networks. One Network is 192.168.0.0/24 and Another Network is 192.168.1.0/24. Both network's IP address has assigned. How will you forward the packets from one network to another network?

Answer and Explanation:

1. echo "1" >/proc/sys/net/ipv4/ip_forward

2. vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

If you want to use the Linux System as a Router to make communication between different networks, you need enable the IP forwarding. To enable on running session just set value 1 to /proc/sys/net/ipv4/ip_forward. As well as automatically turn on the IP forwarding features on next boot set on /etc/sysctl.conf file.

Answer:

Q9. CORRECT TEXT

Add a new logical partition having size 100MB and create the /data which will be the mount point for the new partition.

Answer and Explanation:

Use fdisk /dev/hda àTo create new partition.Type n àFor New partitionsIt will ask for Logical or Primary Partitions. Press l for logical.It will ask for the Starting Cylinder: Use the Default by pressing Enter Key.Type the Size: +100M àYou can Specify either Last cylinder of Size here.Press P to verify the partitions lists and remember the partitions name.Press w to write on partitions table.Either Reboot or use partprobe command.Use mkfs -t ext3 /dev/hda?Ormke2fs -j /dev/hda? àTo create ext3 filesystem.vi /etc/fstabWrite:/dev/hda? /data ext3 defaults 0 0Verify by mounting on current Sessions also:mount /dev/hda? /data

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

Create the user named user1, user2, user3

Answer and Explanation:

1. useradd user1

2. useradd user2

3. useradd user3

4. passwd user1

5. passwd user2

6. passwd user3

We create the user using useradd command and we change the password of user using passwd command. If you want to set the blank password use: passwd -d username.

Answer:

Q12. CORRECT TEXT

There are mixed lots of System running on Linux and Windows OS. Some users are working on Windows Operating System. You want to make available /data directory to samba users only from 192.168.0.0/24 network. Configure the samba server.

Answer and Explanation:

1. vi /etc/samba/smb.conf

[global]

netbios name=station?

workgroup = mygroup

server string=Share from Linux Server

security=user

smb passwd file=/etc/samba/smbpasswd

encrypt passwords=yes

hosts allow=192.168.0.

[data]

path=/data

writable=yes

public=no

browsable=yes

2. service smb start| restart

3. chkconfig smb on

Samba servers helps to share the data between linux and windows. Configuration file is /etc/samba/smb.conf. There are some pre-defined section, i. global à use to define the global options, ii. Printers à use to share the printers, iii. homes à use to share the user's home directory.

Security=user à validation by samba username and password. May be there are other users also.

To allow certain share to certain user we should use valid users option.

smbpasswd à Helps to change user's smb password. -a option specifies that the username following should be added to the local smbpasswd file.

If any valid users option is not specified, then all samba users can access the shared data. By Default shared permission is on writable=no means read only sharing. Write list option is used to allow write access on shared directory to certain users or group members.

To allow access the shared directory only from certain network or hosts, there is a option hosts allow= host or network. If this option is applied on global option, then it will apply to all shared directory.

Answer:

Q13. CORRECT TEXT

Successfully resolv to server1.example.com where your DNS server is 172.24.254.254

Answer and Explanation:

1. vi /etc/resolv.conf

nameserver 172.24.254.254

2. host server1.example.com

On every clients, DNS server is specified in /etc/resolv.conf. When you request by name it tries to resolve from DNS server.

Answer:

Q14. CORRECT TEXT

You are working as an administrator of example.com domain. There are five web servers( www), three mail servers(mail1, mail2, mail). Configure the DNS for www, mail, mail1, mail2 by specifying mail.example.com is the Primary Mail Server for example.com domain. Where 192.168.100.1-5 for www, 6,7,8 for mail, mail1, m ail2 and 192.168.0.X for DNS.

Answer and Explanation:

1. Rename the file named.caching-nameserver.conf into named.conf file located into

/var/named/chroot/etc

#mv /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/named.conf

2. Check the permission and ownership as well as SELinux Context should be like as:

-rw-r----- root named system_u:object_r:named_conf_t /var/named/chroot/etc/named.conf

If selinux context is mismatch use the restorecon -R /var command

3. vi /etc/named.conf

zone "example.com" IN {

type master;

file "example.com.zone";

};

/var/named/chroot/etc/named.conf file is used to register the zone as well as specify the global option for DNS server. There are two types of zone, i. Master, which contains the original data. ii.

Slave, backup of master. Here is the example of master zone configuration.

4. vi /var/named/chroot/var/named/example.com.zone

$TTL 345345

@ IN SOA @ webmaster.example.com.(

101; Serial Number

1H; Refresh Time

1M; Retry Time

1W; Expire Time

1D; Minimum Time to Live

)

@ IN NS 192.100.0.X

www 0 IN A 192.100.0.1

www 0 IN A 192.100.0.2

www 0 IN A 192.100.0.3

www 0 IN A 192.100.0.4

www 0 IN A 192.100.0.5

mail IN A 192.100.0.6

mail1 IN A 192.100.0.7

mail2 IN A 192.100.0.8

@ IN MX 5 mail.example.com.

@ IN MX 8 mail1.example.com.

@ IN MX 10 mail2.example.com.

3. service named start

4. rndc reload

5. chkconfig named on

6. Check the permission as well as SELinux Context should like this:

-rw-r--r-- root named root:object_r:named_zone_t

/var/named/chroot/var/named/example.com.zone

If selinux context is mismatch use the restorecon -R /var command

7. service named start

8. rndc reload

9. chkconfig named on

Zone file should create on /var/named/chroot/var/named. Default Directory Path is specified on

/var/named/chroot/etc/named.conf file.

$TTLàTime To Live, How much seconds cache server stores the information about DNS. And Five Parameters specified Serial Number used by slave to synchronize with master server. Refresh and Retry Time used by slave server. NS is the Name (DNS) server where lookup the domain. A (Associated IP) for particular host.

DNS has mechanism to load balance the request from clients. You can verify using host www.example.com command. MX resource records are used to define mail handler or exchanger for the domain. MX record must pass the positive integer value. This integer value is used by remote Mail Transport Agent (MTA) to determine, which host has delivery priority for the zone. The Lowest integer value will get the priority.

Answer:

Q15. CORRECT TEXT

Your system is giving error to load X window System. Make successfully boot your system in runlevel5.

Answer and Explanation: 

While you load the X Window System, you will get the problem. Problem may caused by different error.

1. Check the /tmp is full ?

2. Check your quota, hard limit is already crossed ?

3. Check xfs service is running ?

4. Configure the Video card, Resolution, monitor type using: system-config-display (Most Probably in Redhat exam)

5. Edit the /etc/inittab to set default runlevel 5.

id:5:initdefault:

Answer:

START RH302 EXAM