linux soln

19
1 T.Y. B.Sc. (IT) : Sem. V Linux Administration Time : 2½ Hrs.] Prelim Question Paper [Marks : 75 Q.1 Attempt any TWO: [10] Q.1(a) Explain Linux distributions. [5] (A) Linux Distributions Although there is only one standard version of Linux, there are actually several different distributions. Different companies and groups have packaged Linux and Linux software in slightly different ways. Red Hat Linux [Any five distribution 5 marks] Red Hat Linux is currently the most popular Linux distribution. As a company, Red Hat provides software and services to implement and support professional and commercial Linux systems. Red Hat freely distributes its version of Linux under the GNU Public License. Red Hat generates income by providing professional level support, consulting, and training services. Red Hat originated the RPM package system used on several distributions, which automatically installs and removes software packages. Red Hat maintains an extensive library of Linux documentation that is freely accessible online. On its Web site, you can link to its support page, which lists the complete set of Red Hat manuals, all in Web page format for easy viewing with any Web browser. Red Hat offers several commercial products and services for business and e- commerce solutions. Mandrake Mandrake Linux is another popular Linux distribution with many of the same features as Red Hat. It focuses on providing up-to-date enhancements and an easy-to-use installation and GUI configuration. SuSE Originally a German language-based distribution, SuSE has become very popular throughout Europe and is currently one of the fastest growing distributions worldwide. Debian Debian Linux is an entirely noncommercial project, maintained by hundreds of volunteer programmers. Vidyalankar [10] 10] [5] [5 there are actually are actually groups have packaged have packag Any five distribution ve distributio 5 marks] 5 ma nux distribution. As a company, Red ution. As a compa plement and support professional t and support pr ely distributes its version of Linux tributes its version o erates income by providing profess ome by providing services. Red Hat originated the R es. Red Hat orig butions, which automatically insta butions, which automatical n extensive library nsive library of Linux docum f Linux On its Web site, you ca Web site, you can link to it n et of Red Hat manuals, a Red Hat manuals, all in Web b browser. er. offers several co offers several c mmercial produc mercial rce solutions. ce solutions. Mandrake ke Mandrake Linux is another pop Mandrake Linux is another p features as Red Hat. It foc atures as Red Hat. It foc easy-to-use installation a easy-to-use install SuSE SuS Originally a Ge Orig popular thro popula distributio Deb

Upload: vaibhav-rane

Post on 30-Jan-2016

267 views

Category:

Documents


0 download

DESCRIPTION

TyBscIT 5th sem

TRANSCRIPT

Page 1: Linux Soln

1

T.Y. B.Sc. (IT) : Sem. V Linux Administration

Time : 2½ Hrs.] Prelim Question Paper [Marks : 75

Q.1Attempt any TWO: [10] Q.1 (a) Explain Linux distributions. [5] (A) Linux Distributions

Although there is only one standard version of Linux, there are actually several different distributions. Different companies and groups have packaged Linux and Linux software in slightly different ways.

Red Hat Linux [Any five distribution 5 marks] Red Hat Linux is currently the most popular Linux distribution. As a company, Red Hat provides software and services to implement and support professional and commercial Linux systems. Red Hat freely distributes its version of Linux under the GNU Public License. Red Hat generates income by providing professional level support, consulting, and training services. Red Hat originated the RPM package system used on several distributions, which automatically installs and removes software packages.

Red Hat maintains an extensive library of Linux documentation that is freely accessible online. On its Web site, you can link to its support page, which lists the complete set of Red Hat manuals, all in Web page format for easy viewing with any Web browser. Red Hat offers several commercial products and services for business and e-commerce solutions.

Mandrake Mandrake Linux is another popular Linux distribution with many of the same features as Red Hat. It focuses on providing up-to-date enhancements and an easy-to-use installation and GUI configuration.

SuSE Originally a German language-based distribution, SuSE has become very popular throughout Europe and is currently one of the fastest growing distributions worldwide.

Debian Debian Linux is an entirely noncommercial project, maintained by hundreds of volunteer programmers.

Vidy

alank

ar[10]10][5][5

there are actually are actually groups have packaged have packag

Any five distribution ve distributio 5 marks] 5 manux distribution. As a company, Redution. As a compa

plement and support professional t and support prely distributes its version of Linux tributes its version o

erates income by providing professome by providing services. Red Hat originated the Res. Red Hat orig

butions, which automatically instabutions, which automatical

n extensive library nsive library of Linux documf Linux On its Web site, you ca Web site, you can link to itn

et of Red Hat manuals, a Red Hat manuals, all in Web b browser. er.

offers several co offers several c mmercial producmercial rce solutions. ce solutions.

Mandrake ke Mandrake Linux is another popMandrake Linux is another pfeatures as Red Hat. It focatures as Red Hat. It foceasy-to-use installation aeasy-to-use install

SuSE SuSOriginally a GeOrigpopular thropopuladistributio

Deb

Page 2: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

2

Its aim is to enhance Linux with new and improved applications and implementations.

Caldera Caldera OpenLinux is designed for corporate commercial use. Caldera has organized its OpenLinux distribution into several different packages, each geared to different markets. These include the eDesktop package, which is designed for basic workstation operations, and the eServer package, which is designed for Linux servers.

Caldera also offers a line of commercial and proprietary Linux packages. Slackware Slackware is available from numerous Internet sites, and you can order the CD from Walnut Creek Software. The Slackware distribution takes special care to remain as closely Unix compliant as possible.

TurboLinux TurboLinux provides English, Chinese, and Japanese versions of Linux. It includes several of its own packages, such as TurboPkg, for automatically updating applications.

Q.1 (b) How loader works? State the difference between grub and lilo. [5] (A) Grub : Grub stands for Grand Unified Bootloader. The bootlader is the software program. If you have multiple kernel images installed on your system, you can choose

which one to be executed. GRUB displays a splash screen, waits for few seconds, if you don’t enter

anything, it loads the default kernel image as specified in the grub configuration file. (grub.conf in /boot)

GRUB has the knowledge of the filesystem (the older Linux loader LILO didn’t understand filesystem). Grub configuration file is/boot/grub/grub.conf (/etc/grub.conf is a link to this). [Working of loader 3 marks and difference 2 marks (4 points)]

GRUB LILO

GRUB stands for GR and Unified Bootloader.

Stands for Linux Loader

GRUB supports an unlimited number of boot entries.

LILO supports only up to 16 different boot selections;

GRUB can boot from network. LILO cannot boot from network.

Vidy

alank

art packages, ges

ckage, which is hich package, which is e, which is

ary Linux packages. ux packages

net sites, and yoes, and you can order the Cu can orderware distribution takes special carstribution takes s

ssible.

, Chinese, , Chinese, and Japanese versiond Japanese wn packages, packages, such as TurboPkg,such as Tur

rks? State the difference betwtate the differenc stands for Grand Unified Bootloa for Grand Unified

ader is the software program. he software prog have multiple kernel images have multiple kernel image insta

ch one to be executed. one to be executedGRUB displays a splash screen, w displays a splash scanything, it loads the defauing, it loads the deconfiguration file. (gconfiguration file. (grub.conf.con

GRUB has the knowledg GRUB has the kndidn’t understand filesn’t understaGrub configuration Grub confithis). th [W

VVGRUB BooVV

Page 3: Linux Soln

Prelim Paper Solution

3

There is no need to change GRUB when the configuration file is changed as GRUB is dynamically configurable.

LILO must be written again every time you change the configuration file.

GRUB has an interactive command interface.

LILO does not have an interactive command interface.

GRUB has the knowledge of the file system.

LILO doesn’t have the know ledged file system.

Q.1(c) State any 5 linux supported file systems and explain ext3 and ext 2. [5] (A) 5 Linux Supported File System [1 mark]

1. ext3 2. ext2 3. Reiser 4. FAT

5. NTFS ext2(non-journaling file system) [2 marks] xt2 stands for second extended file system. ext2 does not have journaling feature. On flash drives, usb drives, ext2 is recommended, as it doesn’t need to

do the over head of journaling. Can handle file systems up to 4 TB It supports long file names up to 1012 characters. In case user processes fill up a file system, ext2 normally reserves

about 5% of disk blocks for exclusive use by root so that root can easily recover from that situation.

Ext3 [2 marks] Ext3 stands for third extended file system. Starting from Linux Kernel 2.4.15 ext3 was available. The main benefit of ext3 is that it allows journaling. Journaling has a dedicated area in the file system, where all the changes

are tracked. When the system crashes, the possibility of file system corruption is less because of journaling. (If no journaling, then fsck commend(file system consistency check) is used to check for the corrupted file and to repair that file).

Under ext2, when a file system is uncleanly mounted, the whole file system must be checked. This takes a long time on large file systems. ext3 keeps a record of uncommitted file transactions and applies only those transactions when the system is brought back up.

eract

e know ledged ledge rarrr ext3 and ext 2. [5]d ext 2. [5] [1 mark] [1 mark]

em) extended file system. extended file system. laaling feature.

ala ext2 is recomm

ala journalinaltems up to 4 TB

yag file names up to 1

ya processes fill u

dyaout 5% of disk blocks for e

dya

over from that sit

dyidy

Vidy Ext3 stands for third e

Vidy Starting from

VidThe main b

Vid

urnaViVVVV

Page 4: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

4

Maximum individual file size can be from 16 GB to 2 TB Overall ext3 file system size can be from 2 TB to 32 TB

You can convert a ext2 file system to ext3 file system directly (without backup/restore).

Q.1(d) Explain RAID levels with diagram. [5] (A) RAID :

Is an acronym for Redundant Array of Independent Disks. Used for maintaining copy of the data.

There are two types of RAID – hardware RAID and Software RAID. Hardware RAID – in H. RAID, the disks have their own RAID controller with built in software that handles RAID disk setup. The controller is a card in one of the system’s expansion slots. Ot it may be built onto the system board. The O/S does not control the RAID level used, it is controlled by the hardware RAID controller. Software RAID – there is no RAID controller card. The O/S is used to set up a logical array and the O/S controls the RAID level used by the system.

Six RAID levels are commonly used. The three most commonly used RAID levels are RAID level 0 – stripping [½ mark]

This level requires at least two disks and uses a method called striping that writes data across both drives. There is no redundancy provided by this level of RAID, since the loss of either drive makes it impossible to recover the data. This level does give a speed increase in writing to the disks.

Vidy

alank

ar[5][5]

ks.

d Software RAID. are RAID. eir own RAID controller with r own RAID controller w

p. The controller is a card in one controller is a card i be built onto the system board. Tht onto the system bo

sed, it is controlled by the hardw is controlled by

RAID co controller card. The O/S isntroller card. /S controls/S controls the RAID level used b he RAID leve

commonly used. usedmmonly used RAID levels are y used RAID levels a

0 – stripping ripping el requires at least two ires at least two disks andd

writes data across both drives. Thta across both ds level of RAID, since the loss ofs level of RAID, since the

recover the data. This leveover the data. Th l doesdisks. ks.

Page 5: Linux Soln

Prelim Paper Solution

5

RAID level 1 – Mirroring [½ mark] This level requires at least two disks and uses a method called mirroring. With mirroring, the data is written to both of the drives. So, each drive is an exact mirror of the other one and if one fails the other still holds all the data. There are two variants to level 1 with one variant using a single disk controller that writes to both disks. The other variant uses two disk controllers, one for each disk. This variant of RAID level 1 is known as duplexing.

RAID level 2 – Error Checking and Correction [1 mark]

Requires minimum 3 disks. RAID 2 adds error checking and correcting checksums to RAID-1. ECC is Error correcting code in which each data signal confirms to specific rules of construction so that departures from this construction in the received signal can generally be automatically detected and corrected.

RAID level 3 – Byte-Level Striping with Parity Disk [1 mark]

Requires minimum 3 disks. It does striping, like RAID-0, but at a very small granularity. It also adds parity disks which helps in error detection and recovery.

RAID 2

Disk 0 Disk 1 Disk 2 Disk 3 Disk 4 Disk 5 Disk 6

A1 B1 C1 D1

A2 B2 C2 D2

A3 B3 C3 D3

A4 B4 C4 D4

Ap1 Bp1 Cp1 Dp1

Ap2 Bp2 Cp2 Dp2

Ap3 Bp3 Cp3 Dp3

Vidy

alank

ar a sing

es two disk disk 1 is known as own a

Checking and Correction Checking and Correction disks. RAID 2 aks. RAID 2 adds error checkdds error

ID-1. ECC is Error co is Error correcting codrrecs to specific rules of construction ecific rules of constr

uction in the received si n the received signal cang and corrected. orrected.

RAID Req

idyidyidyidyidyidydydydydydydydydya

dydydydydydydya

dya

dya

dyayyayyayyyyyyayayayaaaaadyayayaRAID 2

Disk 0

A1 B1

A2 2

Page 6: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

6

RAID level 4 – Block-Level Striping with Parity disk [1 mark] requires minimum 3 disks. It attempts to add error checking and recovery to RAID-3 by doing block level striping with the addition of a single parity disk.

RAID level 5 – Block-Level Striping with Distributed Parity [1 mark] It requires at least three disks and uses striping to write the data across the two disks similarly to RAID 1. But unlike 1, this level uses the third disk to hold parity information that can be used to reconstruct the data from either, but not both, of the two disks after a single disk failure.

The information of system’s RAID configuration is stored in /etc/traidtab .

RAID 3

Disk 0 Disk 1 Disk 2 Disk 3

A1 A4 B1B4

A2 A5 B2B5

A3 A6 B3B6

Ap(1 3)

Ap(4 6)Bp(1 3)Bp(4 6)

RAID 4

Disk 0 Disk 1 Disk 2 Disk 3

A1 B1 C1 D1

A2 B2 C2 D2

A3 B3 C3 D3

Ap Bp

Cp

Dp

RAID 5

Disk 0 Disk 1 Disk 2 Disk 3

A1B1C1Dp

A2 B2 Cp D1

A3Bp

C2D2

Ap B3

C3

D3 Vidy

alank

ar arity disk rity disk [1 mark][1 mars to add error checking and add error checking

vel striping with the addition of riping with the addit

ID level 5 – Block-Level StripiID level 5 – Block-Level S ng It requires at least three disks requires at leastacross the two disks similarly tss the two disks sthird disk to hold parity infohird disk to hold paritydata from either, but nata from either, but failure. ilure

3

alalllllalaalalalalalalalaaaaalalanlalalanlanlanlanananananaanaaanananananananannkD 4

Disk 0 Disk 1 Disk 2Disk 0 Disk 1

D

A3 B3 C3 D

Ap

Bp

C

Page 7: Linux Soln

Prelim Paper Solution

7

Q.2Attempt any TWO: [10] Q.2 (a) How to manage rc scripts using chkconfig? [5] (A) To configure any software package to work at boot time use this command

with following options: [Each point 1 mark] 1. To check all packages working at which run levels

#chkconfig –list 2. To check whether package is working at boot time

#chkconfig –list packagename 3. To reset run levels for any package

#chkconfig –levels 0123456 packagename OFF 4. To set run levels for any package

#chkconfig –levels 23456 packagename ON Q.2 (b) Configure a network for class c and also set ip for default

gateway and DNS. [5]

(A) Setting IP for the machine: [3 Mark] #ifconfig etho 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255 Setting IP for the Default Gateway: [1 Mark] #route add default gw 192.168.2.3 Setting IP for the DNS: [1 Mark] #vi /etc/resolv.conf

Set two IP and save the file Q.2(c) What is the process to create grub boot floppy? [5] (A) (a) Boot a Linux with Grub support and log in as root or in superuser mode

(su followed by the password) [1 mark] (b) Format the floppy in MsDOS (or Ext2) by typing "mkmsdosfs -F32

/dev/fd0" after inserting a floppy into the drive. [1 mark] (c) Create a mounting point, mount the floppy and make the necessary

directories to store the files at a designated location where Grub will search for them

#mkdir /mnt/fd0mount /dev/fd0 /mnt/fd0 #mkdir /mnt/fd0/boot #mkdir /mnt/fd0/boot/grub

(d) Copy all the necessary files in /boot/grub directory of the booted Linux to the mounted fd0

# cd /boot/grubtar [2 mark] (e) To remove or erase the content of /mnt/fd0/boot/grub/menu.lst. Grub

will boot to Grub prompt if there is no instruction in the menu.lst or the menu.lst is empty or unavailable. If the System Rescuse CD is used its menu.lst has already been emptied.

Vidy

alank

ard also set ip for default set ip for defau [5

[3 sk 255.255.255.0 broadcast 192.1255.0 broadcas

teway: 168.2.3 168

e the file file

e process to create grub boot fless to create grub a Linux with Grub support and ith Grub suppor lo

u followed by the password) u followed by the password) Format the floppy in MsDOS rmat the floppy i/dev/fd0" after inserting a floev/fd0" after insert

(c) Create a mounting point, reate a mounting poidirectories to store theirectories to store thsearch for them search for the

#mkdir /mnt/fd0m #mkdir /mn #mkdir /mnt/f #mkdir #mkdir /mnt

(d) Copy all t(d) to the

# c(e) T

Page 8: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

8

(g) Reboot the Linux, again log in as root or in superuser mode, drop into command prompt and activate Grub by just type grubroot (fd0)setup (fd0) Grub will search the stage1 and stage2 files in the floppy. If they exist Grub will install them in the boot sector. [1 mark]

Q.2 (d) What are the security considerations for NFS? [5] (A) Authentication: Client should prove that it is a valid user through

authentication. [Every point 1 mark] Encryption and decryption: Since files are traversing in a network, there is possibility of an attack, so convert the file in cipher text using encryption and decryption technique. Hard Mooting and soft mounting: The process of requesting a server continuously till client gets the file is called as hard mounting. The process of requesting a server periodically for some attempts is called as soft mounting. Cross Domain Mounting: Two machines mounting the files of each other is known as Cross Domain Mounting Root Squash: Squashing the rights of root user of client for the exported file is called as Root Squash. Per User and Per Host: It is possible to provide security w.r.t machine or user.

Q.3Attempt any TWO: [10] Q.3 (a) Explain the NTP utility programs. [5] (A) [Any 5 program 5 marks]

PROGRAM DESCRIPTIONntpdate Sets the system date and time via NTP ntpdc Controls the NTP daemon, ntpd ntp-keygen Generates public and private keys for use with NTP ntpq Queries the NTP daemon ntpsim Provides NTP simulation for development and testing ntptime Displays the time variables maintained by the Linux kernel ntptrace Traces a chain of NTP servers back to the primary source tickadj Sets certain time variables maintained by the Linux kernel

Vidy

alank

ar[5][5]

user through hrougery point 1 mark] nt 1 mark]

