You will have quick access to our Red Hat RH302 exam items after confirming the actual payment at Pass4sure. The actual Red Hat RH302 practice questions with verified answers are compiled and revised by the subject matter specialists. Each of our experts possess make fantastic contributions to the Red Hat Red Hat exam products. Weve many consumers who have obtained the actual Red Hat RH302 certification. We are proud of the large passing ratio since we start.
Q111. CORRECT TEXT
Change the root Password to redtophat
Answer and Explanation:
Boot the system in Single user modeUse the passwd command
Q112. 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.
Q113. CORRECT TEXT
There are mixed lots of System running on Linux and Windows OS. Some users are working on Windows Operating System. You want to make available /data directory to samba users only from 192.168.0.0/24 network. Configure the samba server.
Answer and Explanation:
1. vi /etc/samba/smb.conf
[global]
netbios name=station?
workgroup = mygroup
server string=Share from Linux Server
security=user
smb passwd file=/etc/samba/smbpasswd
encrypt passwords=yes
hosts allow=192.168.0.
[data]
path=/data
writable=yes
public=no
browsable=yes
2. service smb start| restart
3. chkconfig smb on
Samba servers helps to share the data between linux and windows. Configuration file is /etc/samba/smb.conf. There are some pre-defined section, i. global à use to define the global options, ii. Printers à use to share the printers, iii. homes à use to share the user's home directory.
Security=user à validation by samba username and password. May be there are other users also.
To allow certain share to certain user we should use valid users option.
smbpasswd à Helps to change user's smb password. -a option specifies that the username following should be added to the local smbpasswd file.
If any valid users option is not specified, then all samba users can access the shared data. By Default shared permission is on writable=no means read only sharing. Write list option is used to allow write access on shared directory to certain users or group members.
To allow access the shared directory only from certain network or hosts, there is a option hosts allow= host or network. If this option is applied on global option, then it will apply to all shared directory.
Q114. CORRECT TEXT
Run the squid proxy server on port 8080 by allowing internet access to 192.168.0.0/24 and block msn.com site to access.
Answer and Explanation:
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 msnnet dstdomain .msn.com
#Default:
# http_access deny all
#Under Here
http_access deny msnnet
http_access allow allownet
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.
To block or allow the Internet access to hosts, we should create the acl (Access Control List). In this file we can specify only the IP address.
Example: acl aclname src IP/Netmask
After creating acl we can block or allow the Internet to specified acl.
http_access allow | deny alcname
Q115. CORRECT TEXT
Share the /storage directory only to example.com members. These hosts should get read and write access on shared directory.
Answer and Explanation:
1. vi /etc/exports
/storage *.example.com(rw,sync)
2. service nfs start
3. service portmap restart
4. chkconfig nfs on
5. chkconfig portmap on
In Linux to share the data we use the /etc/exports file. Pattern is:
Path client(permission)
Shared Directory Path, Client can be single host or domain name or ip address. Permission should specify without space with client lists in parentheses.
Q116. CORRECT TEXT
Configure the web server for www.abc.com associated IP address is 192.100.0.1 by allowing access to user5 and user6 httpusers.
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>
AllowOverride authconfig
</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.html file, should be 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. vi /var/www/abc/.htaccess
AuthName "Only to Authorized Users"
AuthType basic
AuthUserFile /etc/httpd/conf/mypasswd
require valid-user
Check the SELinux Context, should like this:
-rw-r--r-- root root root:object_r:httpd_sys_content_t .htaccess
htpasswd -c /etc/httpd/conf/mypasswd user5htpasswd -m /etc/httpd/conf/mypasswd user6chgrp
apache /etc/httpd/conf/mypasswdchmod g+r /etc/httpd/conf/mypasswd
Check the SELinux Context, should like this:
-rw-r--r-- root root system_u:object_r:httpd_config_t /etc/httpd/conf/mypasswd
Use restorecon command to restore the mismatched SELinux Context of the file.service httpd
restartchkconfig httpd on
AllowOverride Authconfig is used to specify which and how much configuration can be overridden by directory specific .htaccess files.
One of the most common tasks performed in users' .htaccess files is adding authorization.
Typically, a user will setup authorization for directories that hold sensitive information with a configuration.
Q117. 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
Q118. CORRECT TEXT
/data Directory is shared from the server1.example.com server. Mount the shared directory that:
d. when user try to access, automatically should mount
e. when user doesn't use mounted directory should unmount automatically after 50 seconds.
f. Shared directory should mount on /mnt/data on your machine.
Answer and Explanation:
6. vi /etc/auto.master
/mnt /etc/auto.misc --timeout=50
7. vi /etc/auto.misc
8. data -rw,soft,intr server1.example.com:/data
9. service autofs restart
10. 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.
Q119. CORRECT TEXT
Install the Cron Schedule for jeff 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 jeff 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
Q120. CORRECT TEXT
You want to deny to user1 and user2 users to access files via ftp. Configure to deny these users to access via ftp.
Answer and Explanation:
1. vi /etc/vsftpd/ftpusers
user1
user2
2. service vsftpd start| restart
Using /etc/vsftpd/ftpusers file we can deny to certain users to access files via ftp. As well as there is another file named /etc/vsftpd.user_list can be used to allow or to deny to users.