Chapter Five Network Items Specification

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 37

CHAPTER FIVE

Network Items Specification


Outline
Background on Linux
Open Source Operating System

Free Software

Source Code Available


Components of Linux System

Linux OS has the following components :-


1.Kernel is a main program of Unix system. it controls hard wares, CPU, memory,

hard disk, network card etc.

2.System Library − System libraries are special functions or programs using

which application programs or system utilities accesses Kernel's features.


These libraries implement most of the functionalities of the operating system and
do not requires kernel module's code access rights

3.System Utility − System Utility programs are responsible to do specialized,

individual level tasks.


Architecture of Linux System
✓ Hardware layer − Hardware consists
of all peripheral devices (RAM/ HDD/
CPU etc.).
✓ Kernel − It is the core component of
Operating System, interacts directly with
hardware.
✓ Shell − an interface to kernel, hiding
complexity of kernel's functions from
users. The shell takes commands from the
user and executes kernel's functions.
✓ Utilities − Utility programs that
provide the user most of the
functionalities of an operating systems
LINUX VS WINDOWS
Parameters Linux Windows
Price The majority of Linux variants are Microsoft Windows can run between $50.00
available for free or at a much - $150.00 US dollars per each license copy.
lower price than Microsoft
Windows.
Ease Although the majority Linux Microsoft has made several advancements
variants have improved and changes that have made it a much easier
dramatically in ease of use, to use operating system, and although
Windows is still much easier to use arguably it may not be the easiest operating
for new computer users. system, it is still Easier than Linux.
Reliability The majority of Linux variants and Although Microsoft Windows has made
versions are reliable and can often great improvements in reliability over the
run for months and years without last few versions of Windows, it still cannot
needing to be rebooted. match the reliability of Linux.
Software Linux has a large variety of Because of the large amount of Microsoft
available software programs, Windows users, there is a much larger
utilities, and games. However, selection of available software programs,
Windows has a much larger utilities, and games for Windows.
selection of available software.
Hardware Linux companies and hardware Because of the amount of Microsoft
manufacturers have made great Windows users and the broader driver
advancements in hardware support support, Windows has a much larger
for Linux and today Linux will support for hardware devices and a good
support most hardware devices. majority of hardware manufacturers will
However, many companies still do support their products in Microsoft
not offer drivers or support for their Windows.
hardware in Linux.
Security Linux is and has always been a very Although Microsoft has made great
secure operating system. Although itimprovements over the years with security
still can be attacked when compared on their operating system, their operating
to Windows, it much more secure. system continues to be the most vulnerable
to viruses and other attacks.
Open Source Many of the Linux variants and Microsoft Windows is not open source and
many Linux programs are open the majority of programs are not open
source and enable users to customize source Windows .
or modify the code however they
wish to.
Support Although it may be more difficult to Microsoft Windows includes its own help
find users familiar with all Linux section, has vast amount of available online
variants, there are vast amounts of documentation and help, as well as books
available online documentation and on each of the versions of Windows.
help, available books, and support
available for Linux.
Linux Distributions
Ubuntu
• Canonical started sending out free compact discs with Ubuntu Linux in 2004 and
quickly became popular for home users (many switching from Microsoft
Windows). Canonical wants Ubuntu to be an easy to use graphical Linux desktop
without need to ever see a command line. Of course they also want to make a
profit by selling support for Ubuntu.

Debian
 There is no company behind Debian. Instead there are thousands of well
organized developers that elect a Debian Project Leader every two years. Debian
is seen as one of the most stable Linux distributions. It is also the basis of every
release of Ubuntu. Debian comes in three versions: stable, testing and unstable.

 
Cont’
Other
Distributions like Oracle Enterprise Linux and Scientific
Linux are based on Red Hat Enterprise Linux and share many
of the same principles, directories and system administration
techniques.
Linux Mint, Edubuntu and many other *buntu named
distributions are based on Ubuntu and thus share a lot with
Debian. There are hundreds of other Linux distributions.
Server and Desktop Differences
 There are a few differences between the Ubuntu Server Edition and the
Ubuntu Desktop Edition.
 both editions use the same app repositories.

 The differences between the two editions are the lack of speed and
storage capacity environment in the desktop Edition, the installation
process, and different Kernel options.
 During the Server Edition installation you have the option of installing
additional packages from the CD. The packages are grouped by the type
of service they provide.
 Example: DNS server: Selects the BIND DNS server and its
documentation.
File system hierarchy
 Many Linux distributions partially follow the File system Hierarchy
