Q1. CORRECT TEXT
Create a RAID Device /dev/md0 by creating equal two disks from available free space on your harddisk and mount it on /data.
Answer and Explanation:
Redhat Enterprise Linux 5 Supports the RAID LEVEL 0, RAID LEVEL 1, RAID LEVEL 5 and RAID LEVEL 6 at installation time. You can create it at installation time later no need to type lots of commands for RAID.
At Installation Time:
ii. Create the partitions using diskdruid.
iii. Create the Partitions having File system Type Software RAID.
iv. Click on RAID button
v. Type the Mount Point
vi. Select File system type
vii. Select RAID Level
viii. Select Partitions/disks as a member of RAID.
viii. Click on ok
After Installation: We can create the RAID Device after Installation on command-line.
11. Create the Two partitions having equal size. (Specify the Size using Cylinder, find the
remaining cylinder and divide by 2).
12. Change the Partition ID to fd (Linux raid Autodetect) by typing t.
13. Type w à To write on partitions table.
14. Use partprobe command to synchronic the partition table.
15. Use: mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda? /dev/hda?
16. Verify the RAID: mdadm --detail /dev/md0
17. mkfs -t ext3 /dev/md0
18. mount /dev/md0 /data
19. vi /etc/fstab
/dev/md0 /data ext3 defaults 0 0
20. Verify mounting devices using mount command.
Answer:
Q2. CORRECT TEXT
You are giving RHCE exam. Examiner gave you the Boot related problem and told to you that make successfully boot the System. While booting system, you saw some error and stop the boot process by displaying some error messages.
Kernel Panic - not syncing: Attempted to kill init!
And no further boot process. What you will do to boot the system.
Answer and Explanation:
To understand the role of a boot loader, take a step back from Linux. When you boot your computer, the BIOS starts by detecting basic hardware, including your hard drives. Once it's done, it looks for the boot loader on the Master Boot Record of the first available disk. If you're working with an older PC, the BIOS can't find your boot loader unless it's located within the first 1,024 cylinders of the hard disk.
Newer BIOSes overcome this problem with Logical Block Addressing, which is also known as LBA mode. LBA mode reads 'logical' values for the cylinder, head, and sector, which allows the BIOS to 'see' a larger disk drive.
If you have multiple hard drives, there is one more caveat. If your drives are IDE hard drives, the /boot directory must be on a hard drive attached to the primary IDE controller. If your drives are all SCSI hard drives, the /boot directory must be located on a hard drive with SCSI ID 0 or ID 1. If you have a mix of hard drives, the /boot directory must be located on either the first IDE drive or a SCSI drive with ID 0. In other words, this is not an issue on the Red Hat exams unless the computer that you're tested on has more than two hard drives. And I believe that's less likely, as that would increase the cost of the exam.
If you are getting the Kernel panic error, it means it is boot loader related problem. Redhat Enterprise Linux uses the GRUB boot loader. You can pass the kernel parameter from the boot loader as well as you can correct the kernel parameter passing from boot loader from GRUB screen at boot time.
GRUB boot loader configuration file is: /etc/grub.conf
And Correct Configuration is:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
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
Probably miss-configured the boot loader, so giving this problem. You can pass the correct parameter from GRUB prompt:
If you know all parameters and sequence of the boot loader you can enter in command prompt also.
Press c on GRUB screen.
Grub> root (hd0,0)
grub> kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/ rhgb quiet
grub> initrd /initrd-2.6.9-5.EL.img
grub>boot
Answer:
Q3. CORRECT TEXT
Create the user named eric but eric should not belong to the sysadmin group.
Answer and Explanation:
1. useradd eric
Very tricky question given to you that this user should not belongs to sysadmin group.
Answer:
Q4. CORRECT TEXT
Configure to allow the pop3 and imap connection from your domain example.com
and cracker.org domain.
Answer and Explanation:
1. vi /etc/hosts.deny
dovecot:ALL EXCEPT .example.com, .cracker.org
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.
Answer:
Q5. CORRECT TEXT
We are working on /data initially the size is 2GB. The /dev/test0/lvtestvolume is mount on /data.
Now you required more space on /data but you already added all disks belong to physical volume.
You saw that you have unallocated space around 5 GB on your harddisk. Increase the size of lvtestvolume by 5GB.
Answer and Explanation:.
1. Create a partition having size 5 GB and change the syste id '8e'.
2. use partprobe command
3. pvcreate /dev/hda9 à Suppose your partition number is hda9.
4. vgextend test0 /dev/hda9 à vgextend command add the physical disk on volume group.
5. lvextend -L+5120M /dev/test0/lvtestvolume
6. verify using lvdisplay /dev/test0/lvtestvolume.
Answer:
Q6. 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
1 Disk quotas for user neo (uid 500):
2 Filesystem blocks soft hard inodes soft hard
4 /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.
Answer:
Q7. CORRECT TEXT
Configure the caching only-name server for example.com where DNS server is 192.100.0.254.
Answer and Explanation:
1. vi /var/named/chroot/etc/named.conf
options {
forwarders { 192.168.22.250; };
forward only;
};
2. service named start | restart
Caching-only name server forwards a request to another name server or to the root name servers in orders to determine the authoritative name server for the resolution. Once resolution has taken place, the caching-only name server stores the resolved information in a cache for the designated time to live period.
Answer:
Q8. CORRECT TEXT
You are working as an administrator of example.com domain. There are five web servers( www), three mail servers(mail1, mail2, mail). Configure the DNS for www, mail, mail1, mail2 by specifying mail.example.com is the Primary Mail Server for example.com domain. Where 192.168.100.1-5 for www, 6,7,8 for mail, mail1, m ail2 and 192.168.0.X for DNS.
Answer and Explanation:
1. Rename the file named.caching-nameserver.conf into named.conf file located into
/var/named/chroot/etc
#mv /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/named.conf
2. Check the permission and ownership as well as SELinux Context should be like as:
-rw-r----- root named system_u:object_r:named_conf_t /var/named/chroot/etc/named.conf
If selinux context is mismatch use the restorecon -R /var command
3. vi /etc/named.conf
zone "example.com" IN {
type master;
file "example.com.zone";
};
/var/named/chroot/etc/named.conf file is used to register the zone as well as specify the global option for DNS server. There are two types of zone, i. Master, which contains the original data. ii.
Slave, backup of master. Here is the example of master zone configuration.
4. vi /var/named/chroot/var/named/example.com.zone
$TTL 345345
@ IN SOA @ webmaster.example.com.(
101; Serial Number
1H; Refresh Time
1M; Retry Time
1W; Expire Time
1D; Minimum Time to Live
)
@ IN NS 192.100.0.X
www 0 IN A 192.100.0.1
www 0 IN A 192.100.0.2
www 0 IN A 192.100.0.3
www 0 IN A 192.100.0.4
www 0 IN A 192.100.0.5
mail IN A 192.100.0.6
mail1 IN A 192.100.0.7
mail2 IN A 192.100.0.8
@ IN MX 5 mail.example.com.
@ IN MX 8 mail1.example.com.
@ IN MX 10 mail2.example.com.
3. service named start
4. rndc reload
5. chkconfig named on
6. Check the permission as well as SELinux Context should like this:
-rw-r--r-- root named root:object_r:named_zone_t
/var/named/chroot/var/named/example.com.zone
If selinux context is mismatch use the restorecon -R /var command
7. service named start
8. rndc reload
9. chkconfig named on
Zone file should create on /var/named/chroot/var/named. Default Directory Path is specified on
/var/named/chroot/etc/named.conf file.
$TTLàTime To Live, How much seconds cache server stores the information about DNS. And Five Parameters specified Serial Number used by slave to synchronize with master server. Refresh and Retry Time used by slave server. NS is the Name (DNS) server where lookup the domain. A (Associated IP) for particular host.
DNS has mechanism to load balance the request from clients. You can verify using host www.example.com command. MX resource records are used to define mail handler or exchanger for the domain. MX record must pass the positive integer value. This integer value is used by remote Mail Transport Agent (MTA) to determine, which host has delivery priority for the zone. The Lowest integer value will get the priority.
Answer:
Q9. 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.
Answer:
Q10. CORRECT TEXT
You are a System administrator. Using Log files very easy to monitor the system. Now there are 50 servers running as Mail, Web, Proxy, DNS services etc. You want to centralize the logs from all servers into on LOG Server. How will you configure the LOG Server to accept logs from remote host ?
Answer and Explanation:
By Default system accept the logs only generated from local host. To accept the Log from other host configure:
1. vi /etc/sysconfig/syslog
SYSLOGD_OPTIONS="-m 0 -r"
Where
-m 0 disables 'MARK' messages.
-r enables logging from remote machines
-x disables DNS lookups on messages recieved with -r
2. service syslog restart
Answer:
Q11. CORRECT TEXT
The System you are using is for NFS (Network File Services). Some important data are shared from your system. Make automatically start the nfs and portmap services at boot time.
Answer and Explanation:
We can control the services for current session and for next boot time also. For current Session, we use service servicename start or restart or stop or status. For automatically on next reboot time:
1. chkconfig servicename on or off
eg: chkconfig nfs on
chkconfig portmap on
or
ntsysv
Select the nfs and portmap services.
2. Reboot the system and identify whether services are running or not.
Answer:
Q12. 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 ..............
Answer:
Q13. CORRECT TEXT
/data directory on linux server should make available on windows to only john with full access but read only to other users and make sure that /data can access only within example.com domain.
Configure to make available.
Answer and Explanation:
1. vi /etc/samba/smb.conf
[global]
netbios name=station?
workgroup=station?
security=user
smb passwd file=/etc/samba/smbpasswd
encrypt passwords=yes
hosts allow= .example.com
[data]
path=/data
public=no
writable=no
write list=john
browsable=yes
2. smbpasswd -a john
3. service smb start
4. chkconfig smb on
/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 the 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.
Answer:
Q14. CORRECT TEXT
Install the Redhat Linux RHEL 4 through NFS. Where your Server is server1.example.com having IP 172.24.254.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
/document à configure the RAID Level 0 of remaining all free space.
After completing the installation through NFS solve the following questions. There are two networks 172.24.0.0/16 and 172.25.0.0/16. As well as there are two domains example.com on 172.24.0.0/16 network and cracker.org on 172.25.0.0/16 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: 172.24.254.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 /document
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:
Q15. CORRECT TEXT
Port 8080
Configure the squid server to allow the Local Domain and deny to my133t.org domain.
Answer and Explanation:
At exam Lab example.com domain resides on 172.24.0.0/16 Network and my133t.org resides on 172.25.0.0/16 Network.
1. vi /etc/squid/squid.conf
#detault:
http_port 8080
#Recommended minimum configuration:
# Near the src acl src section
acl allownet src 172.24.0.0/255.255.0.0
acl denynet src 172.25.0.0/255.255.0.0
#Default:
# http_access deny all
#Under Here
http_access allow allownet
http_access deny denynet
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.
Answer: