Академический Документы
Профессиональный Документы
Культура Документы
V
Linux Administration
Time : 2½ Hrs.] Prelim Question Paper [Marks : 75
r
several different distributions. Different companies and groups have packaged
packag
Linux and Linux software in slightly different ways.
ka
Red Hat Linux [Any
Any five
ve distribution
distributio 5 ma
marks]
Red Hat Linux is currently the most popular Linux
nux distribution.
ution. As a company,
compa Red
Hat provides software and services to implement
plementt and support professional
pr and
commercial Linux systems. Red Hat freelyely distributes
tributes its version ofo Linux under
the GNU Public License. Red Hat generates
erates income professional level
ome by providing profess
an
support, consulting, and training services.
system used on several distributions,
software packages.
es. Red Hat originated
orig
butions, which automatically
automatical installs
the RPM
R package
insta and removes
Mandrake
ke
Mandrake Linux is another p popular Linux distribution with many of the same
pop
features focuses on providing up-to-date enhancements and an
atures as Red Hat. It foc
easy-to-use installation
install and
a GUI configuration.
Vi
SuSE
SuS
Originally a German
Orig Ge language-based distribution, SuSE has become very
popular thro
popula throughout Europe and is currently one of the fastest growing
distributions worldwide.
distributio
Debian
Deb
Debian Linux is an entirely noncommercial project, maintained by hundreds of
volunteer programmers.
1
Vidyalankar : T.Y. B.Sc. (IT) Linux
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 differentt packages,
ges
ckage, which
each geared to different markets. These include the eDesktop package, hich is
designed for basic workstation operations, and the eServer package, e, which is
designed for Linux servers.
r
ka
ary Linux
Caldera also offers a line of commercial and proprietary ux packages
packages.
Slackware
net sites,
Slackware is available from numerous Internet es, and yo
you
u can order the CCD
from Walnut Creek Software. The Slackwareware distribution
stribution takes sspecial car
care to
remain as closely Unix compliant as possible.
an ssible.
TurboLinux
TurboLinux provides English,, Chinese, and
nd Japanese versions
versio of Linux. It
includes several of its own
wn packages, such as TurboPkg,
Tur for automatically
updating applications.
this).
th [Working
[W of loader 3 marks and difference 2 marks (4 points)]
GRUB LILO
GRUB
G RUB stands for GR and Unified Stands for Linux Loader
Bootloader.
Boo
GRUB supports an unlimited number LILO supports only up to 16
of boot entries. different boot selections;
GRUB can boot from network. LILO cannot boot from network.
2
Prelim Paper Solution
ar
Q.1 (c) State any 5 linux supported file systems and explain ext3 and
d ext 2. [5]
(A) 5 Linux Supported File System [1 mark]
1. ext3
2. ext2
3. Reiser
4. FAT
5. NTFS
Ext3 [2 marks]
x Ext3 stands for third extended
e file system.
x Starting from Linux Kernel 2.4.15 ext3 was available.
x The main benefit
b of ext3 is that it allows journaling.
x Journaling
urna has a dedicated area in the file system, where all the changes
Vi
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).
x 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.
3
Vidyalankar : T.Y. B.Sc. (IT) Linux
r
ka
There are two types of RAID – hardware RAID and d Software
are RAID.
Hardware RAID – in H. RAID, the disks have their eirr own RAID controller with
w
built in software that handles RAID disk setup.p. The controller is a card iin one
of the system’s expansion slots. Ot it may be builtt onto the system bo
board. The
Th
O/S does not control the RAID level used,sed, it is controlled by the hardware
hardw
an RAID controller.
disks.
ks.
Vi
4
Prelim Paper Solution
r
ka
x
an
RAID level 2 – Error Checking and Correction
Requires minimum 3 disks. ks. RAID 2 adds
adds error checking
check
[1 mark]
and correcting
checksums to RAID-1.
ID-1. ECC is Error correcting
correc code in which each data
cod
signal confirmss to specific
ecific rules of construction
constr so that departures from
this construction
uction inn the received signal
sig can generally be automatically
al
detected and corrected.
orrected.
RAID 2
dy
5
Vidyalankar : T.Y. B.Sc. (IT) Linux
RAID 3
A1 A2 A3 Ap(13)
A4 A5 A6 Ap(46)
B1 B2 B3 Bp(13)
B4 B5 B6 Bp(46)
r
Disk 0 Disk 1 Disk 2 Disk 3
ka
x RAID level 4 – Block-Level Striping with Parity
rity disk
arity [1 mark]
mar
requires minimum 3 disks. It attemptss to add error checking and
recovery to RAID-3 by doing block level riping with the addition
vel striping addit of a
single parity disk. RAIDD4
an A1
B1
C1
A2
B2
C2
A3
B3
C3
Ap
Bp
Cp
Dp
D1 D2
D D3
D
al
Disk 0 Disk 1 Disk 2 Disk 3
x RAID
ID level 5 – Block-Level Striping
Striping with Distributed Parity [1 mark]
S
It requires at least three disks and uses striping to write the data
dy
across
ss the two disks similarly
s to
t RAID 1. But unlike 1, this level uses the
hird disk to hold parity info
third information that can be used to reconstruct the
ata from either, but n
data not both, of the two disks after a single disk
failure.
ilure
RAID 5
Vi
A1 A2 A3 Ap
B1 B2 Bp B3
C1 Cp C2 C3
Dp D1 D2 D3
6
Prelim Paper Solution
r
#chkconfig –levels 0123456 packagename OFF
ka
4. To set run levels for any package
#chkconfig –levels 23456 packagename ON
Q.2 (b) Configure a network for class c and d also set ip for default
defau [5
[5]
gateway and DNS.
(A) an Setting IP for the machine: [3 Mark]
#ifconfig etho 192.168.2.1 netmasksk 255.255.255.0 broadcas 192.168.2.255
255.0 broadcast 192.1
Setting IP for the Default Gateway:
teway: [1 Mark]
#route add default gw 192.168.2.3
168
168.2.3
Setting IP for the DNS: [1 Mark]
#vi /etc/resolv.conf
Set two IP and savee the file
al
Q.2 (c) What is the e process
ess to create grub boot fl floppy? [5]
(A) (a) Boot a Linux with
ith Grub support
suppor and loglo in as root or in superuser mode
(suu followed by the password) [1 mark]
(b) Format
rmat the floppy ini MsDOS (or Ext2) by typing "mkmsdosfs -F32
dy
/mnt/fd0/boot/grub
#mkdir /mnt
(d) Copy all tthe necessary files in /boot/grub directory of the booted Linux
to the mounted fd0
#c cd /boot/grubtar [2 mark]
To remove or erase the content of /mnt/fd0/boot/grub/menu.lst. Grub
(e) T
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.
7
Vidyalankar : T.Y. B.Sc. (IT) Linux
(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 hroug
authentication. [Every
ery point
nt 1 mark]
Encryption and decryption: Since files are traversing in a network, work, there is
r
possibility of an attack, so convert the file in cipher text using ing encryption
ka
and decryption technique.
Hard Mooting and soft mounting: The process ess
ss of requesting a servserver
continuously till client gets the file is called ass hard mounting.
The process of requesting a server periodically called
dically for some attempts is calle
as soft mounting.
anCross Domain Mounting: Two machines ines mounting
untin the
the files of each other
o is
known as Cross Domain Mounting
Root Squash: Squashing the rightsights of root
root user of client
c for tthe exported
file is called as Root Squash.
h.
Per User and Per Host: It is possible to provide security securi w.r.t machine or
user.
PROGRAM
OGRAM DESCRIPTION
DESCR
dy
ntpdate
date Sets the system date and time via NTP
ntpdc
pdc Controls the NTP daemon, ntpd
ntp-keygen
p-keygen Generates
Generate public and private keys for use with NTP
ntpq Querie
Queries the NTP daemon
ntpsim Provides
Pro NTP simulation for development and testing
ntptime
time Displays the time variables maintained by the Linux kernel
Vi
8
Prelim Paper Solution
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
ke /da
sharable with some users for e.g. abc.
r
This makes /data sharable with windows.
ka
Q.3 (c) State and explain any 5 parameters of squid.conf conf
onf [5]
(A) Squid.conf [Any
Any 5 lines
nes explanation 5 marks]
ma
1. Chache effective user user : squid.conf
conf
2. chache effective user group : squid
quid
an 3. httpd_accer_with_proxy yes/No o
4. httpd_accer_IP
5. httpd_accer_porl 50
6. httpd_accer_uses_host_hiodes
t_hi
t_hiodes yes/No
7. httpd_access : allow all/cliny
cliny a
all
Q.3 (d)
d) Write a short note on squid.
squ [5]
(A)) Providing Process Caching S
Server:
(SQUID) [Diagram 2 marks and explanation 3 marks]
SQUID
QUID is by default
d a process server but can also be used as a caching
souses. For eg.
Vi
C1 S C4
Q
U
C2 C5
I
D
C3 C6
9
Vidyalankar : T.Y. B.Sc. (IT) Linux
r
Zone “www.abc.com” IN
ka
{
Type “Master”;
File “abc.zone”;
}
# rpm I bind
b
installed.
Output : bind verno inst
installe
2. Once DNS is installed,
installed DNS configuration file “named.conf” will be
created, which
whic SHOULD
SHOU having following definition.
Zone “ . “ IIN
{
Vi
Type “Hint”;
“Hint
“named.ca” ;
File “na
} [1 mark]
Make sure that, DNS cache has an entry to map local host to loopback.
3. Ma
Make sure that /etc/nsswith.conf contain the following line to redirect
4. M
the client.
hosts: file dns
5. Make sure that / etc/hosts has the word “bind”
10
Prelim Paper Solution
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 ect a local
cal m/
m/s
to a remote m/c through command terminal. The traffic between n 2 m/c is
incrupted and a virtual tunnel is created. [1 marks]
r
2. scp (Securce Copy) : It is a replacement of scp to copy a file le from a local
ka
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 te m/c B/abc directory
# scp fl.fxt B:/abc
e.g. 2: Copy a file f2 from remote m/c B/abc bc directory into local m/c /pq
an r directory.
# scp B/abc/f2.txt/pqr [2 marks]
3. sttp (secures file transfer protocol) ol) : It is a replac
replacement of ffile t transfer
a file between client and a serves.
Syntax : sttp src destn stn
Eg.1 : copy contentt of file it from local m/c remote
re m/c B/abc directory.
m
Eg. 2: Copy contents
ntents of file from remote m/c B/abc B directory into local
m/c/pq directory.
ctory.
al
# step B/abc?f2.txt/[pqr/f2.txt
/abc?f2.txt/[pqr/f2.txt
2.txt/[pqr/f2.txt [2 marks]
/etc/hosts
It iss DNS Cache
Cach
Vi
/etc/resolv.conf
/e
It contains
c IP
I of DNS servers
/etc/named.conf
/etc/na
It is general DNS Server Configuration File
/var/named/named.local
It is used for mapping Loopback IP to Local Host
11
Vidyalankar : T.Y. B.Sc. (IT) Linux
/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.
r
Q.5 Attempt any TWO: [10]
Q.5 (a) How to configure user level ftp access? [5]
ka
(A) Answer not given [3 marks]
The /etc/vsftpd/ftpusers file is the simplest to o understand. It contain
contains a
list of user or account names, one per line,, that are re not allowed to log in
using FTP. This file is used to increase security. ty. For example, if a cracke
cracker
somehow obtains the root password but (stupidly) upidly) tries to llog in as root
an using FTP, the login attempt will fail.il. Notice
e that the filename
filenam is annoyingly
an
counterintuitive: user accounts listed
sted inn this file are not permitted
permitte
p to log in
to the system via FTP. In general,
neral, /etc/vsftpd/ftpusers
/etc/vsftpd/ftpus used to prevent
is us
privileged user accounts, such
uch as root,
root from using FTPF to obtain access to
the system. The followingng code
de shows the default /etc/vsftpd/ftpusers
/
/etc/vs file:
root
bin
al
daemon
adm
Ip
sync
shutdown
hutdown
own
dy
halt
maill
news
uucp
operator
perato
gamess
Vi
nobody
So, to preve
prevent a user named bubba from using FTP to log in, or, rather, to
prevent b
pre 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
/etc/vs
suff
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.
12
Prelim Paper Solution
r
users listed in /etc/vsftpd.user_list. If userlist_deny is set too YES (that is,
ka
pd/user_list
userlist_deny=YES), no user listed in /etc/vsftpd/user_list r_list will not be
permitted to login via FTP. Such users will not ott even be prompted for a
password. [2 ma
marks]
#ftp 2.3.4.5
Username:
name: abc
Password:***
assword
ftp> put /data/f1
/data/f1.txt
>get f2.txt
ftp>get f2.tx
ftp>quit
Vi
13
Vidyalankar : T.Y. B.Sc. (IT) Linux
r
etwork.
(MTA), which transmits the message across the network.
ka
ii) Mail Transfer Agent (MTA)
ed as MTA, is the program that
A mail transfer agent, usually abbreviated
sends the message across the network..
The MTA reads the information in n the To: section of the email
e message
me
an and determines the IP addresss of the recipient's mail server. T Then the
MTA tries to open a connection n to the recipient's server through a
ection
TCP/IP port, typically portort 25. DNS,
DN the Domain Name S System, plays a
role in mail deliver, too.
oo. MTAs query a domain's
domain' DNS mail m exchanger, or
MX, record, to determine
ermine the host th responsible for receiving mail
that is rresponsib
for that domain.. If thehe MTA on the the sending
sen machine
m can establish a
connection to transmits the message using the
o the destination MTA, it transm
al
Simple Message
essage Transfer
ansfer Protocol (S
(SMTP).
In some
me cases, the message mimight not be immediately deliverable, so the
sending
nding MTA will store in a local
lo queue
que and attempt retransmission after
a set
et amount of time.
time In other cases, the receiving MTA might refuse
dy
delivery,
livery, causing the message
m to bounce and be returned to the sender's
MUA
MUA.
Introdu
Introducing SMTP
The SMTP protocol can transfer only ASCCII text. It can’t handle fonts,
co
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
14
Prelim Paper Solution
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
ocol version
sion
3, known as POP3, and Internet Message Access Protocol version on 4, known
own as
a
IMAP4.
r
Without POP3 (or IMAP), and MUA and MTA can't communicate.
ommunicate.
ate. That is, if
you want to read your mail, need POP3 (or IMAP) to o retrieve
ieve messages that
ka
arrive at your MTA while you're offline. POP3 uses the MTA's storage to
hold messages until they are requested. Whenhen users
sers want to check their
t
email, they connect to the POP3 server and retrieve
etrieve messages th were
that wer
stored by the server. After retrieval, the messages
ssages are stored
store locally (that
(t
anis, locally to the MUA) and use the MUA on your PC to read them at a your
leisure.
<VirtualHost
VirtualHost
Host *:*>
*:
ServerName
erName www.b.com
www
DocumentRoot /var/www/b/html
/var/www/b/
DocumentIndex home.html
home.htm
h
</VirtualHost>
VirtualHost>
<VirtualHost
alHos *:*>
Vi
ServerName
ServerNa www.c.com
www
DocumentRoot
Do
DocumentRoo /var/www/c/html
DocumentIndex
Doc
DocumentI home.html
</VirtualHost>
</Virtua [2½ marks]
15
Vidyalankar : T.Y. B.Sc. (IT) Linux
r
To update the package use –U
ka
#rpm –U packagename
To remove the package use –e
#rpm –e packagename
Q.6 (c) Why the name apache for Web server? erver? State the difference
dif [5]
an between apache 1.0 and apache 2.0. .0.
(A) Apace 1.0 [2½
[2 marks]
1. Apache 1.0 makes the use e of monatomic process model tto handle the
monatomic proces
traffic.
2. As the traffic increases,
eases,s, master web server mail creates
cr child server
process (CSP). Thisis is calledd as sparing the sserver.
3. When the child ld server
rver process gets overloaded
overload
ov due to many traffic
master server tes are more child server process.
ver creates
al
(max 2sc CSP)
4. When the trafficfic is reduced.
5. Master
ster server will kill
kill child se
k server pprocess.
Forr eq.
dy
MASTER
MASTER WEB SERVER
Vi
Csp1
Cs Csp2 Csp2 SC
Disadvantage:
D Heavy weight technique spawning and Rilling requires huge
rescores
16
Prelim Paper Solution
Master with
r
ka
CSP1 CSP2 CSP256
an CT CTM CT
Options:
ns:
x C:: comment
x D: home dir
x E: Account expiration
ex
x F: days after
afte which
whic password expires
x g: prim
primary group
grou
Vi
x G: Supplemental
Suppleme group
x P: password
passwo
x S: Shells
She
x U:uid
U:u
x R: R acc but no dir is assigned
E.g.
E #useradd abc
17
Vidyalankar : T.Y. B.Sc. (IT) Linux
r
The swap partition should be at least 32MB or two times
mes the system’s RAM,
ka
whichever larger.
Use
se softt mounting
5. Hard
rd
Use hard mounting
#rpm –i samba
sa
#vi
#v /etc/samba/smb.conf
/etc/samba
#service
#se samba
sa start
#smbmount
#
#smbmou //terry/c /mnt/win
Adding
Addin samba user [2 marks]
#useradd
#u username
#passwd username
#smbpasswd –a username
#smbpasswd username
18
Prelim Paper Solution
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
chine
that contains ip of frequently visited URL.
r
ka
Q.7 (e) How to disable unknown user upload? What is warez arez server?
rver? [5]
(A) There are following two methods that can disable e unknown user:
u
Method 1: [2½ ma
marks]
1. Find all the directories and files uploaded
ded by user ftp and remove them
#find / user(ftp)|xargs rm – rf
an 2. Remove user ftp
#userdel ftp
Method 2: [2½ marks]
In a file user_list put username vsftpd.conf set USER_DENY=yes
name ftp and in vsftpd.con U
also set anonymous_enable=no
ble=no
no
The server that becomes mes source
ce to circulate
circulate and distribute illegal document
an distr
like virus is called as WAREZ
REZ server
al
Q.7 (f) What is content
ntent negotiation? [5]
(A) Content negotiation n refers to the technique
techniqu Web clients and servers use to
select how to present a resource,
resourc such as a document that is available in
several
eral different formats.
forma For example,
ex suppose that a Web page is
dy
19