0% found this document useful (0 votes)
51 views

A) Linux Is The Choice of Operating System For Network Administrators. Explain. Answer

This document contains Puran Thapa Magar's exam submission for the subject of Linux. It includes answers to two questions about why Linux is a good choice for network administrators and explanations of users, the Linux kernel, BIOS, the Linux boot process, and methods for checking system space in Linux. Key points covered include that Linux provides security, multi-user capability, and performance making it suitable for network administrators, an overview of the Linux kernel's roles, and a description of the typical 5-stage Linux boot process from BIOS to initiating runlevel programs.

Uploaded by

narup thapa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

A) Linux Is The Choice of Operating System For Network Administrators. Explain. Answer

This document contains Puran Thapa Magar's exam submission for the subject of Linux. It includes answers to two questions about why Linux is a good choice for network administrators and explanations of users, the Linux kernel, BIOS, the Linux boot process, and methods for checking system space in Linux. Key points covered include that Linux provides security, multi-user capability, and performance making it suitable for network administrators, an overview of the Linux kernel's roles, and a description of the typical 5-stage Linux boot process from BIOS to initiating runlevel programs.

Uploaded by

narup thapa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Name: Puran Thapa Magar

Subject: Linux
Exam Roll no: 17530214
Submitted to: Rajiv Sir

1. a) Linux is the choice of operating system for network


administrators. Explain.
Answer: Simply, Linux is an operating system just like Microsoft
Windows, Apple Mac OS etc. As an operating system, Linux is software that
sits underneath all of the other software on a computer, receiving requests
from those programs and relaying these requests to the computer's hardware.
A network administrator is an IT expert who manages an organization's
network. They are responsible for the day-to-day operation of these
networks. They organize, install, and support an organization's computer
systems, including local area networks (LANs), wide area networks
(WANs), network segments, intranets, and other data communication
systems. some important roles are:

 Configure network hardware such as servers, routers, and switches.


 Upgrade, repair, and maintain computer networks.
 Troubleshoot various network issues.
 Assist network architects with the design of network models whenever
needed.
 Deploy and update company-wide software.
 Manage servers and operating systems.
 Implement security measures.
 Manage physical and cloud network storage.

As mentioned above, the duties and responsibilities of Network


administrator are highly critical and important for any organization. He/She
have to look for operating, managing and troubleshoot the different problems
that may come in network. Security and data backup are the most vital aspect
of any organization that contains lots of information.
In terms of security management and other aspect Linux is the best choice
for any network administrator. Because linux provides features as:
 Security: It provides security in three ways namely authenticating (by
assigning password and login ID), authorization (by assigning
permission to read, write and execute) and encryption (converts file
into an unreadable format).
 Multi-user capability: This is a capability of Linux OS where, the
same computer resources – hard disk, memory, etc. are accessible to
multiple users.
 Performance: Linux provides high performance on workstations and
on network. It can handle usually large numbers of users
simultaneously and can make run smoothly.
Because of these reasons as mentioned above, Linux is best choice for a
Network administrator.

1. b) What is a user? Explain Linux Kernel.


Answer: A user is a person who uses or operates something. Linux is
a multi-user operating system, which is uniquely identified by a numerical
number called the UID (unique identification number). There are 2 types of
user:
 Root or super user: has all rights to all files, system services, and
software.
 Normal user: has limited access to files (general purpose).
The Linux kernel is the main component of a Linux operating system
(OS) and is the core interface between a computer’s hardware and its
processes. It's also used in embedded systems such as routers, as well as in
all Android-based systems, including many popular tablets and smart-
phones.
Figure : Basic structure of kernel

The Linux Kernel has mainly 4 jobs as mentioned below:


i) Memory management: Keep track of how much memory is used to
store what, and where.
ii) Process management: Determine which processes can use the central
processing unit (CPU), when, and for how long.
iii) Device drivers: Act as mediator/interpreter between the hardware and
processes.
iv) System calls and security: Receive requests for service from the
processes.

There are 3 types of Linux Kernel. They are:


i) Micro kernel:
A microkernel is a minimalistic kernel designed to be as small as
possible. It contains only the basic code needed to communicate
with hardware and load an operating system. It takes the approach
of only managing what it has to: CPU, memory, and IPC.
Pros:
 Portability.
 Small install footprint.
 Small memory footprint.
 Security

ii) Monolithic Kernel:


Monolithic kernels are the opposite of microkernels because they
encompass not only the CPU, memory, and IPC, but they also
include things like device drivers, file system management, and
system server calls.
Pros:
 More direct access to hardware for programs.
 Easier for processes to communicate between each other.
 If your device is supported, it should work with no additional
installations.
 Processes react faster because there isn’t a queue for
processor time

iii) Hybrid Kernel:


Hybrid kernels have the ability to pick and choose what they want
to run in user mode and what they want to run in supervisor mode.
Often times things like device drivers and filesystem I/O will be
run in user mode while IPC and server calls will be kept in the
supervisor mode.
Pros:
 Developer can pick and choose what runs in user mode and
what runs in supervisor mode.
 Smaller install footprint than monolithic kernel.
 More flexible than other models

2. a) What is BIOS? Explain the boot process in Linux.


Answer: The BIOS (Basic Input Output System) is a computer
program embedded on a chip on a computer's motherboard that recognizes
and controls various devices that make up the computer. It manages data
flow between the computer's operating system and attached devices such as
the hard disk, video adapter, keyboard, mouse and printer.
A Linux boot process is the initialization of the Linux open source
operating system on a computer. Also known as the Linux startup process, a
Linux boot process covers a number of steps from the initial bootstrap to the
launch of the initial user-space application.
Figure: Boot Process in Linux system

Stage 1: BIOS
 BIOS stands for Basic Input/Output System. In simple terms, the
BIOS loads and executes the Master Boot Record (MBR) boot
loader.
 When you first turn on your computer, the BIOS first performs
some integrity checks of the HDD or SSD.
 Then, the BIOS searches for, loads, and executes the boot loader
program, which can be found in the Master Boot Record (MBR).
The MBR is sometimes on a USB stick or CD-ROM such as with a
live installation of Linux.
 Once the boot loader program is detected, it's then loaded into
memory and the BIOS gives control of the system to it.
Stage 2: MBR
 MBR stands for Master Boot Record, and is responsible for loading
and executing the GRUB boot loader.
 The MBR is located in the 1st sector of the bootable disk, which is
typically /dev/hda, or /dev/sda, depending on your hardware. The
MBR also contains information about GRUB, or LILO in very old
systems.
Stage 3: GRUB

 Sometimes called GNU GRUB, which is short for GNU Grand


Unified Bootloader, is the typical boot loader for most modern
Linux systems.
 The GRUB splash screen is often the first thing you see when you
boot your computer. It has a simple menu where you can select
some options. If you have multiple kernel images installed, you can
use your keyboard to select the one you want your system to boot
with. By default, the latest kernel image is selected.
 The splash screen will wait a few seconds for you to select and
option. If you don't, it will load the default kernel image.
 In many systems you can find the GRUB configuration file at
/boot/grub/grub.conf or /etc/grub.conf.

Stage 4: Kernel

 The kernel is often referred to as the core of any operating system,


Linux included. It has complete control over everything in your
system.
 In this stage of the boot process, the kernel that was selected by
GRUB first mounts the root file system that's specified in the
grub.conf file. Then it executes the /sbin/init program, which is
always the first program to be executed. You can confirm this with
its process id (PID), which should always be 1.
 The kernel then establishes a temporary root file system using
Initial RAM Disk (initrd) until the real file system is mounted.

Stage 5: Init
 Init identifies the default init level from /etc/inittab and uses that to
load all appropriate program.
 Following are the available run levels
 0 – halt
 1 – Single user mode
 2 – Multiuser, without NFS
 3 – Full multiuser mode
 4 – unused
 5 – X11
 6 – reboot

Stage 6: Runlevel programs


 These are known as runlevel programs, and are executed from
different directories depending on your run level.

2. b) What is a root user? Explain the methods to check system space in