a network, there is work, there is text using encryption ing encryption

ess of requesting a server ss of requesting a serv s hard mounting. mounting.

dically for some attempts is calle for some attempts

ines mounting thuntin e files of each oe files of

ights of r of root user of client for toot user of ch. h.

It is possible to provide securi is possible to provide

NTP utility programs. utility programs.

PROGRAMOGRAM DESCRIPTIONDESCR

dya

dyntpdate Sets the systemdate Sets thedyddyntpdc Controls thepdc Controls dyiddyntp-keygen Generatep-keygen GenerateidyViddyntpq Querientpq

Vidy

Viddyntpsim Prontpsim

Vid

Vidd

ntptime timeViVintptrace VVVtickadj VVV

Page 9: Linux Soln

Prelim Paper Solution

9

Q.3(b) Write the configuration for accessing /data from linux machine. [5] (A) On Linux Machine: [4 marks]

#mkdir /data #chmod 777 /data Edit samba configuration file and set WORKGROUP= samba, also make /data sharable with some users for e.g. abc.

On windows machine: [1 mark] Open My Network Places -> samba-> login as abc

This makes /data sharable with windows. Q.3 (c) State and explain any 5 parameters of squid.conf [5] (A) Squid.conf [Any 5 lines explanation 5 marks] 1. Chache effective user user : squid.conf 2. chache effective user group : squid 3. httpd_accer_with_proxy yes/No 4. httpd_accer_IP 5. httpd_accer_porl 50 6. httpd_accer_uses_host_hiodes yes/No 7. httpd_access : allow all/cliny all line 1 & 2 Specifies name of squid. Line 3 if yes. Squid is proxy with caching.chi.squid only proposy Line 4 spceifies IP of caching Line 5 specifies part of caching Line 6 if yes. Clinet will be configure automatically, else manually. Line 7 Specifies who is going to access squid. Q.3 (d) Write a short note on squid. [5] (A) Providing Process Caching Server: (SQUID) [Diagram 2 marks and explanation 3 marks] SQUID is by default a process server but can also be used as a caching

souses. For eg.

SQUID

C2

C1

C3

C5

C4

C6

Vidy

alank

arke /da

[1 mark] ark]

confonf [5] Any 5 lines explanation 5 marks] nes explanation 5 ma

conf quid

o

t_hiodes t_hi yes/No yes/No all/cliny all cliny a

ifies name of squid. name of squid. s. Squid is proxy wi is proxy with caching.chi.sth cach

pceifies IP of caching s IP of caching 5 specifies part of caching s part of caching

