getcertified4sure.com

Leading RH302: Exambible real preparation labs from 1 to 10




Q1. CORRECT TEXT

Raw (Model) printer named printer1 is installed and shared on 192.168.0.254. You should install the shared printer on your PC to connect shared printer using IPP Protocols.

Answer and Explanation:

IPP( Internet Printing Protocol), allows administrator to manage printer through browser so CUPS is called Internet Printing Protocol based on HTTP. We can Install the printer either through:

system-confing-printer tool or through Browser.

1. Open the browser and Type on address: http://localhost:631 à CUPS (Common Unix Printing System) used the IPP protocol. CUPS use the 631 port.

2. Click on Manage Printer.

3. Click on Add Printer.

4. Type Printer name, Location, Description.

5. Select Device for bb. (Select IPP).

6. Device URL: ipp://192.168.0.254/ipp/ queue name à Same printer name of shared printer.

7. Select Model/Driver RAW printer.

8. service cups restart


Q2. CORRECT TEXT

Make on /data that only the user owner and group owner member can fully access.

Answer and Explanation:

1. chmod 770 /data

2. Verify using : ls -ld /data

Preview should be like:

drwxrwx--- 2 root sysadmin 4096 Mar 16 18:08 /data

To change the permission on directory we use the chmod command. According to the question that only the owner user (root) and group member (sysadmin) can fully access the directory so:

chmod 770 /data


Q3. CORRECT TEXT

You are giving RHCT Exam and in your Exam paper there is a question written, make successfully ping to 192.168.0.254.

Answer and Explanation:

In Network problem think to check:IP Configuration: use ifconfig command either IP is assigned to interface or not?Default Gateway is set or not?Hostname is set or not?Routing problem is there?Device Driver Module is loaded or not?Device is activated or not?

Check In this way:use ifconfig command and identify which IP is assigned or not.cat

/etc/sysconfig/network àWhat, What is written here. Actually here are these parameters.

NETWORKING=yes or no

GATEWAY=x.x.x.x

HOSTNAME=?

NISDOMAIN=?

- Correct the fileUse netconfig command

- Either Select Automatically from DHCP or assign the static IPUse service network restart or start command

Now try to ping it will work.


Q4. CORRECT TEXT

One Logical Volume is created named as myvol under vo volume group and is mounted. The Initial Size of that Logical Volume is 124MB. Make successfully that the size of Logical Volume 245MB without losing any data. The size of logical volume 240MB to 255MB will be acceptable.

Answer and Explanation:

1. First check the size of Logical Volume: lvdisplay /dev/vo/myvol

2. Increase the Size of Logical Volume: lvextend -L+121M /dev/vo/myvol

3. Make Available the size on online: ext2online /dev/vo/myvol

4. Verify the Size of Logical Volume: lvdisplay /dev/vo/myvol

5. Verify that the size comes in online or not: df -h

We can extend the size of logical Volume using the lvextend command. As well as to decrease the size of Logical Volume, use the lvresize command. In LVM v2 we can extend the size of Logical Volume without unmount as well as we can bring the size of Logical Volume on online using ext2online command.


Q5. CORRECT TEXT

You are giving RHCE exam. Examiner gave you the Boot related problem and told to you that make successfully boot the System. When you started the system, System automatically asking the root password for maintenance. How will you fix that problem?

Answer and Explanation:

Maintenance mode also known as emergency mode. System boots on emergency mode when file system error occurred. It is due to unknown partition, bad filesystem specified in /etc/fstab. To slove follow the steps

6. Give the Root password

7. fdisk -l àVerify the Number of parations.

8. Identify the Root partition, e2label /dev/hda1, e2label /dev/hda2.....

9. Remount the root partation on rw mode: mount -o remount,defaults /dev/hda6 /

10. vi /etc/fstab

Correct all partitions, mount point, mount options, file system etc.

6. Press ctrl+d


Q6. 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


Q7. CORRECT TEXT

Make on /archive directory that only the user owner and group owner member can fully access.

Answer and Explanation:

1. chmod 770 /archive

2. Verify using : ls -ld /archive

Preview should be like:

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

To change the permission on directory we use the chmod command. According to the question that only the owner user (root) and group member (sysuser) can fully access the directory so:

chmod 770 /archive


Q8. 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.


Q9. CORRECT TEXT

You have a dedicated internet line in your LAN and IP from your ISP is 202.2.2.2. Your LAN is in 192.168.0.0/24. Configure the SNAT that allows all system in your LAN can access the Internet.

Answer and Explanation:

1. iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -p tcp -j SNAT -to-source 202.2.2.2.

POSTROUTINGà This filter point handles packets immediately prior leaving the system.

When Packets leave the system all's source address change to 202.2.2.2 and can access the internet. 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.


Q10. CORRECT TEXT

You have a directory /local. You want to make available that directory to all the members of example.com and trusted.cracker.org. But directory should available in read and write to all the members of example.com domain and read only to cracker.org domain.

Answer and Explanation:

1. vi /etc/exports

/local *.example.com(rw,sync) trusted.cracker.org(ro,sync)

Check the SELinux Context, should be like this:

-rw-r--r-- root root system_u:object_r:exports_t /etc/exports

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

2. service nfs start | restart

3. service portmap start | 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. NFS is RPC service so portmapper service should restart after starting the nfs service. We can specify multiple clients' list separating by space with different shared option.