Linux Environment.
Answer: The root user also known as the superuser or administrator,
is a special user account in Linux used for system administration. It is the
most privileged user on the Linux system and it has access to all commands
and files.
The root user can do many things an ordinary user cannot, such as
installing new software, changing the ownership of files, and managing other
user accounts.
In Linux Environment we can check the system space by 2 commands.
They are as:
i) df command:
df, which stands for Disk Filesystem, is used to check disk
space. It will display available and used storage of file
systems on your machine. The most popular options are:

 df-h: it will display the result in a human-readable format.


 df-m: this command line is used to display information of file
system usage in MB.
 df-k: to display file system usage in KB.
 df-T: this option will show the file system type (a new column
will appear).
 df-ht /home: it allows you to view information about a specific
file system in a readable format (in this case /home file system).
 df-help: it lists down other useful options that you can use,
complete with their descriptions.
ii) du command:
du command, short for Disk Usage. It will show you details
about the disk usage of files and directories on a Linux computer or
server.
With the du command, you need to specify which folder or
file you want to check. The syntax is as follow:
du <options> <location of directory or file>

The most popular options are as:

 du /home/user/Desktop: this command line allows users to see


into the disk usage of their Desktop folders and files
(subdirectories are included as well).
 du -h /home/user/Desktop: just like with df, the option -h
displays information in a human-readable format.
 du -sh /home/user/Desktop: the -s option will give us the total
size of a specified folder (Desktop in this case).
 du -m /home/user/Desktop: the -m option provides us with
folder and file sizes in Megabytes (we can use -k to see the
information in Kilobytes).
 du –h -time /home/user/Desktop: this informs the last
modification date of the displayed folders and files.
 df –help: it displays a list of available options and what they
can be used for.

3. a) Explain the following commands and their uses:


Answer:
i) groupadd:
The groupadd command creates a new group account using the
values specified on the command line and the default values from
the system. The new group will be entered into the system files as
needed.
Syntax: groupadd [OPTIONS] GROUP_NAME
To create new group with specific groupid
# groupadd -g 111 newgroup
ii) usermod:
usermod command is used to modify or change any attributes of a
already created user account via command line.
Syntax: # usermod [options] USERNAME
Example: To set expiry date of user acoount
Before set the expiry date on the user check the current status of
expiry date using the “chage” command.
#chage–1 Acer
It will shows the account expiry date of Acer user for instance the
expiry date of account is 25 jan 2020 then you can change it by
25dec 2020 via using the – e option with usermod command.
# usermod – e 2020-12-25 Acer

iii) groupmod:
groupmod command in Linux is used to modify or change the
existing group on Linux system. It can be handled by superuser or
root user.
Syntax: groupmod [option] GROUP

Example: To change groupid of group:

# groupmod -g 777 oldgroup

Output:

# grep oldgroup /etc/group

oldgroup:x:777:

iv) ls:
ls command is a basic command in Linux used to List files and
directories. ls command comes with so many arguments and
features like you can sort files and directories by Date, by Size,
able to check hidden files and directories, permissions, inode
information and so on.
Syntax: ls
Example: ls
documents pictures downloads public data Videos desktop
cct acer

3. b) Write the syntax for file permissions for the file system for given
filename "new.sh" for following conditions:
(1) write and execute by owner (2) read by group (3) execute by all
(4)read by owner, execute by group, read by others.

Answer:
i) write and execute by owner:
chmod 300 new.sh

ii) read by group:


chmod 040 new.sh

iii) execute by all:


chmod 111 new.sh

iv) read by owner, execute by group, read by others:


chmod 414 new.sh

4. a) Explain rsync for system backup and restore.


Answer: Rsync (Remote Sync) is a popular and powerful tool used to
copy and synchronize files and directories between remote or local
Linux/Unix systems. With the help of rsync, we can easily copy/synchronize
data between local and remote directories, across different drives and
networks.
Rsync is a backup destination for File Protection backups, which allows
you to back up data across the internet to an rsync host server. Adding rsync
backups to your backup strategy is an excellent way of insuring yourself
against data loss. Critical files can be copied to a secure, off site location,
away from your office, and you can also use built-in rsync encryption to
protect the data on the rsync host.
Syntax:
Local Sync: # rsync {options} {Source} {Destination}

Remote Sync pull: # rsync {options} <User_Name>@<Remote-


