Q41. 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.


Q42. 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.


Q43. 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.

i. echo "1" >/proc/sys/net/ipv4/ip_forward

ii. 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 in running state you should modify the /proc. From Next boot the system, kernel will take the value from /etc/sysctl.conf. If net.ipv4.ip_forward is 0, it disable the IP forwarding, if 1 then it enable the IP Forwarding.


Q44. CORRECT TEXT

You are administrator of Certkiller network. First time you are going to take the full backup of all user's home directory. Take the full backup of /home on /tmp/back file.

Answer and Explanation:

1. dump -0u -f /tmp/back /dev/hda4

dump is the standard backup utility. According to the questions, fullback should take. -0 means fullback, -u means update the /etc/dumpdates which maintains the backup record and -f means filename. If you are directly taking backup into other device, you can specify the device name.

i.e dump -0u -f /dev/st0 /dev/hda4. Where hda4 is a separate partition mounted on /home.


Q45. CORRECT TEXT

If any mail coming from outside of the local LAN block all mails.

Answer and Explanation:

Outside the LAN means my133t.org. All host on exam on example.com domain and outside domain means cracker.org.

To block the mail coming from cracker.org

1. vi /etc/mail/access

@my133t.org REJECT

2. service sendmail start | restart

3. chkconfig sendmail on


Q46. CORRECT TEXT

You have a directory /local. You want to make available that directory to all the members of example.com and trusted.cracker.org. But directory should available in read and write to all the members of example.com domain and read only to cracker.org domain.

Answer and Explanation:

1. vi /etc/exports

/local *.example.com(rw,sync) trusted.cracker.org(ro,sync)

Check the SELinux Context, should be like this:

-rw-r--r-- root root system_u:object_r:exports_t /etc/exports

Use the restorecon -R /etc command to restore the selinux context of the file.

2. service nfs start | restart

3. service portmap start | 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. NFS is RPC service so portmapper service should restart after starting the nfs service. We can specify multiple clients' list separating by space with different shared option.


Q47. CORRECT TEXT

Configure the DNS server by allowing query only from the 192.168.0.0/24 Local Network.

Answer and Explanation:

1. vi /var/named/chroot/etc/named.conf

acl localnet { 192.168.0.0/24; };

options {

allow-query { localnet; };

};

2. service named restart | start

allow-query is a global option on /var/named/chroot/etc/named.conf, specifies an address match list of hosts allowed to query this server. If this option is not set, any host can query the server.


Q48. CORRECT TEXT

Make sure on /data that only the owner user can remove files/directories.

Answer and Explanation:

By default user1 can remove user2's files due to directory permission to group member. We can prevent of deleting files from others users using Sticky Bits.chmod o+t /dataVerify /data: ls –ld /data

You will get: drwxrwx-T


Q49. 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.


Q50. CORRECT TEXT

Your Local Domain is example.com. Configure the send mail server for you local LAN by following these conditions.

i. Relay the mail from 192.168.0.0/24 Network

ii. If any mail coming from cracker.org domain block all mails.

iii. user5's mail should be get by user2.

Answer and Explanation:

1. vi /etc/mail/local-host-names

example.com

2. vi /etc/mail/sendmail.mc

dnl # DEAMON_OPTIONS(`Port=smtp,Addr=127.0.0.1,Name=MTA`)dnl

3. m4 /etc/mail/sendmail.mc >/etc/mail/sendmail.cf

4. vi /etc/mail/access

192.168.0 RELAY

@cracker.org REJECT

5. service sendmail start | restart

6. chkconfig dovecot on

7. vi /etc/dovecot.conf

protocols = pop3 pop3s imap imaps

8. service dovecot start | restart

9. chkconfig dovecot on

10. vi /etc/aliases

user5: user2

11. newaliases

/etc/mail/local-host-names file contains the aliases to hostname. Mail server program reads the

/etc/mail/sendmail.cf. To change the configuration on mail server, we should edit the

/etc/mail/sendmail.mc file and should generate the sendmail.cf using m4 command.

By default sendmail server allows to connect to local host only. So we should edit the

/etc/mail/sendmail.mc file to allow connect to other hosts.

By default sendmail server will not forward mail. we should specify on /etc/mail/access to relay or to block mail coming from domain or network or individual email address.

By default dovecot service start only the imap protocol. To start pop protocol with dovecot, we should write in /etc/dovecot.conf file.

Using /etc/aliases file we can map the user name to send mail of one user to another user. To rebuild database we use the newaliases command.