Standard. The FHS may help make more Unix/Linux file system trees
conform better in the future.
 The root directory /  

 All Linux systems have a directory structure that starts at the root
directory. The root directory is represented by a forward slash, like
this: /. Everything that exists on your Linux system can be found
below this root directory. Let's take a brief look at the contents of the
root directory.
/bin
This directory contains a number of essential commands that are
available to unprivileged. The /bin directory also houses the shells (such
as bash files).

/lib
This is where all kernel modules needed for system boot libraries that
are required by root system commands (commands found in /bin and
/sbin.). Binaries found in /bin and /sbin often use shared libraries located
in /lib.

/opt
The purpose of /opt is to store optional software. In many cases this is
software from outside the distribution repository. You may find an
empty /opt directory on many systems.
/boot
 Contains all files needed to boot the computer. These files don't change
very often. On Linux systems you typically find the /boot/grub directory
here. /boot/grub contains /boot/grub/grub.cfg (older systems may still
have /boot/ grub/grub.conf) which defines the boot menu that is displayed
before the kernel starts.

/etc
 All of the machine-specific configuration files should be located in /etc.

 Many times the name of a configuration files is the same as the


application, or protocol with .conf added as the extension.

 
Directory Structure
 Files are put in a directory.

 All directories are in a hierarchical structure (tree structure).

 User can put and remove any directories on the tree.

 Top directory is “/”, which is called slash or root.

 Users have ther own directory. (home directory)


Important Directories
 /bin This contains files that are essential for correct operation of the
system. These are available for use by all users.
 /home This is where user home directories are stored.

 /var This directory is used to store files which change frequently, and

must be available to be written to.


 /etc Various system configuration files are stored here.

 /dev This contains various devices as files, e.g. hard disk, CD-ROM

drive, etc.
 /tmp Temporary files.
Linux Basic Commands
Listing Files and Directories

 ls (list) - Lists directory contents

 ls [option] [file]

ls – list files in the current directory

ls /etc – list content of /etc directory

ls –a – list all files (including hidden files)

ls –l – use long listing format when displaying the list

ls –l-h It shows the numbers (file sizes) in a more human


readable format.
Creating Directories
 mkdir (make directory)

 Syntax: mkdir directoryname

 mkdir ICT: create the directory ICT in the current directory

 mkdir /home/ SA: Create the directory SA in the /home directory

Creating Files

Touch
 Syntax: Touch Filename

 touch IT: create the file IT in the current directory

 touch /home/ IT/SA: Create the file SA in the /home/IT directory


Changing to a Different Directory
 cd (change directory)
Syntax: cd directory name
Change the current working directory to 'directory'.
cd .. : change to parent directory)
 Example:
cd ICT: Change to the directory ICT
cd /home/ SA
 Path names
pwd (print name of current/working directory)

Syntax: pwd [options]


Example:
%pwd
Summary of very basic commands

ls list files and directories

ls -a list all files and directories

mkdir make a directory

cd directory change to named directory

cd change to home-directory

cd ~ change to home-directory

cd .. change to parent directory

pwd display the path of the current directory


Working with Files

 Linux is case sensitive; this means that FILE1 is different from file1, and
/etc/hosts is different from /etc/Hosts  
Copying Files
 Syntax: cp source destination
– Copy the file Source to Destination
 Example:
cp file1 /home/ict2: copy the file file1 to the directory /home/ict2
cp –r /home/ict2 ict: copy the directory (with all its file) /home/ict2
to the directory ict
cp /home/ict2/file1: copy the file file1 from the directory /home/ict2
to the current directory
Moving/renaming Files
 Syntax: mv source destination

 Example:

 mv file1 flie2: Renames the file file1 to file2( If you move it


with in the same directory giving it different name it
actually renames the file)
 mv /home/ict/ file1 ict/file2: Move the file file1 from
/home/ict directory to ict directory
Removing Files and Directories

 rm - remove files and directories

 Syntax: rm File

 Example:

 rm ict/file1: remove the file file1 from the directory ict

 rm –r /home/ict2: delete the directory /home/ict2 along with its


files
 rmdir - remove empty directory

 Syntax: rmdir directory

 Example:

 rmdir ict: delete the empty directory ict


Displaying Content of Files on Screen
 cat - concatenate files and print on std output
 Syntax: cat [option] [file]
 Example:
 cat file1: display the content of file1 on the screen
 ~$ echo one > part1
 ~$ echo two > part2
 ~$ echo three > part3
 ~$ cat part1 part2 part3
 one
 two
 three
 