ne 6 if yes. Clinet will be cone 6 if yes. Clinet will be configureLine 7 Specifies who is going to ae 7 Specifies who

d) Write a short note on squid.d) Write a short note on squ) Providing Process Caching S) Providing Process Caching

(SQUID) (SQUID) SQUID is by default QUID is by dsouses. For eg. souses. For

Page 10: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

10

SQUID which maintains the caching recourses is responsible to cahce frequency vistted websites web pages to that the time is should from accessing the webpage.

The caching resource is also because accelerates recourse (accel). Q.4Attempt any TWO: [10] Q.4 (a) Define zone and create a zone file for www.abc.com having Ip

233.41.22.4 [5]

(A) Zone Definition: [2 marks] Zone “www.abc.com” IN { Type “Master”;

File “abc.zone”; }

Zone File [3 marks] @ IN SOA www.abc.com ( 42; Serial 3H; Refresh 15M; Retry 2D; Expiry 3D); Minimum TTL IN A 233.41.2.4

Q.4(b) Write Configuration steps of caching dns server [5] (A) 1. Install DNS package. # rpm I bind Output : bind verno installed.

2. Once DNS is installed, DNS configuration file “named.conf” will be created, which SHOULD having following definition.

Zone “ . “ IN { Type “Hint”; File “named.ca” ; } [1 mark] 3. Make sure that, DNS cache has an entry to map local host to loopback. 4. Make sure that /etc/nsswith.conf contain the following line to re direct

the client. hosts: file dns 5. Make sure that / etc/hosts has the word “bind”

Vidy

alank

ar[10][10]

