RedHat EX200 : Practice Test

Question No : 1
Create a 2G swap partition which take effect automatically at boot-start, and it should not
affect the original swap partition.
Answer: # fdisk /dev/sda
p
(check Partition table)
n
(create new partition: press e to create extended partition, press p to create the main
partition, and the extended partition is further divided into logical partitions) Enter
+2G
t
l
W
partx -a /dev/sda
partprobe
mkswap /dev/sda8
Copy UUID
swapon -a
vim /etc/fstab
UUID=XXXXX swap swap defaults 0 0
(swapon -s)

Question No : 2
Configure your Host Name, IP Address, Gateway and DNS.
Host name: station.domain40.example.com
/etc/sysconfig/network
hostname=abc.com
hostname abc.com
IP Address:172.24.40.40/24
Gateway172.24.40.1
DNS:172.24.40.1
Answer: # cd /etc/syscofig/network-scripts/
# ls
# vim ifcfg-eth0 (Configure IP Address, Gateway and DNS) IPADDR=172.24.40.40
GATEWAY=172.24.40.1
DNS1=172.24.40.1
# vim /etc/sysconfig/network
(Configure Host Name)
HOSTNAME= station.domain40.example.com
OR
Graphical Interfaces:
System->Preference->Network Connections (Configure IP Address, Gateway and DNS)
Vim /etc/sysconfig/network
(Configure Host Name)

Question No : 3
Create a volume group, and set 16M as a extends. And divided a volume group containing
50 extends on volume group lv, make it as ext4 file system, and mounted automatically
under /mnt/data.
Answer: # pvcreate /dev/sda7 /dev/sda8
# vgcreate -s 16M vg1 /dev/sda7 /dev/sda8
# lvcreate -l 50 -n lvm02
# mkfs.ext4 /dev/vg1/lvm02
# blkid /dev/vg1/lv1
# vim /etc/fstab
# mkdir -p /mnt/data
UUID=xxxxxxxx /mnt/data ext4 defaults 0 0
# vim /etc/fstab
# mount -a
# mount
(Verify)

Question No : 4
Find the files owned by harry, and copy it to catalog: /opt/dir
Answer: # cd /opt/
# mkdir dir
RedHat EX200 : Practice Test
# find / -user harry -exec cp -rfp {} /opt/dir/ \;

Question No : 5
Configure a HTTP server, which can be accessed through
http://station.domain40.example.com.
Please download the released page from http://ip/dir/example.html.
Answer: # yum install -y httpd
# chkconfig httpd on
# cd /var/www/html
# wget http://ip/dir/example.html
# cp example.com index.html
# vim /etc/httpd/conf/httpd.conf
NameVirtualHost 192.168.0.254:80
<VirtualHost 192.168.0.254:80>
DocumentRoot /var/www/html/
ServerName station.domain40.example.com
</VirtualHost>

Question No : 6
Create a 512M partition, make it as ext4 file system, mounted automatically under
/mnt/data and which take effect automatically at boot-start.
Answer: # fdisk /dev/vda
n
+512M
w
# partprobe /dev/vda
# mkfs -t ext4 /dev/vda5
# mkdir -p /data
# vim /etc/fstab
/dev/vda5 /data ext4 defaults 0 0
# mount -a

Question No : 7
Download ftp://192.168.0.254/pub/boot.iso to /root, and mounted automatically under
/media/cdrom and which take effect automatically at boot-start.
Answer: # cd /root; wget ftp://192.168.0.254/pub/boot.iso
# mkdir -p /media/cdrom
# vim /etc/fstab
/root/boot.iso /media/cdrom iso9660 defaults,loop 0 0
# mount -a
mount [-t vfstype] [-o options] device dir

Question No : 8
Configure the verification mode of your host account and the password as LDAP. And it
can ldapuser40. The password is set as "password". And the certificate login successfully
through
can be downloaded from http://ip/dir/ldap.crt. After the user logs on , the user has no host
directory unless you configure the autofs in the following questions.
Answer: system-config-authentication
LDAP Server: ldap//instructor.example.com (In domain form, not write IP)
OR
# yum groupinstall directory-client (1.krb5-workstation 2.pam-krb5 3.sssd)
# system-config-authentication
1.User Account Database: LDAP
2.LDAP Search Base DN: dc=example,dc=com
3.LDAP Server: ldap://instructor.example.com (In domain form, not write IP) 4.Download
CA Certificate
5.Authentication Method: LDAP password
6.Apply
getent passwd ldapuser40

Question No : 9
Configure a task: plan to run echo hello command at 14:23 every day.
Answer: # which echo
# crontab -e
23 14 * * * /bin/echo hello
# crontab -l (Verify)

Question No : 10
Create a catalog under /home named admins. Its respective group is requested to be the
admin group. The group users could read and write, while other users are not allowed to
access it. The files created by users from the same group should also be the admin group.
Answer: # cd /home/
# mkdir admins /
# chown .admin admins/
# chmod 770 admins/
# chmod g+s admins/

Question No : 11
Create a volume group,and set 8M as a extends. Divided a volume group containing 50
extends on volume group lv (lvshare), make it as ext4 file system, and mounted
automatically under /mnt/data. And the size of the floating range should set between 380M
and 400M.
Answer: # fdisk
# partprobe
# pvcreate /dev/vda6
# vgcreate -s 8M vg1 /dev/vda6 -s
# lvcreate -n lvshare -l 50 vg1 -l
# mkfs.ext4 /dev/vg1/lvshare
# mkdir -p /mnt/data
# vim /etc/fstab