Host>:<Source-File-Dir> <Destination>

Remote Sync Push: # rsync <Options> <Source-Files-Dir>


<User_Name>@<Remote-Host>:<Destination>

Advantages of Rsync command:

 It efficiently copies and sync files to or from a remote system.


 Supports copying links, devices, owners, groups and permissions.
 It’s faster than scp (Secure Copy) because rsync uses remote-update
protocol which allows to transfer just the differences between two sets
of files. First time, it copies the whole content of a file or a directory
from source to destination but from next time, it copies only the
changed blocks and bytes to the destination.
 Rsync consumes less bandwidth as it uses compression and
decompression method while sending and receiving data both ends.

We can install rsync in Linuxmint or Ubuntu by:

# apt install rysnc –y

Most commonly used options in rsync command are as:

-v -verbose Verbose output


-z -compress compress file data during the transfer
-h human readable display the output numbers in a human-
readable format.
-r -recursively sync files and directories recursively.
-a -archive archive files and directory while
synchronizing.
-progress show the sync progress during transfer.
-b -backup take the backup during synchronization.
Example 1: Copy or sync files locally (rsync –zvh).

Let’s assume we want to copy a file from Acer user’s home directory to
/opt/back folder, execute the below rsync command.

# rsync -zvh /home/Acer/linux.pdf /opt/backup

In above we have used the options like -z for compression, -v for verbose
output and -h for human readable output.

Example 2: Copy or sync files and directories from local to remote


system.

Let’s suppose we want to copy the folder “/home/Acer/BCA7” from local


machine to remote machine (192.168.1.29) under the /opt.

# rsync -zarvh /home/Acer/BCA7 [email protected]:/opt

4. b) Write a shell script program to find the square of given input


number.
Answer: Shell is a program which interprets user commands through
CLI(command-line interpreter) like Terminal. Shell scripting is writing a
series of command for the shell to execute.
The shell script program to find square of any given input number is:
echo “Enter a number”
read a
square = `expr $a \* $a`
echo "The square is $square"

OUTPUT:
Enter a number
2
The square is 4

5. a) What is httpd service? How a webpage is published in a linux


server.
Answer: httpd is a software program that runs in the background of a
web server and waits for the incoming server requests. The daemon answers
the request automatically and serves the hypertext and multimedia
documents over the Internet using HTTP. HTTPd stands for Hypertext
Transfer Protocol daemon (i.e. Web server).
To publish a webpage in a linux server there are mainly 3 components to be
installed. They are as:

i) Apache2: apache2 is open-source HTTP server. It is still the most


popular web-server used worldwide today.
ii) php and php sqlite component: PHP is a server-side scripting
language. PHP and its component will help you to interact with a
backend mySQL database for your website.
iii) mySQL: mySQL is a database solution in which you shall be storing
your data in the table.

Step 1: Install Apache2


Apache is open source web-server software that powers much of the web
today. Open the terminal and type the command as:
sudo apt-get updatesudo apt-get install apache2
To check if apache2 is installed properly type command:
sudo service apache2 restart
Step 2: Install mySql
mySQL is the database management solution that helps you to store and
retrieve data in tables. We are installing here php5-mysql component.
sudo apt-get install mysql-server php5-mysql
Step 3 : Install PHP
PHP is an open source web server scripting language. It is a back-end
scripting language that will help you to interact with the mySQL database.
PHP provides multiple auxiliary libraries for different needs.
For example, if you want to show the tabular employee list stored in your
mySQL database in your website, with the help of PHP you can interact with
mySQL, retrieve the employee list and render in html page.
To install PHP and php5-mysql type command:
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
sudo apt-get install php5-sqlite

After the successfully completion of above mentioned steps, it is ready to


run the web server in our system.

5. b) What is Dynamic ip address. Explain DORA process.


Answer: A dynamic Internet Protocol address (dynamic IP address) is
a temporary IP address that is assigned to a computing device or node when
it's connected to a network. A dynamic IP address is an automatically
configured IP address assigned by a DHCP server to every new network
node.
The main advantage of assigning IP addresses dynamically is that it's
more flexible, and easier to set up and administer than static IP address
assignments.
DORA is a process which is used by DHCP in order to provide an IP
address to hosts or client machine. The DORA process has four messages.
Figure: DORA process

