Exam Code: RH302 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Red Hat Certified Engineer on Redhat Enterprise Linux 5 (Labs)
Certification Provider: Red Hat
Free Today! Guaranteed Training- Pass RH302 Exam.

Q11. CORRECT TEXT

There are two different networks 192.168.0.0/24 and 192.168.1.0/24. Where 192.168.0.254 and 192.168.1.254 IP Address are assigned on Server. Verify your network settings by pinging 192.168.1.0/24 Network's Host.

Answer and Explanation: 

At exam time read the Lab Scenario carefully. Actually there are two different networks one is 192.168.0.0/24 where your system resides know as example.com

domain and another is 192.168.1.0/24 know as cracker.org domain.

One server named sever1.example.com having 192.168.0.254 and 192.168.1.254 is running in your exam. If you make a gateway to that server, you will can ping because IP forwarding is enabled on that server.

1. vi /etc/sysconfing/network

NETWORKING=yes

HOSTNAME=station?.example.com

GATEWAY=192.168.0.254

2. service network restart

Or

1. vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=static

IPADDR=X.X.X.X

NETMASK=X.X.X.X

GATEWAY=192.168.0.254

2. ifdown eth0

3. ifup eth0

Note: If gateway is specified in both file, default gateway takes from interface specific file.


Q12. CORRECT TEXT

You are a System administrator. Using Log files very easy to monitor the system. Now there are 50 servers running as Mail, Web, Proxy, DNS services etc. You want to centralize the logs from all servers into on LOG Server. How will you configure the LOG Server to accept logs from remote host ?

Answer and Explanation:

By Default system accept the logs only generated from local host. To accept the Log from other host configure:

1. vi /etc/sysconfig/syslog

SYSLOGD_OPTIONS="-m 0 -r"

Where

-m 0 disables 'MARK' messages.

-r enables logging from remote machines

-x disables DNS lookups on messages recieved with -r

2. service syslog restart


Q13. CORRECT TEXT

Make a swap partition having 100MB. Make Automatically Usable at System Boot Time.

Answer and Explanation:

1. Use fdisk /dev/hda àTo create new partition.Type n àFor New partitionIt 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. Default System ID is 83 that means Linux Native.Type t to change the System ID of partition.Type Partition NumberType 82 that means Linux Swap.Press w to write on partitions table.Either Reboot or use partprobe command.mkswap /dev/hda?àTo create Swap File system on partition.swapon /dev/hda?àTo enable the Swap space from partition.free -m àVerify Either Swap is enabled or not.vi /etc/fstab

/dev/hda? swap swap defaults 0 0Reboot the System and verify using free command that swap is automatically enabled or not.


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


Q15. CORRECT TEXT

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

Answer and Explanation:

1. chmod g+s /storage

2. Verify using: ls -ld /storage

Permission should be like:

drwxrws--- 2 root sysusers 4096 Mar 16 18:08 /storage

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


Q16. CORRECT TEXT

You are working as a System Administrator at Certkiller. Your Linux Server crashed and you lost every data. But you had taken the full backup of user's home directory and other System Files on /dev/st0, how will you restore from that device?

Answer and Explanation:

1. Go to on that directory where you want to restore.

2. restore -rf /dev/st0

To restore from backup we use the restore command. Here backup will restore from /dev/st0 on current Directory.


Q17. CORRECT TEXT

Your System is going use as a router for 172.24.0.0/16 and 172.25.0.0/16. Enable the IP Forwarding.

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

ii. vi /etc/sysctl.conf

net.ipv4.ip_forward=1

/proc is the virtual filesystem, containing the information about the running kernel. To change the parameter of running kernel in running state you should modify the /proc. From Next boot the system, kernel will take the value from /etc/sysctl.conf. If net.ipv4.ip_forward is 0, it disable the IP forwarding, if 1 then it enable the IP Forwarding.


Q18. CORRECT TEXT

Port 8080

Configure the squid server to allow the Local Domain and deny to cracker.org domain.

Answer and Explanation:

At exam Lab example.com domain resides on 192.168.0.0/24 Network and cracker.org resides on 192.168.1.0/24 Network.

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 denynet src 192.168.1.0/255.255.255.0

#Default:

# http_access deny all

#Under Here

http_access allow allownet

http_access deny denynet

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.


Q19. CORRECT TEXT

Deny to all users except root to run cron schedule.

Answer and Explanation:

1. vi /etc/cron.allow

root

or

vi /etc/cron.deny

Write all user name to deny.

/etc/cron.allow, /etc/cron.deny file is used to control users to allow or deny. If /etc/cron.allow file is created only that users are allowed to run cron schedule. Another way to deny to users is /etc/cron.deny write all user name on single line.


Q20. CORRECT TEXT

Configure the web server for www.abc.com associated IP address is 192.100.0.1 by allowing access within your example.com domain.

Answer and Explanation:

1. vi /etc/httpd/conf/httpd.conf

<VirtualHost 192.100.0.1>

ServerName www.abc.com

DocumentRoot /var/www/abc/

<Directory /var/www/abc>

Order Allow, Deny

Allow from .example.com

</Directory>

DirectoryIndex index.html

ServerAdmin webmaster@abc.com

ErrorLog logs/error_abc.logs

CustomLog logs/custom_abc.logs common

</VirtualHost>

2. Create the directory and index page on specified path. (Index page can download from

ftp://server1.example.com at exam time)

Check the SELinux context of index page , should like this:

-rw-r--r-- root root system_u:object_r:httpd_sys_content_t /var/www/html/index.html

If SELinux Context is mismatched, use the restorecon -R /var command

3. service httpd start|restart

4. chkconfig httpd on

Order allow, deny à Allows explicitly allowed clients, denies everyone else; clients matched by both allow and deny are denied.

Order deny, allow à denies explicitly denied clients, allows everyone else, clients matched by both allow and deny are allowed.