aving Ipp [5][5

[2 marks] [2 marks]

[3

TTL 2.4

Configuration steps of caching Configuration steps of ca Install DNS package. tall DNS package.

# rpm rpm I bind I b Output : bind verno installe Output : bind verno inst2. Once DNS is installed2. Once DNS is installed

created, which SHOUcreated, whic Zone “ . “ IN Zone “ . “ I { Type “Hint File “na } 3. Ma

4. M

Page 11: Linux Soln

Prelim Paper Solution

11

6. Make sure that/etc/resolv.conf has IP of DNS. 7. Start the revises of DNS #revises bind starts [4 marks] Q.4 (c) Give syntax and example of scp and sftp. [5] (A) Answer not given 1. ssh (Secure Shell): It is a replacement of telnet which connect a local m/s

to a remote m/c through command terminal. The traffic between 2 m/c is incrupted and a virtual tunnel is created. [1 marks]

2. scp (Securce Copy) : It is a replacement of scp to copy a file from a local m/c to a remote m/c and vice versa.

Syntart : # scp src dutn e.g. 1 : Copy file it from a local m/c a remote m/c B/abc directory # scp fl.fxt B:/abc

e.g. 2: Copy a file f2 from remote m/c B/abc directory into local m/c /pq r directory.

# scp B/abc/f2.txt/pqr [2 marks] 3. sttp (secures file transfer protocol) : It is a replacement of file t transfer

a file between client and a serves. Syntax : sttp src destn Eg.1 : copy content of file it from local m/c remote m/c B/abc directory. Eg. 2: Copy contents of file from remote m/c B/abc directory into local

m/c/pq directory. # step B/abc?f2.txt/[pqr/f2.txt [2 marks]

Q.4(d) Explain the important files used by DNS server. [5] (A) /etc/nsswitch.conf [Any 5 for 5 marks]

It tells the browser not to contact the DNS server directly, first check whether required entry is present in DNS cache

/etc/hosts It is DNS Cache

/etc/resolv.conf It contains IP of DNS servers

/etc/named.conf It is general DNS Server Configuration File

/var/named/named.local It is used for mapping Loopback IP to Local Host

Vidy

alank

ar[

ect a local m/s cal m/ between 2 m/c is n 2 m/c is

[1 marks] [1 marks] copy a file from a local le from a local

te m/c B/abc directory B/abc directory

m/c B/abc directory into local m/cbc directory into

protocol) : It is a replacement of fol) : It is a replac

a serves. a serves. stn

t of file it from local m/c remote m from local m/c rentents of file from remote m/c B of file from remote

ctory. /abc?f2.txt/[pqr/f2.txt 2.txt/[pqr/f2.txt

n the important files used by Dn the important files usedc/nsswitch.conf sswitch.conf

It tells the browser not to conts the browser not whether required entry is presher required entry is p

/etc/hosts /etc/hosts It is DNS Cache s DNS Cach

/etc/resolv.conf/eIt contains IIt c

/etc/naIt is

Page 12: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

12

/var/named/named.ca It is DNS cache server configuration File

/etc/named.conf/zone It is used for forward mapping.

/etc/named.conf/reverse zone It is used for reverse mapping.

Q.5Attempt any TWO: [10] Q.5 (a) How to configure user level ftp access? [5] (A) Answer not given [3 marks]

The /etc/vsftpd/ftpusers file is the simplest to understand. It contains a list of user or account names, one per line, that are not allowed to log in using FTP. This file is used to increase security. For example, if a cracker somehow obtains the root password but (stupidly) tries to log in as root using FTP, the login attempt will fail. Notice that the filename is annoyingly counterintuitive: user accounts listed in this file are not permitted to log in to the system via FTP. In general, /etc/vsftpd/ftpusers is used to prevent privileged user accounts, such as root, from using FTP to obtain access to the system. The following code shows the default /etc/vsftpd/ftpusers file:

root bin daemon adm Ip sync shutdown halt mail news uucp operator games nobody

So, to prevent a user named bubba from using FTP to log in, or, rather, to prevent bubba from logging in to the system via FTP, add bubba to the end of /etc/vsftpd/ftpusers. In most cases, these default entries should be sufficient, but if you install a software package, such as a database package, that requires one are more special user accounts, consider adding such special accounts to /etc/vsftpd/ftpusers in order to maintain strict limits on how the FTP server can be accessed.

Vidy

alank

ar[10][10][5][5]

[3 marks] [3 marks] to understand. It contains a o understand. It contain

, that are not allowed to log in re not allowed to security. For example, if a crackety. For example, if a

but (stupidly) tries to log in as upidly) tries to lil. Notice that the filename is ane that the filenam

sted in n this file are not permitte this file are not pneral, /e /etc/vsftpd/ftpusers is ustc/vsftpd/ftpus

such as root uch as root, from using FTP to from using Fng code shows the default /etc/vsde shows the default /

hutdown own

halt mail l news news uucp uucpoperator peratogames s nobody

So, to preveSo, prevent bpre/etc/vssuff

Page 13: Linux Soln

Prelim Paper Solution

13

The /etc/vsftpd/user_list file serves a purpose similar to /etc/vsftpd/ftpusers, limiting FTP access, but it is more flexible. If you compare the two files, though, you see that the users listed in /etc/vsftpd/user_list are the same ones listed in /etc/vsftpd/ftpusers. So, what is the difference between the two files? /etc/vsftp/ftpusers unconditionally denies access to the system via FTP; /etc/vsftpd/user_list can be used to deny or permit access, depending on the value of the userlist_deny directive in /etv/vsftpd/vsftpd.conf. If userslist_deny is set to NO (that is, userlist_deny=NO), then vsftpd allows FTP access only to the users listed in /etc/vsftpd.user_list. If userlist_deny is set to YES (that is, userlist_deny=YES), no user listed in /etc/vsftpd/user_list will not be permitted to login via FTP. Such users will not even be prompted for a password. [2 marks]

Q.5 (b) Write the steps to configure postfix server. [5] (A) #rpm –i postfix [All steps compulsory for 5 marks]

#service sendmail stop #chkconfig –levels 0123456 sendmail OFF #chkconfig –levels 2345 postfix ON #service postfix start #telnet localhost 25

Q.5(c) Create a file f1.txt in /data and upload it on server whose ip is

2.3.4.5. Also download file 2.txt from server. [5]

(A) #mkdir /data [All steps compulsory for 5 marks] #cd mkdir #touch f1.txt #ftp 2.3.4.5 Username: abc Password:*** ftp> put /data/f1.txt ftp>get f2.txt ftp>quit #

Q.5 (d) Explain protocols required to configure mail server. [5] (A) Tracing the Email Delivery Process

The usual email delivery process involves three components, a mail user agent, a mail transfer agent, and a mail delivery agent.

Vidy

alank

arftpuse

d/user_list _list value of the of th

slist_deny is set eny is set TP access only to the ss only to the

is set to YES (that is, o YES (that is, pd/user_list will not be r_list will not be

ot even be prompted for a t even be prompted for [2 marks] [2 ma

server.. [All steps compulsory for 5 All steps compulsor

endmail OFF il OFF ostfix ON stfix ON

f1.txt in /data and upload it in /data and uploso download file 2.txt from serwnload file 2.txt fr

/data kdir kdi

ouch f1.txt f1.txt #ftp 2.3.4.5 2.3.4.5 Username: abc name: abc Password:*** asswordftp> put /data/f1.txt ftp> put /data/f1ftp>get f2.txt >get f2.txftp>quit ftp>quit # #

Q.5(d) Explain p Ex) Tracin

The

Page 14: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

14

i) Mail User Agent (MUA) To be able to send mail, you or your users need a program called a mail user agent, commonly abbreviated as MUA and widely referred to as a mail client. The MUA provides users an interface for reading and writing email messages. Two types of MUAs are available: those that have a graphical user interface (GUI), such as Mozilla Thunderbird or KMail, and those that have a command line interface (CLI), such as Mutt or elm. Whether your MUA is a GUI or CLI, the functionality is the same. After composing an email message, the MUA sends it to a mail transfer agent (MTA), which transmits the message across the network.

ii) Mail Transfer Agent (MTA) A mail transfer agent, usually abbreviated as MTA, is the program that

sends the message across the network.

The MTA reads the information in the To: section of the email message and determines the IP address of the recipient's mail server. Then the MTA tries to open a connection to the recipient's server through a TCP/IP port, typically port 25. DNS, the Domain Name System, plays a role in mail deliver, too. MTAs query a domain's DNS mail exchanger, or MX, record, to determine the host that is responsible for receiving mail for that domain. If the MTA on the sending machine can establish a connection to the destination MTA, it transmits the message using the Simple Message Transfer Protocol (SMTP).

In some cases, the message might not be immediately deliverable, so the sending MTA will store in a local queue and attempt retransmission after a set amount of time. In other cases, the receiving MTA might refuse delivery, causing the message to bounce and be returned to the sender's MUA.

iii) Mail Delivery Agent (MDA) After the MDA (sometimes referred to as a local delivery agent, or

LDA) receives the message from the MTA, it stores the new message in the recipient's mailbox file. The mailbox file, known traditionally as the mail spool, is almost always identified by the recipient's username.

Introducing SMTP The SMTP protocol can transfer only ASCCII text. It can’t handle fonts, colors, graphics, or attachments. If you want to be able to send these items, you need to add another protocol to SMTP, MIME. MIME stands for Multipurpose Internet Mail Extensions. MIME is implemented on top of the

Vidy

alank

ar have

d or KMail, Mail s Mutt or elm. or elm

the same. After ame. After mail transfer agent ransfer agent

etwork.

ed as MTA, is the program that MTA, is the program .

n the To: section of the email me To: section of the es of the recipient's mail server. T recipient's mail

ection to n to the recipient's serverthe recipient's ort 25. DN ort 25. DNS, the Domain Name S the Domain

oo. MTAs query a domain's DNS m MTAs query a domain'ermine the host that the host th is responsib is r

. If the MTA on thhe MTA on the sending me seno the destination MTA, destination MTA, it transm

essage Transfer Protocol (SMTP). ansfer Protocol (S

me cases, the message might not the message minding MTA will store in a local quending MTA will store in a lo

a set amount of time. In other et amount of timedelivery, causing the message livery, causing the mMUA. MUA

iii) Mail Delivery Agent iii) Mail Delivery After the MDA (After the

LDA) receives tDA) rthe recipienmail spoo