a) Discover:
Discover Message is the first message of the DORA process. In this
message, the DHCP client wants to discover a DHCP Server and hence
sends a DHCP Discover message. Different fields of Discover message
are :

Source IP: 0.0.0.0

Destination IP: 255.255.255.255

Source MAC: DHCP Client Machine MAC Address

Destination MAC: FF:FF:FF:FF:FF:FF

b) Offer:
As soon as DHCP Server receives Client Discover message, the
DHCP server reply to DHCP client as an offer message.

Source IP: DHCP Server IP Address

Destination IP: 255.255.255.255

Source MAC: DHCP Server Machine MAC Address

Destination MAC: DHCP client MAC Address

c) Request:
Now, the DHCP client machine receives the DHCP Offer message
and replies with a DHCP request message. This message basically tells
the DHCP server that I’m fine with this IP address. Please allocate this IP
address to me. The DHCP Request Message header has the following
main fields:

Source IP: 0.0.0.0

Destination IP: 255.255.255.255

Source MAC: DHCP Client Machine MAC Address

Destination MAC: DHCP Server MAC Address

d) Acknowledgment:
DHCP acknowledge message is the last message of the DORA
process. It is sent by the DHCP Server to DHCP Client. This message is a
reply to the DHCP Request message. This message header has the
following main fields:

Source IP: DHCP Server IP Address

Destination IP: 255.255.255.255

Source MAC: DHCP Server Machine MAC Address

Destination MAC: DHCP client MAC Address

6. a) Write the steps to start, stop and configure MYSQL server in


Linux.
Answer: MySQL is an open-source relational database that is free and
widely used. For linux system by default the mysql server is off. We need to
start the mysql server by typing this command:
To start mysql server:
$sudo systemctl start mysql
To stop mysql server:
$sudo systemctl stopmysql

To configure mysql server:


Global options that affect how the mysql server and related client
programs suns are denied in the /etc/my.conf file. The default my.conf file
contains only a few settings needed to get a small mysql configuration.
Sample my.conf files are available in the /usr/share/doc/mysql.ser*
directory. To use one of these files do the following:
i) keep a copy of the old my.conf files:
#mv /etc/my.conf /etc/my.cnfOld
ii) keep the sample my.conf we want to the /etc/my.cnf file
For example to use the mymedim.cnf file, type the following:
#cp /usr/share/doc/mysql-server*/my-medium.conf /etc/my.conf
iii) edit the new /etc/my.cnf file (as root user) using any text editor to
further tune our mysql variables and options:
#vi /etc/my.cnf
Make sure mysql server can be accessed from your Apache+php5 server.
Inside my.cnf file:
#make sure skip-network
#
#
bind-address= 192.168.1.13

6. b) What is a top level domain? Explain the steps to install and


remove DNS package.
Answer: A top-level domain (TLD) is one of the domains at the
highest level in the hierarchical Domain Name System of the Internet. The
top-level domain names are installed in the root zone of the name space. For
example, in the domain name www.example.com, the top-level domain is
.com
The steps to install and remove DNS package are as:
Step 1: Update system
$sudo apt-get Update
Step 2: Install DNS package
$sudo apt-get install bind9
Once you execute the previous commands, it will suggest some other
packages to be installed press y to confirm downloading and installing those
packages.
Step 3: Install DNS utilities
$sudo apt-get install dnsutils
Another useful package that will help you lot in troubleshooting, testing
the DNS issues is the dnsutils package that can be installed using the next
command.
Step 4: DNS configuration
Usually you can find the DNS configuration files stored in /etc/bind
directory. /etc/bind/named.conf is the master configuration file that contains
the DNS options and is highly recommended that you should be careful
while editing it.
Step 5: Configuring Nameserver
The most used and default configuration is using your server as a caching
server means that: the DNS will get the answer to name queries, cache it and
use the answer again when the domain is queried for another time. So to use
your server as a caching nameserver you can follow next few steps:
$sudo systemctl restart-bind9
Step 6: Primary master
For a primary master server configuration, the DNS gets the data for a
zone from a file stored on its host. Also the dns has a control for that zone.
Now lets say we have a domain called "example.com" we are going to
configure the DNS to be primary master for that domain.
$sudo vi /etc/bind/named.conf
$sudo vi /etc/bind/db.example.com
$sudo systemctl restart bind9
Now to map an IP to name you have to configure the reverse zone file:
i) Edit the /etc/bind/named.conf.local file
$sudo vi /etc/bind/named.conf.local
ii) create the /etc/bind/db.10file from template one
$sudo cp /etc/bind/db.127 /etc/bind/db.10
iii) edit the /etc/bind db.10file
$sudo vi /etc/bind/db.10
iv) restart DNS services to apply changes.
Step 7:Configuration file verifications
Now and after performing all previous configurations we need to verify
all the configurations are correct.
Execute the following commands to check if it will return any errors.
named-checkzone example.com /etc/bind /etc/bind/db.example.com
named-checkconf /etc/bind/named.conf

