B.SC .IT Important Dates
B.SC .IT Important Dates
B.SC .IT Important Dates
V
Linux Administration
Time : 2½ Hrs.] Prelim Question Paper Solution [Marks : 75
1
Vidyalankar : T.Y. B.Sc. (IT) Linux
Restoring files also has an equal importance. He makes it certain that he can restores
the files if the need arises by the your restore process at least once during a
noncritical time.
Monitoring and Tuning Performance
System tuning is an ongoing process aided by a variety of diagnostic and monitoring
tools.
Proper monitoring allows you to detect a misbehaving application that consumes more
resources than it should or fails to exit completely upon closing.
To squeeze the best performance from your equipment, monitor your system carefully.
Configuring a Secure System
If there is a common threat in Linux system administration, it is the security of the
computer and data integrity.
The system administrator’s important task, is to make certain that no data on the
machine or network are likely to become corrupted whether by power failure, by
misconfiguration or user error or by malicious or inadvertent intrusion from elsewhere.
Using Tools to Monitor Security
Security is monitored by the system admin.
He makes sure that whenever a security advisory is issued, he downloads and installs the
repaired package.
Preventing the use of your machine for malicious purposes and guarding against intrusion
are, in the end, is his responsibility alone.
The lines following the lines beginning with the hash character and before the line beginning
with title are the menu interface commands that GRUB uses to display the menu. These lines
have the following meanings:
default = 0 — This command tells GRUB to boot the first listing beginning with title. If
you had two entries beginning with title, you could set this number to 1 to boot the
second entry.
2
Prelim Question Paper Solution
timeout = 5 — This command tells GRUB to boot the default entry after five seconds.
To change the time, increase or decrease the number as desired.
splashimage = (hd0,0)/grub/splash.xpm.gz — This command tells GRUB where to look for
the splash image it displays for the menu. You can create your own images if you desire.
Just be sure to follow the same format as shown here.
hiddenmenu — This command tells GRUB not to display the menu and to boot the default
after the timeout expires. You can still see the menu by pressing any key.
title — This command tells GRUB to list a boot name on the menu using the name
following the title command. In this example the title is Fedora Core (2.6.9-1.667),
which is the name of the operating system and the kernel version number.
The lines following the title are explained here:
root (hd0,0) — This line tells GRUB to boot the system from the first partition of the
first hard drive.
kernel... — This line tells GRUB the location of the kernel, as well as passes kernel
parameters to the kernel. All locations are relative to the boot partition, so the listing
here indicates that the kernel is in the root of the boot partition. If you want to pass
kernel parameters to the kernel before it loads, this is the line to add them to. There
are already two options shown here. The rhgb on the kernel line tells the system to use
a graphical boot. Finally, the quiet option tells the system not to display detailed
information about system booting.
initrd... — This line tells GRUB the location of the initial ramdisk image that is used to
load special drivers for the system. All locations are relative to the boot partition, so the
listing here indicates that the initial ramdisk image is in the root of the boot partition.
Q.1(c) State the advantages of using hierarchical method for system organization. [5]
(A) The file system is organized in a flat, hierarchical file system. Linux’s method of mounting
its file systems in a flat, logical, hierarchical method has advantages over the file system
mounting method used by window.
Linux references everything relative to the root file system point /, whereas Windows
has a different root mount point for every drive.
If one has a /partition that fills up in Linux, one can create another file system called
/usr/local and move the data from /usr/local in the original file system to the new file
system definition.
This practice frees up space on the /partition, and is an easy way to bring the system
back to a fully functional state.
This trick wouldn’t work on a Windows machine, because Windows maps its file locations
to static device disk definitions.
Q.1(d) What is RAID? Write and explain the different levels of RAID. [5]
(A) RAID stands for Redundant array of inexpensive / Independent Disks
RAID contains a group or set or Arrays.
A combination of drivers make a group of disks to form a RAID array or RAID set.
It can be a minimum of 2 numbers of disk connected to a raid controller & make a logical
volume or more drives can be in a group.
There are 2 types of RAID
(1) Software Raid
(2) Hardware Raid
3
Vidyalankar : T.Y. B.Sc. (IT) Linux
Raid Levels
(i) Raid 1
Also known as disk mirroring
Redundant Raid disk mode.
A mirror of the first disk is kept on other disks
If all disks crash but one all data can still be recovered.
To work properly, RAID 1 needs two or more disks, & zero or spare disks.
(ii) RAID 5
This levels combines the ability to use a large number of disks while still maintaining
some redundancy.
It uses there or more disks & space disks are optional.
The final RAID 5 array contains combined file size of all disks except one.
It can survive one disk loss, but if more than one disk fails, all data is lost.
Raid in Hardware :
The principles of software RAID levels also apply to hardware RAID setups.
The main difference is that in hardware RAID the disks have their own RAID
controller with built-in software that handles RAID disk setup & I/O.
In /etc/sysconfig/network -
HOSTNAME = “JERRY”
/etc/hosts -
4
Prelim Question Paper Solution
Change the first line in the file by adding the host name
127.0.0.1 JERRY localhost:localdomain
And reboot the machine.
5
Vidyalankar : T.Y. B.Sc. (IT) Linux
#nameservers
option routers 1.2.3.4, 1.2.3.5;
option routers 192.168.1.2;
# gateway/routers
option subnet mask 255.155.255.0;
# netmask (subnet mask of network)
option broadcast address 192.168.1.255;
# broadcast addr of network
subnet 192.168.1.0 netmask 255.255.255.0;
# subnet no gets assigned in range 192.168.1.3 192.168.1.126;
# define which addresses can be used.
Q.2(c) What are the advantages and disadvantages of NFS? Explain. [5]
(A) Advantages :
1) Biggest advantage NFS provides is centeralized control, maintenance and administration.
Backup file system should be stored on a single server than to backup directories
scattered.
2) NFS makes it trivial to provide access to shared disk space, or limit access to sensitive
data.
3) NFS can also conserve disk space and prevent duplication of resources.
4) NFS when combined with NFS, users can log in any system, even remotely and still have
access to their home directories and see a uniform view of shared data.
Disadvantages :
1) NFS is sensitive to network congestion, heavy network traffic shows down NFS
performance similarly, heavy disk activity on the NFS server adversely affects NFS’s
performance.
2) If an exported file system is not available when a client attempts to mount it, the client
system can hang.
3) Exported file system represents a single point of failure; if the disk or system
exporting vital data or application becomes unavailable for any reason. Such as disk
crash or server failure, no one can access that resource.
4) NFS suffers from potential security problems because its design assumes a trusted
network, not a hostile environment in which systems are constantly being probed and
attack.
5) The primary weakness of most NFS implementations based on protocol versions 1, 2 and
3, is that they are based on standard (unencrypted) RPC (Remote Procedure Call).
6
Prelim Question Paper Solution
[homes]
This section is used to enable the server to give users quick access to their Home
directories.
1) comment = Home Directories – A comment line.
2) browsable = yes - means that the directory will appear in the Windows file browser.
3) writable = yes – means that the user can write to their directories.
4) create mode = 0664 – sets the default permissions for files created in the
directory.
5) directory mode = 0775 – sets the default permissions for created directories.
6) max connections = 1 – the maximum number of the simultaneous connections allowed.
Setting this number to 1 prevents a user from logging in to the server from more
than one location.
[printers]
This section sets the options for printing.
1) path = /var/spool/samba – the location of the printer spool directory
2) printable = yes - enables clients to send print jobs to the specified directory. This option
must be checked otherwise printing does not work.
3) browsable = yes - means that the printer appears in the browse list.
Q.3(b) What are the tasks to be performed to setup Timeserver? Explain the steps to [5]
configure NTP Server and NTP client.
(A) Selecting a time server –
There are three categories of time servers
1) Hardware 2) Software 3) Both
7
Vidyalankar : T.Y. B.Sc. (IT) Linux
File :
server 0 rhel.pool.ntp.org
server 1 rhel.pool.ntp.org
server 2 rhel.pool.ntp.org
server 127.127.1.0
fudge 127.127.1.0.stratum 10
To deny all machines from accessing the NTP server, add the following line to /etc/ntp.conf:
restrict default ignore
Add the following line to allow unrestricted access from the localhost restrict 127.0.0.1
The following line allows a subnet to receive time service and query server statistics:
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap nopeer
8
Prelim Question Paper Solution
[test]
browsable = yes
read only = yes
path = /home/newusr/TYIT
9
Vidyalankar : T.Y. B.Sc. (IT) Linux
# sshuser1@mylab.textra.edu
Log on to mylab.testra.edu as user user1.
scp
This command securely copies files over the network.
Example : Putting of a single file –
# scp myfile1.dat mylab.textra.edu:data1.txt
sftp
Is used to transfer files to and from a remote computer.
It is interactive and secure.
Once connected to the remote computer, giving a password if necessary, you can type the
following interactive commands to change directories and to transfer files between your
local computer and the remote computer.
Enter password :
sftp> use the above commands.
#sftp user1@mylab.textra.edu
Connect to mylab.testra.edu using username user1.
Q.4(b) What are the types of domain servers? Explain in brief. [5]
(A) The three types of local domain name servers are :
1) Master or Primary 2) Slave or Secondary 3) Caching
Master
The master contains all the information about the domain and supplies this information when
requested. A master server is listed as an authoritative server when it contains the
information you are seeking and it can provide that information.
10
Prelim Question Paper Solution
Slave
The slave is intended as a backup in case the master server goes down or is not available.
This server contains the same information as the master and provides it when requested if
the master server cannot be contacted.
Caching
A caching server does not provide information to outside sources; it is used to provide
domain information to other servers and workstations on the local network. The caching
server remembers the domains that have been accessed. Use of a caching server speeds up
searches since the domain information is already stored in memory, and the server knows
exactly where to go rather than having to send out a request for domain information.
Q.4(c) Explain the two programs used to check the DNS configuration. [5]
(A) The command dig is a tool for querying DNS nameservers for information about host
addresses, mail exchangers, nameservers and related information.
The quick way to get the answer only is : dig mtiexamplke.com +short
host – is a simple utility for performing DNS lookup. It is normally used to convert
names to IP addresses and vice versa.
host [name] [server]
name is a domain name that is to be looked up. It can also be an ip address. In which
case host will by default perform a reverse lookup for the address.
Server is an optional argument which is either the name or IP address of the name
server that host should query instead of the server or servers listed in /etc/resolv.conf
Q.4(d) What are zone statement? Explain the different values for the zone statement. [5]
(A) The listings in /etc/ named.conf are zone statements.
The zone statements refers to the file that are called zone files.
Each zone statement begins with the word zone followed by the domain name and the
data class.
The four data class are in, hs, hesiod and chaos.
If no type specified the default is in for internet.
11
Vidyalankar : T.Y. B.Sc. (IT) Linux
12
Prelim Question Paper Solution
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 and one can his MUA on his PC to read
them at his leisure.
IMAP4
Full form – Internet Massage Access Protocol version 4.
It provides much more sophisticated email-handling functionality than POP3 does.
IMAP4 enables one to store email on a networked mail server.
IMAP4 enables mail to reside permanently on a remote server, from which one can
access his mail.
Mail retrieval can be done from any device, office PC, PDA, cell phone etc.
The usual mail delivery process involves three components, a mail user agent (MUA), a mail
transfer agent (MTA) and a mail delivery agent (MDA).
Q.5(c) Write the purpose of the following parameters of vsftpd.conf file [5]
(i) anonymous_enable (ii) write _enable (iii) chown_username
(iv) ftpd_banner (v) dirmessage_enable
(A) anonymous_enable
If yes, allows anonymous FTP access.
write_enable
If YES, enables all variations of the FTP commands that allows
chown_username
specifies the name of user to set ownership of uploaded files.
ftpd_banner
allows you to display a site_specific banner message when users connect to the server.
dirmessage_enable
If set to YES, first time user enters a new directory, vsftpd displays contents of a file
named message.
Another approach is to add ftp to /etc/vsftpd/user_list and set user list deny = YES and
anonymous enable = NO in /etc/vsftpd/vsftpd.conf. Do not just comment out
anonymous_enable_YES
13
Vidyalankar : T.Y. B.Sc. (IT) Linux
14
Prelim Question Paper Solution
Example :
kiran : x : 502 : 502 : Kiran Sathe : /home/kiran : /bin/bash
/etc/shadow file
In addition to storing the encrypted password, /etc/shadow stores password expiration
information.
The fields in /etc/shadow
1) User name : It is your login name
2) Password : It your encrypted password. The password should be minimum 6-8 characters
long including special characters/digits
3) Last password change (lastchanged) : Days since Jan 1, 1970 that password was last changed
4) Minimum : The minimum number of days required between password changes i.e. the
number of days left before the user is allowed to change his/her password
5) Maximum : The maximum number of days the password is valid (after that user is
forced to change his/her password)
6) Warn : The number of days before password is to expire that user is warned that
his/her password must be changed
7) Inactive : The number of days after password expires that account is disabled
8) Expire : days since Jan 1, 1970 that account is disabled i.e. an absolute date specifying
when the login may no longer be used
Example :
vivek:$1$fnfffc$pGteyHdicpGOffXX4ow#5:13064:0:99999:7:::
1 2 3 4 5 6
Q.6(d) Which command is used to change the expiration policy for a user's password? [5]
Explain with example.
(A) The change command changes the expiration policy for a user’s password.
Change [ ] [m mindays] [M maxdays] [d lastday]
[ I inactive] [E expire date] [w warndays] username
eg. Change logon m 60 M75 W5
will set the minimum days for the password as 60
75 days is the period (maximum) till when it can used.
A warning will be issued 5 days prior to expiry.
15
Vidyalankar : T.Y. B.Sc. (IT) Linux
Q.7(b) How are NFSv4 client and server configured? Explain [5]
(A) Configuring an NFSv4 client :
NFSV4 specific mount options includes :
1) clientaddr = n causes a clinet on a multi homed system to used the IP address
specified by n to communicate with an NFSV4 server.
2) proto-type Tells the client to use the network protocol specified by type which can
be tcp or udp.
3) rsize = n sets the read buffer size to n bytes maximum 32678.
4) sec = mode set the security model to mode which can be sys, krb5i or krb5p.
5) wsize = n set the write buffer size to n bytes. Maximum values is 32678.
With the exports configured, start (or restart) the daemons (the portmapper) using
initialization scripts
# service nfs start
# service nfswork start
Another approach is to add ftp to /etc/vsftpd/user_list and set user list deny = YES and
anonymous enable = NO in /etc/vsftpd/vsftpd.conf. Do not just comment out
anonymous_enable_YES
Q.7(d) Compare inted and xinted services. Explain standalone services of xinetd. [5]
(A) Xinetd services are started from xinetd. Each of these services should ideally have its own
file in the /etc/xinetd.d directory so should look in that directory to find the appropriate
file and open the file to check whether it is enables or disabled.
Inetd and xinetd both help to restart and reload services but to restart service in inetd we
use---
#service dhcpd start
but in xinetd we use----
#service xinetd start
Note: in inetd we give name of that service it means if you want to start dhcpd then you will
have to give name service
16
Prelim Question Paper Solution
dhcpd start
but in xinetd service we don't type that service telnet
start to start telnet we type service xinetd start
Standalone services of xinted
from apache - Web server
sshd - SSH server
sendmail - mail server
qmail - Mail server
postfix - Mail server
thttpd - Semilightweight web server
boa - Lightweight web server
named - DNS server
xfs - X font server
xdm - X display manager
portmap - maps RPC services to ports
rpc.quotad - serves quota information
knfsd - userspace portion of the NFS daemon
rpc.mountd - NFS mount server
squid - Web proxy server
mysql - database server
oracle - database server
Q.7(e) Explain the following : Mail User Agent, Mail Delivery Agent and Mail Transfer Agent. [5]
(A) Mail User Agent
Provides an interface for reading and writing email messages
MUA sends a composed email message to mail
Transfer Agent (MTA), which transmits the message across the network.
Q.7(f) Write an SSI page that will display the long listing of the directory/home/tyit. [5]
(A) <html>
<head>
<title> SSI test page </title>
<link rel = "stylesheet" type="text/css" href="rhlnsa3.css">
</head>
<body>
<h1> SSI Test Page </h1>
<div id="content">
<pre>
<!-- # execcmd = "/s1/home/tyit ">
</pre>
</div> <!-- content >
</body>
</html>
17