IntroduThe co

Page 15: Linux Soln

Prelim Paper Solution

15

SMTP protocol and enables you to add colors, sounds, and graphics to your messages and still deliver them via SMTP. For MIME to work, you must have a MIME-compliant MUA (most are).

Understanding POP3 Two other protocols are part of the email process: Post Office Protocol version 3, known as POP3, and Internet Message Access Protocol version 4, known as IMAP4.

Without POP3 (or IMAP), and MUA and MTA can't communicate. That is, if you want to read your mail, need POP3 (or IMAP) to retrieve messages that arrive at your MTA while you're offline. POP3 uses the MTA's storage to hold messages until they are requested. When users want to check their email, they connect to the POP3 server and retrieve messages that were stored by the server. After retrieval, the messages are stored locally (that is, locally to the MUA) and use the MUA on your PC to read them at your leisure.

Q.6Attempt any TWO: [10] Q.6 (a) Write a code to host three websites with same ip [5] (A) Write the following code in httpd.conf

NameVirtualHost 192.168.2.1:80 <VirtualHost *:*> ServerName www.a.com DocumentRoot /var/www/a/html DocumentIndex home.html </VirtualHost> [2½ marks] <VirtualHost *:*> ServerName www.b.com DocumentRoot /var/www/b/html DocumentIndex home.html </VirtualHost> <VirtualHost *:*> ServerName www.c.com DocumentRoot /var/www/c/html DocumentIndex home.html </VirtualHost> [2½ marks]

Vidy

alank

arocol version sion

on 4, known as own a

ommunicate. That is, if ate. That is, if o retrieve messages that ieve messages that

uses the MTA's storage to uses the MTA's storage hen users want to check their sers want to check t

and retrieve messages that weretrieve messages th the messages are stored locally (tssages are store

MUA on your PC to read them a on your PC to read

hree websites with same ipe websites with same ode in httpd.conf pd.con

92.168.2.1:80 8.2.1:80>

www.a.com com Root /var/www/a/html r/www/a/html

entIndex home.html entIndex home.hrtualHost> ualHost>

VirtualHost *:*> Host *:ServerName www.b.com erName wwwDocumentRoot /var/www/b/DocumentRoot /var/www/b/DocumentIndex home.htmDocumentIndex h</VirtualHost> VirtualHost> <VirtualHost *:*> alHosServerName wwwServerNaDocumentRooDoDocumentIDoc</Virtua

Page 16: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

16

Q.6(b) Explain rpm command with its options [5] (A) Rpm stands for red hat package manager which can be used with different

options [Any 5 options for 5 marks] To check which all packages are installed use –qa #rpm -qa To check whether specific package is installed or not use –q #rpm –q packagename To install specific package use –i #rpm –i packagename To update the package use –U #rpm –U packagename To remove the package use –e #rpm –e packagename

Q.6 (c) Why the name apache for Web server? State the difference

between apache 1.0 and apache 2.0. [5]

(A) Apace 1.0 [2½ marks] 1. Apache 1.0 makes the use of monatomic process model to handle the

traffic. 2. As the traffic increases, master web server mail creates child server

process (CSP). This is called as sparing the server. 3. When the child server process gets overloaded due to many traffic

master server creates are more child server process. (max 2sc CSP) 4. When the traffic is reduced. 5. Master server will kill child server process.

For eq. CSP : Child Server Process

Monatomic Process Model

Disadvantage: Heavy weight technique spawning and Rilling requires huge rescores

MASTER WEB SERVER

Csp1 Csp2 Csp2 SCVidy

alank

ar erver? State the difference State the dif

.0. [2

e of mona monatomic process model ttomic proces

eases, master s, master web server mail crweb server is is called as sparing the server. d as sparing the s

ld server process gets overloadrver process gets ovver creates are more child server tes are more child

CSP) the traffic is reduced. fic is reduced.

ster server will kister server will k ll child server p child seFor eq. r eq.

CS

D

dydyMASTER

Vid

Vid

Csdd

Page 17: Linux Soln

Prelim Paper Solution

17

Apache 2.0 [2½ marks] 1. Apache 2.0 makes the use of multi processing model (mpm)

2. As the traffic increases, master web server creates child server process which in two creates child threads.

3. As the traffic is decreased, the child threads and when child server process will be Rilled.

E.g. Multiprocessing model (mpm) CSP : Child Server Process CT : Child Thread Advantage : Light weight technique, spawning and Rilling threads requires less require resources.

Q.6 (d) Explain useradd command with options [5] (A) This command adds user to the system. [Any 5 options for 5 marks]

Syntax: #useradd [-c] [-d] [-e] [-f] [-g] [-G] [-p] [-s] [-u] [-n] [-r] username Options: C: comment D: home dir E: Account expiration F: days after which password expires g: primary group G: Supplemental group P: password S: Shells U:uid R: acc but no dir is assigned

E.g. #useradd abc

Master with

CSP1 CSP2 CSP256

CT CTM CT CTM

Vidy

alank

ar serv

rocess rocd

eight technique, spawnihnique, spawning and Ringrces.

radd command with options ommand with optionmand adds user to the system. s user to the sys

x: x: seradd [-c] [-d] [-e] [-f] [-g] [-G] add [-c] [-d] [-e] [- [

Options: ns: C: comment : comment D: home dir D: home dir E: Account expiration E: Account ex F: days after whic F: days afte g: primary grou prim G: Suppleme

P: passwo S: She U:u R

E

kanka

nkaCSP256ka

aak

Page 18: Linux Soln

Vidyalankar : T.Y. B.Sc. (IT) Linux

18

Q.7Attempt any THREE: [15] Q.7 (a) Explain swap partition [5] (A) Swap partition [All points compulsory for 5 marks]

As the disk is much slower than RAM, the system’s performance is slower when the operating system has to perform a lot of paging. Virtual memory enables one to run programs using swap partition that one otherwise could not run.

It is used for virtual memory to hold data that is too large to fit into system RAM.

The swap partition should be at least 32MB or two times the system’s RAM, whichever larger.

Q.7 (b) Explain mount command with 5 options [5] (A) Mount command is used on client machine for mounting the file on Client

from server machine. [Any 5 options for 5 marks] Syntax: #mount source mount point E.g. #mount server A:/home / pqr Different options of mount command: 1. ro Requesting for read only operation 2. rw Requesting for read write operation 3. bg Do all the operation in background without disturbing user 4. Soft Use soft mounting 5. Hard Use hard mounting

Q.7 (c) How to configure samba? Also explain how to add samba user. [5] (A) Configure Samba [3 marks]

#rpm –i samba #vi /etc/samba/smb.conf #service samba start #smbmount //terry/c /mnt/win Adding samba user [2 marks] #useradd username #passwd username #smbpasswd –a username #smbpasswd username

Vidy

alank

arr onerar

to fit into

armes the system’s RAM, system’s RAM,

[5]e for mounting the file on Clientting the file o

[Any 5 options for 5 mar [Any 5 option

qr qr nt command: command:

d only operation operation

or read write operation write operation

he operation in background withou he operation in background Soft ft

se soft mounting t mounting 5. Hard rd Use hard mountingUse hard mounting

Q.77(c) How to configure sa(c) How to configur mb(A) Configure Samba figure

#rpm –i samba #rpm –i sa#vi /etc/samba#v#service sa#se#smbmou#Addin#u

Page 19: Linux Soln

Prelim Paper Solution

19

Q.7(d) What is dns used for? Explain different types of dns servers [5] (A) DNS is used for mapping URL to IP. [2 marks]

Types of DNS SERVERS [every server 1 marks each] Primary or master: This is a DNS server maintained by ISP to map URL to IP. Secondary or Secure : This is a backup securer of primary and hence is a replica of primary. It replies only if primary fails. Caching or hint: This is a DNS cache which is maintained on a client machine that contains ip of frequently visited URL.

Q.7(e) How to disable unknown user upload? What is warez server? [5] (A) There are following two methods that can disable unknown user:

Method 1: [2½ marks] 1. Find all the directories and files uploaded by user ftp and remove them

#find / user(ftp)|xargs rm – rf 2. Remove user ftp

#userdel ftp Method 2: [2½ marks] In a file user_list put username ftp and in vsftpd.conf set USER_DENY=yes also set anonymous_enable=no The server that becomes source to circulate and distribute illegal document like virus is called as WAREZ server

Q.7(f) What is content negotiation? [5] (A) Content negotiation refers to the technique Web clients and servers use to

select how to present a resource, such as a document that is available in several different formats. For example, suppose that a Web page is available in different languages. One way to select the proper language is to give the user an index page from which she chooses the desired language. Content negotiation enables the server to choose the preferred language automatically based on information a Web browser sends, indicting what representations it prefers. [Basic explanation with example 5 marks]

Vidy

alank

ar hence is a is a

a client machine chine

arez server? [5]rver? [5]e unknown user: unknown u

[2½ marks] [2½ maded by user ftp and remove them user ftp and remove

name ftp name ftp and in vsftpd.conf set Uand in vsftpd.con

ble=no no mes source to circce to circulate and distrulate an

as WAREZ server REZ server

ntent negotiation? negotiation? negotiation refers to the techn refers to the niqu

how to present a resource, such how to present a resourceral different formats. For ex different forma

available in different languages. Oble in different langugive the user an index page fr the user an index pagContent negotiation enablesContent negotiation enableautomatically based on automatically basrepresentations it preresentations