# Remove DNS Package


$sudo apt-get remove bind9
Finally we have install and remove the DNS package on Ubuntu
successfully.
7. Write short notes on (any two):

a) Bandwidth: Bandwidth is measured as the amount of data that can


be transferred from one point to another within a network in a specific
amount of time. A higher bandwidth enhances the experience of your
users by allowing them to upload and/or download content, such as
photos and videos.

Features:

 Faster application performance. These days, people want things


fast. A higher bandwidth substantially increases the responsiveness of
all your website’s applications.
 Enables interactivity. Interaction increases a user’s connection and
loyalty to a website. A higher bandwidth enhances the experience
of your users by allowing them to upload and/or download content,
such as photos and videos.
 Increased data transfer capability. A higher bandwidth allows your
users to upload and download larger amounts of data to your website.
 Faster data transfer speed. The benefits of website interactivity are
negated if uploads and downloads are painstakingly slow. A higher
bandwidth results in significantly faster transfer speeds resulting in
less frustration and greater customer satisfaction.
 Allow for more simultaneous visitors. The more traffic your website
can accommodate, the faster it will grow and the greater your profit. A
higher bandwidth accomplishes this goal by allowing for multiple
visitors at once.
 Reduced crashes, bounces or “busy signals.” If users are frustrated
or unable to access your website on their timeframe, you will lose
them. A higher bandwidth helps to avoid compromising your server
resulting in a significantly smoother experience for your users.
 Support multiple concurrent sessions. Users are rarely running a
single application at one time. With a higher bandwidth, you enable
your users to multi-task and maximize their productivity by running
multiple applications simultaneously.
 Stream videos faster. Watching a video that constantly freezes is
extremely frustrating. A higher bandwidth allows your users to focus
on the content of your videos rather than the irritating interruptions.
b) fat32: FAT32 Format as written on the command line is a
disk formatting utility designed to format discs larger than 32 GB with
the venerable FAT32 file system. Some operating systems software or
experiments only require or support FAT32.
It is designed specifically for Windows XP.FAT32 uses space
more efficiently. FAT32 uses smaller clusters (that is, 4-KB clusters
for drives up to 8 GB in size), resulting in 10 to 15 percent more
efficient use of disk space relative to large FAT or FAT16
drives.FAT32 is more robust.
FAT32 supports drives up to 2 terabytes in size.FAT32 uses space
more efficiently. FAT32 uses smaller clusters (that is, 4-KB clusters
for drives up to 8 GB in size), resulting in 10 to 15 percent more
efficient use of disk space relative to large FAT or FAT16
drives.FAT32 is more robust.
FAT32 can relocate the root folder and use the backup copy of the
file allocation table instead of the default copy. In addition, the boot
record on FAT32 drives is expanded to include a backup copy of
critical data structures.
Therefore, FAT32 drives are less susceptible to a single point of
failure than existing FAT16 drives.FAT32 is more flexible. The root
folder on a FAT32 drive is an ordinary cluster chain, so it can be
located anywhere on the drive. The previous limitations on the number
of root folder entries no longer exist.
In addition, file allocation table mirroring can be disabled, allowing
a copy of the file allocation table other than the first one to be active.
These features allow for dynamic resizing of FAT32 partitions.

You might also like