Our pass rate is high to 98.9% and the similarity percentage between our RH302 study guide and real exam is 90% based on our seven-year educating experience. Do you want achievements in the Red Hat RH302 exam in just one try? I am currently studying for the Red Hat RH302 exam. Latest Red Hat RH302 Test exam practice questions and answers, Try Red Hat RH302 Brain Dumps First.

Q31. CORRECT TEXT

Create the user named user1, user2, user3

Answer and Explanation:

2. useradd user1

3. useradd user2

4. useradd user3

5. passwd user1

6. passwd user2

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


Q32. CORRECT TEXT

ssh service is enabled in your Server. Configure to

- Deny the ssh from my133t.org domain.

- Allow the ssh service only from example.com domain.

Answer and Explanation:

1. vi /etc/hosts.deny

sshd:ALL EXCEPT .example.com

or

1. vi /etc/hosts.deny

sshd:ALL

2. vi /etc/hosts.allow

sshd:.example.com

We can secure the services using tcp_wrappers. There are main two files, /etc/hosts.allow and /etc/hosts.deny.

There will be three stage access checking

- Is access explicitly permitted? Means permitted from /etc/hosts.allow?

- Otherwise, Is access explicitly denied? Means denied from /etc/hosts.deny?

- Otherwise, by default permit access if neither condition matched.

To deny the services we can configure /etc/hosts.deny file using ALL and EXCEPT operation.

Pattern of /etc/hosts.allow and /etc/hosts.deny file is:

Demon_list:client_list:options

In Client list can be either domain name or IP address.


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


Q34. CORRECT TEXT

Change the Group Owner of /data to training group.

Answer and Explanation:

chown or chgrp command is used to change the ownership.

Syntax of chown: chown [-R] username:groupname file/directory

Syntax of chgrp: chgrp [-R] groupname file/directory

Whenever user creates the file or directory, the owner of that file/directory automatically will be that user and that user's primary group name.

To change group owner ship

1. chgrp training /data à Which set the Group Ownership to training

or

chown root.training /data àWhich set the user owner to root and group owner to training group.

Verify /data using: ls -ld /data

You will get: drwxr-xr-x 2 root training ..............


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

2. Type n à For New partition

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. Default System ID is 83 that means Linux Native.

7. Type t to change the System ID of partition.

8. Type Partition Number

9. Type 82 that means Linux Swap.

10. Press w to write on partitions table.

11. Either Reboot or use partprobe command.

12. mkswap /dev/hda?à To create Swap File system on partition.

13. swapon /dev/hda?à To enable the Swap space from partition.

14. free -m à Verify Either Swap is enabled or not.

15. vi /etc/fstab

/dev/hda? swap swap defaults 0 0

16. Reboot the System and verify that swap is automatically enabled or not.


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


Q37. CORRECT TEXT

Download a index.html file from ftp.server1.example.com and set as default page for you station?.example.com where ? is your host number. Note file is anonymously available.

Answer and Explanation:

1. ftp ftp://server1.example.com

2. Login as an anonymous and download the file.

3. Copy the file in /var/www/html if you downloaded in another location.

4. service httpd restart

5. Test using links: links http://station?.example.com

Check the SELinux context of index.html file, 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


Q38. CORRECT TEXT

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

Answer and Explanation:

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

2. vi /etc/sysconfig/network

HOSTNAME=station?.example.com

3. service network restart


Q39. CORRECT TEXT

Configure to deny the pop and imap connection from outside local LAN as well as station20.example.com.

Answer and Explanation:

1. vi /etc/hosts.deny

dovecot:ALL EXCEPT .example.com EXCEPT station20.example.com

We can secure the services using tcp_wrappers. There are main two files, /etc/hosts.allow and /etc/hosts.deny.

There will be three stage access checking

-Is access explicitly permitted? Means permitted from /etc/hosts.allow?

- Otherwise, Is access explicitly denied? Means denied from /etc/hosts.deny?

- Otherwise, by default permit access if neither condition matched.

To deny the services we can configure /etc/hosts.deny file using ALL and EXCEPT operation.

Pattern of /etc/hosts.allow and /etc/hosts.deny file is:

Demon_list:client_list:options

In Client list can be either domain name or IP address.


Q40. CORRECT TEXT

Dig Server1.example.com, Resolve to successfully through DNS Where DNS server is 172.24.254.254

Answer and Explanation:

#vi /etc/resolv.conf

nameserver 172.24.254.254

# dig server1.example.com

#host server1.example.com

DNS is the Domain Name System, which maintains a database that can help your computer translate domain names such as www.redhat.com to IP addresses such as 216.148.218.197. As no individual DNS server is large enough to keep a database for the entire Internet, they can refer requests to other DNS servers.

DNS is based on the named daemon, which is built on the BIND (Berkeley Internet Name Domain) package developed through the Internet Software Consortium

Users wants to access by name so DNS will interpret the name into ip address. You need to specify the Address if DNS server in each and every client machine. In Redhat Enterprise Linux, you need to specify the DNS server into /etc/resolv.conf file.

After Specifying the DNS server address, you can verify using host, dig and nslookup commands.