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 question
Q21. CORRECT TEXT
/data Directory is shared from the server1.example.com server. Mount the shared directory that:
a. when user try to access, automatically should mount
b. when user doesn't use mounted directory should unmount automatically after 50 seconds.
c. Shared directory should mount on /mnt/data on your machine.
Answer and Explanation:
1. vi /etc/auto.master
/mnt /etc/auto.misc --timeout=50
2. vi /etc/auto.misc
3. data -rw,soft,intr server1.example.com:/data
4. service autofs restart
5. chkconfig autofs on
When you mount the other filesystem, you should unmount the mounted filesystem, Automount feature of linux helps to mount at access time and after certain seconds, when user unaccess the mounted directory, automatically unmount the filesystem.
/etc/auto.master is the master configuration file for autofs service. When you start the service, it reads the mount point as defined in /etc/auto.master.
Q22. CORRECT TEXT
Install the dialog-*
Answer and Explanation:
Questions asking you to install the dialog package from the server. In your Lab FTP server as well as NFS server are configured. You can install either through FTP or NFS.
1. Just Login to server1.example.com through FTP: ftp server1.example.com
2. Enter to pub directory: cd pub
3. Enter to RedHat/RPMS: cd RedHat/RPMS
4. Download the Package: mget dialog-*
5. Logout from the FTP server: bye
6. Install the package: rpm -ivh dialog-*
7. Verify the package either installed or not: rpm -q dialog
Q23. 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.
Q24. CORRECT TEXT
neo user tried by:
dd if=/dev/zero of=/home/neo/somefile bs=1024 count=70
files created successfully. Again neo tried to create file having 70K using following command:
dd if=/dev/zero of=/home/neo/somefile bs=1024 count=70
But he is unable to create the file. Make the user can create the file less then 70K.
Answer and Explanation:
Very Tricky question from redhat. Actually question is giving scenario to you to implement quota to neo user. You should apply the quota to neo user on /home that neo user shouldn't occupied space more than 70K.
1. vi /etc/fstab
LABEL=/home /home ext3 defaults,usrquota 0 0 à To enable the quota on filesystem you should mount the filesystem with usrquota for user quota and grpquota for group quota.
2. touch /home/aquota.user àCreating blank quota database file.
3. mount -o remount /home à Remounting the /home with updated mount options. You can verify that /home is mounted with usrquota options or not using mount command.
4. quotacheck -u /home à Initialization the quota on /home
5. edquota -u neo /home à Quota Policy editor
See the snapshot
Disk quotas for user neo (uid 500):
Filesystem blocks soft hard inodes soft hard
/dev/mapper/vo-myvol 2 30 70 1 0 0
Can you set the hard limit 70 and soft limit as you think like 30.
Verify using the repquota /home command.
Q25. 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.
Latest RH302 practice test:
Q26. CORRECT TEXT
There are some part-time staff in your office. And you gave the username user9 and user10 to them. Their Office time is 12-2pm on Sunday, Monday and Friday. Configure to login only on their office time.
Answer and Explanation:
1. vi /etc/security/time.conf
login;*;user9|user10;SuMoFri1200-1400
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.
Q27. 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.
Q28. 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 400MB. Make successfully that the size of Logical Volume 200MB without losing any data. The size of logical volume 200MB to 210MB will be acceptable.
Answer and Explanation:
1. First check the size of Logical Volume: lvdisplay /dev/vo/myvol
2. Make sure that the filesystem is in a consistent state before reducing:
# fsck -f /dev/vo/myvol
3. Now reduce the filesystem by 200MB.
# resize2fs /dev/vo/myvol 200M
4. It is now possible to reduce the logical volume.
#lvreduce /dev/vo/myvol -L 200M
4. Verify the Size of Logical Volume: lvdisplay /dev/vo/myvol
5. Verify that the size comes in online or not: df -h
Q29. CORRECT TEXT
Make Secondary belongs the jeff and marion users on sysusers group. But harold user should not belongs to sysusers group.
Answer and Explanation:
1. usermod -G sysusers jeff
2. usermod -G sysuser marion
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.
Q30. 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.