RH302 Premium Bundle

RH302 Premium Bundle

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

4.5 
(32655 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
November 26, 2024Last update

Red-Hat RH302 Free Practice Questions

Q1. CORRECT TEXT

Configure the send mail server for your local LAN. As well as the mail of user john should get by the jane user.

Answer and Explanation:

Here your Local LAN means your domain named example.com.

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

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.

7. vi /etc/aliases

john: jane

8. newaliases

We can redirect the mail of one user to another user using /etc/aliases file. In example all mail of john goes to jane user.

Answer:

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

Answer:

Q3. CORRECT TEXT

Create the partition having 100MB size and mount it on /mnt/neo

Answer and Explanation:

1. Use fdisk /dev/hda à To create new partition.

2. Type n à For New partitions

3. It will ask for Logical or Primary Partitions. Press l for logical.

4. It will ask for the Starting Cylinder: Use the Default by pressing Enter Key.

5. Type the Size: +100M à You can Specify either Last cylinder of Size here.

6. Press P to verify the partitions lists and remember the partitions name.

7. Press w to write on partitions table.

8. Either Reboot or use partprobe command.

9. Use mkfs -t ext3 /dev/hda? Where ? is your partition number

10. Or

11. mke2fs -j /dev/hda? à To create ext3 filesystem.

12. mkdir /mnt/neo

13. vi /etc/fstab

14. Write:

15. /dev/hda? /mnt/neo ext3 defaults 1 2

16. Verify by mounting on current Sessions also:

17. mount /dev/hda? /mnt/neo

Answer:

Q4. CORRECT TEXT

All mails to my133t.org should get by marion user.

Answer and Explanation:

3. vi /etc/mail/virtusertable

@my133t.org marion

# service sendmail restart

/etc/mail/virtusertable file is used to send the mail coming for virtual user to real user. According to question, all mail to cracker.org should get by eric user so

@my133t.org eric : Which sends all mail of cracker.org to eric user.

Answer:

Q5. CORRECT TEXT

One New Kernel is released named kernel-.2.6.9-11. Kernel is available on ftp://server1.example.com/pub/updates directory for anonymous. Install the Kernel and make the kernel-2.6.9-5 default.

Answer and Explanation:

1. rpm -ivh ftp://server1.example.com/pub/updates/kernel-2.6.9-11.i686.rpm

2. vi /etc/grub.conf

default=1 à Change this value to 1

timeout=5

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

hiddenmenu

title Red Hat Enterprise Linux ES (2.6.9-11)

root (hd0,0)

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

initrd /initrd-2.6.9-11.EL.img

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

According question that kernel is available to anonymous user. You can directly install from the ftp server using rpm command.

When you install the kernel, it will write on /etc/grub.conf file. You can set the default kernel by changing the default value. See on the output of /etc/grub.conf file that new kernel is on first title so it's index is 0 and previous kernel's index is 1.

Answer:

Q6. CORRECT TEXT

Install the Redhat Linux RHEL 5 through NFS. Where your Server is server1.example.com having IP 192.168.0.254 and shared /var/ftp/pub. The size of the partitions are listed below:

/ à 1048

/home à 1028

/boot à 512

/var à 1028

/usr à 2048

Swap -> 1.5 of RAM Size

/data à configure the RAID Level 0 of remaining all free space.

After completing the installation through NFS solve the following questions. There are two networks 192.168.0.0/24 and 192.168.1.0/24. As well as there are two domains example.com on 192.168.0.0/24 network and cracker.org on 192.168.1.0/24 network. Your system is based on example.com domain.

Answer and Explanation:

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. Create the two RAID partitions having equal size of remaining all free space.

11. Click on RAID button

12. Type mount point /data

13. Select RAID Level 0

14. Click on ok

15. 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:

Q7. CORRECT TEXT

One New Kernel is released named kernel-hugemem. Kernel is available on ftp://server1.example.com under pub directory for anonymous. Install the Kernel and make previous new kernel is default to boot System.

Answer and Explanation:

1. rpm -ivh ftp://server1.example.com/pub/kernel-hugemem-*

2. vi /etc/grub.conf

Set the default to new kernel

default=0

Example of /etc/grub.conf

default=0

timeout=5

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

hiddenmenu

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

root (hd0,0)

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

initrd /initrd-2.6.9-5.ELhugemem.img

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

root (hd0,0)

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

initrd /initrd-2.6.9-5.EL.img

rpm command is used to install, update and remove the rpm package. -ivh option is install,

verbose, and display the hash mark.

Answer:

Q8. CORRECT TEXT

You are giving the debug RHCT exam. The examiner told you that the password of root is redhat.

When you tried to login displays the error message and redisplayed the login screen. You changed the root password, again unable to login as a root. How will you make Successfully Login as a root.

Answer and Explanation:

When root unable to login into the system think:

4. Is password correct?

5. Is account expired?

6. Is terminal Blocked?

Do these Steps:

3. Boot the System on Single user mode.

4. Change the password

5. Check the account expire date by using chage -l root command.

If account is expired, set net expire date: chage -E "NEVER" root

7. Check the file /etc/securetty àWhich file blocked to root login from certain terminal.

8. If terminal is deleted or commented write new or uncomment.

9. Reboot the system and login as a root.

Answer:

Q9. CORRECT TEXT

Install the Cron Schedule for david user to display "Hello" on daily 5:30.

Answer and Explanation:

Login as a root usercat >schedule.txt

30 05 * * * /bin/echo "Hello"

3. crontab -u david schedule.txt

4. service crond restart

The cron system is essentially a smart alarm clock. When the alarm sounds, Linux runs the commands of your choice automatically. You can set the alarm clock to run at all sorts of regular time intervals. Alternatively, the at system allows you to run the command of your choice once, at a specified time in the future.

Red Hat configured the cron daemon, crond. By default, it checks a series of directories for jobs to run, every minute of every hour of every day. The crond checks the /var/spool/cron directory for jobs by user. It also checks for scheduled jobs for the computer under /etc/crontab and in the /etc/cron.d directory.

Here is the format of a line in crontab. Each of these columns is explained in more detail:

#minute, hour, day of month, month, day of week, command

* * * * * command

Answer:

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

Answer:

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

Answer:

Q12. CORRECT TEXT

One Domain RHCE is configured in your lab, your domain server is server1.example.com. nisuser2001, nisuser2002, nisuser2003 user are created on your server 192.168.0.254:/rhome/stationx/nisuser2001. Make sure that when NISuser login in your system automatically mount the home directory. Home directory is separately shared on server /rhome/stationx/ where x is your Station number.

Answer and Explanation:

1. use the authconfig or system-config-authentication

2. Select the [*] USE NIS

3. Type the NIS Domain: RHCE

4. Type Server 192.168.0.254 then click on next and ok

5. You will get a ok message.

6. Create a Directory /rhome/stationx where x is your station number.

6. vi /etc/auto.master and write at the end of file

/rhome/stationx /etc/auto.home --timeout=60

7. vi /etc/auto.home and write

* -rw,soft,intr 192.168.0.254:/rhome/stationx/&

Note: please specify your station number in the place of x.

8. Service autofs restart

9. Login as the nisuser2001 or nisuser2002 on another terminal will be

Success.

According to question, RHCE domain is already configured. We have to make a client of RHCE domain and automatically mount the home directory on your system. To make a member of domain, we use the authconfig or system-config-authentication command. There a are lots of authentication server i.e NIS, LDAB, SMB etc. NIS is a RPC related Services, no need to configure the DNS, we should specify the NIS server address.

Here Automount feature is available. When user tried to login, home directory will automatically mount. The automount service reads the configuration from /etc/auto.master file. On /etc/auto.master file we specified the mount point the configuration file for mount point.

Answer:

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

Answer:

Q14. 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 thinks to check:

1. IP Configuration: use ifconfig command either IP is assigned to interface or not?

2. Default Gateway is set or not?

3. Hostname is set or not?

4. Routing problem is there?

5. Device Driver Module is loaded or not?

6. Device is activated or not?

Check In this way:

1. use ifconfig command and identify which IP is assigned or not.

2. 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 file

3. Use vi /etc/sysconfig/network-scirpts/ifcfg-eth0 and check the proper options

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=static

IPADDR=x.x.x.x

NETMAKS=x.x.x.x

GATEWAY=x.x.x.x

4. Use service network restart or start command

Answer:

Q15. CORRECT TEXT

Eric user should able to write on Document root directory.

Answer and Explanation:

Document directive is used in apache configuration file to specify the directory where all web site related documents are. According to question eric user should able to write into the Document root directory.

Better set the permission using ACL (Access Control List), to apply the permission using acl needs to mount the filesystem with acl options. Example in above answer documentroot is in /var and /var is mounting separate file system so needs to mount the /var file system with acl option.

1. vi /etc/fstab

LABEL=/var /var ext3 defaults 1 1

2. mount -o remount /var

3. setfacl -m u:eric:rwx /var/www/example

4. getfacl /var/www/example

getfacl and setfacl two commands used to maintain the permission through acl. setfacl is used to set the permission on file/directory, getfacl is used to display the permission of file/directory.

Answer:

START RH302 EXAM