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.
2021 Mar RH302 free practice exam
Q11. 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.
Answer and Explanation:
1. echo "1" >/proc/sys/net/ipv4/ip_forward
2. 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 you should modify on /proc. From Next reboot the system, kernel will take the value from /etc/sysctl.conf.
Q12. CORRECT TEXT
Boot your System Successfully on run level 3.
Answer and Explanation:
After completing the Boot loader problem, you will boot the system, but it goes to emergency mode. Remember that if System boots on Emergency mode that means file system problem.
You will get the Shell, remount the / filesystem with read and write mode.
1. First Find out the / filesystem using e2lable /dev/hda1, e2lable /dev/hda2 etc
2. mount -o remount,defaults /dev/hda? /
3. vi /etc/fstab
You will get like:
/root / ext3 defaults 1 1
or / /root ext3 defaults 1 1
4. Edit the file like:
/ / ext3 defaults 1 1
5. Configure the /etc/grub.conf file if just booting system by editing grub from grub prompt.
6. Reboot the system.
Q13. CORRECT TEXT
Configure the webserver for your local domain. Download a www.html file from
ftp.server1.example.com/pub/rhce and rename it as index.html.
Answer and Explanation:
Your local domain mean example.com domain. Lookup the example.com using host example.com you will get the IP address 192.168.0.254.
1. vi /etc/httpd/conf/httpd.conf
<VirtualHost 192.168.0.254>
ServerName sexample.com
DocumentRoot /var/www/example
DirectoryIndex index.html
ServerAdmin webmaster@example.com
</VirtualHost>
2. mkdir /var/www/example
3. Download the index.html file from the ftp server specified in question
4. Rename the www.html file to index.html
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
5. service httpd start|restart
6. chkconfig httpd on
7. check using: links http://example.com
Q14. 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.
Q15. CORRECT TEXT
Make Secondary belongs the both users on sysadmin group.
Answer and Explanation:
1. usermod -G sysadmin john
2. usermod -G sysadmin jane
3. Verify by reading /etc/group file
Using usermod command we can make user belongs to different group. There are two types of group one primary and another is secondary. Primary group can be only one but user can belongs to more than one group as secondary.
usermod -g groupname username à To change the primary group of the user
usermod -G groupname username à To make user belongs to secondary group.
Up to the minute RH302 real exam:
Q16. 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>
Q17. CORRECT TEXT
Deny login to user15 and user16 on Saturday.
Answer and Explanation:
1. vi /etc/security/time.conf
login;*;user15|user16;Sa0000-2400
2. vi /etc/pam.d/login
account required pam_time.so
For Time based authentication, we should configured in /etc/security/time.conf
Syntax of /etc/security/time.conf
services;ttys;users;times
services
is a logic list of PAM service names that the rule applies to.
ttys
is a logic list of terminal names that this rule applies to.
users
is a logic list of users to whom this rule applies.
times
the format here is a logic list of day/time-range entries the days are specified by a sequence of two character entries, MoTuSa for example is Monday Tuesday and Saturday. Note that repeated days are unset MoMo = no day, and MoWk = all weekdays bar Monday. The two character combinations accepted are
Mo Tu We Th Fr Sa Su Wk Wd Al
the last two being week-end days and all 7 days of the week respectively. As a final example, AlFr means all days except Friday.
pam_time modules checks the file /etc/security/time.conf for authentication. So, we should call the pam_time modules in /etc/pam.d/login.
Q18. 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.
Q19. CORRECT TEXT
24. There is a server having 172.24.254.254 and 172.25.254.254. Your System lies on
172.24.0.0/16. Make successfully ping to 172.25.254.254 by Assigning following IP:
172.24.0.x Where x is your station number.
Answer and Explanation:
1. Use netconfig command
2. Enter the IP Address as given station number by your examiner: example: 172.24.0.1
3. Enter Subnet Mask
4. Enter Default Gateway and primary name server
5. press on ok
6. ifdown eth0
7. ifup eth0
8. verify using ifconfig
In the lab server is playing the role of router, IP forwarding is enabled. Just set the Correct IP and gateway, you can ping to 172.25.254.254.
Q20. CORRECT TEXT
You have a domain in your LAN example.com. Configure to allow login to jack only from station10.example.com.
Answer and Explanation:
1. vi /etc/security/access.conf
-:jack:ALL EXCEPT station10.example.com
2. vi /etc/pam.d/system-auth
account required /lib/security/pam_access.so
/etc/security/access.conf file helps to allow or deny login to users on the basis of origin.
Syntax of /etc/security/access.conf
permission : users : origins
The first field should be a "+" (access granted) or "-" (access denied) character.
The second field should be a list of one or more login names, group names, or ALL (always matches). A pattern of the form user@host is matched when the login name matches the "user" part, and when the "host" part matches the local machine name.
The third field should be a list of one or more tty names (for non-networked logins), host names, domain names (begin with "."), host addresses, internet network numbers (end with "."), ALL (always matches) or LOCAL (matches any string that does not contain a "." character).
The EXCEPT operator makes it possible to write very compact rules