Displaying…
more and less  
The more command is useful for displaying files that take up more
than one screen. More will allow you to see the contents of the file page
by page. Use the space bar to see the next page, or q to quit.
 less
 Syntax: less [option] file
 Example:
Less file1
more
 Syntax: more [option] file
 Example:
more file1
Displaying….
head 
 You can use head to display the first ten lines of a file.
paul@laika:~$ head /etc/passwd  
 The head command can also display the first n lines of a file.
 
paul@laika:~$ head -4 /etc/passwd
Tail
 Similar to head, the tail command will display the last ten
lines of a file.
paul@laika:~$ tail /etc/services

 
Searching the contents of a file
 grep – print lines matching a pattern

 Syntax: grep [options] pattern [file]

 Example: search for the word localhost in the file /etc/hosts

 grep localhost /etc/hosts

 Simple searching using less

 Use the less command to display the content of the file and then
type /search string
 Example: (search for the word localhost in the file /etc/hosts)

 less /etc/hosts/localhost
Summary – Working with files

cp file1 file2 copy file1 and call it file2


mv file1 file2 move or rename file1 to file2
rm file remove a file
rmdir directory remove a directory
cat file display a file
more file display a file a page at a time

head file display the first few lines of a file

tail file display the last few lines of a file


grep 'keyword' file search a file for keywords
Pipe
Use the pipe (|) symbol to give the output of one command as an input
to another command.
Example
ls /etc | grep resolv.conf (list the content of the file /etc and display
lines containing the name resolv.conf)

Summary – Redirection
command > file redirect standard output to a file
command >> file append standard output to a file
command < file redirect standard input from a file
pipe the output of command1 to the
command1 | command2
input of command2
cat file1 file2 > file0 concatenate file1 and file2 to file0
File Permissions
• The long version of a file listing (ls -l) will display
the file permissions:

-rwxrwxrwx
Other permissions
Group permissions
Owner permissions
July 9, 2021 Directory flag (d=directory; l=link) 29
Changing File Permissions
 Use the chmod command to change file permissions

 The permissions are encoded as an octal number


chmod 755 file # Owner=rwx Group=r-x Other=r-x
chmod 500 file2 # Owner=r-x Group=--- Other=---
chmod 644 file3 # Owner=rw- Group=r-- Other=r--

chmod +x file # Add execute permission to file for all


chmod o-r file # Remove read permission for others
chmod a+w file # Add write permission for everyone

July 9, 2021 30
File compressions commends
gzip –gunzip

 If users never have enough disk space, so compression comes in


handy using gzip.
 The gzip command can make files take up less space.
  bzip2 -bunzip2
 Files can also be compressed with bzip2 which takes a little more
time than gzip, but compresses better.
Package Management

Apt-Get
The apt-get command is a powerful command line tool used to work
with Ubuntu's Advanced Packaging Tool (APT) performing such
functions as installation of new software packages, upgrade of existing
software packages, updating of the package list index, and even
upgrading the entire Ubuntu system.
Package Management
 apt-get update – refresh available updates

 apt-get upgrade – upgrade all packages

 replacements; upgrade Ubuntu version

 Apt-cache policy pkg-check weather the pkg installed or not

 Apt-cache search pkg-check the avialability of the pkg

 apt-get install pkg – install pkg

 apt-get purge pkg – uninstall pkg

 apt-get autoremove – remove obsolete packages

 apt-get -f install – try to fix broken packages

 dpkg --configure -a – try to fix broken packages


dpkg

 dpkg is a package manager for Debian based systems. It can install,


remove, and build packages, but unlike other package management
system's it can not automatically download and install packages and
their dependencies. This section covers using dpkg to manage locally
installed packages:
 To list all packages installed on the system, from a terminal prompt
enter: dpkg -l
Remote login
• The secure shell or ssh is a collection of tools
using a secure protocol for communications with
remote Linux computers.
• secure shell Avoid using telnet, rlogin and rsh to
remotely connect to your servers. These older protocols
do not encrypt the login session, which means your user
id and password can be sniffed by tools like wireshark
or tcpdump.
• The ssh protocol is secure in two ways. Firstly the
connection is encrypted and secondly the connection is
authenticated both ways.
35
Adding and Deleting user
To add a user account
• sudo adduser username
To delete a user account and its primary group, use
the following syntax:
• sudo deluser username
• # useradd -D
• userdel
• You can delete the user yanina with userdel. The -r option
of userdel will also remove the home directory.
• # userdel -r yanina
END OF CHAPTER five

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy