Linux OS Tutorial
Linux OS Tutorial
in Cyber Security
CSP-10
Block
2
Linux Operating System
Unit -3
Linux Part-I
Unit -4
Linux Part-II
EXPERT COMMITTEE
Dr.P.K.Behera (Chairman)
Reader in Computer Science
Utkal University
Dr J.R.Mohanty (Member)
Prof And HOD
KIIT University
Dr.R.N.Behera (Member)
Senior Technical Director
NIC, ,Bhubaneswar
Dr.R.N.Behera (Member)
Senior Technical Director
NIC, ,Bhubaneswar
Sh Malaya Kumar Das (Member)
Scientist –E
NIC, Bhubaneswar
Dr.Bhagirathi Nayak (Member)
Professor And Head(IT & System)
Sri Sri University
Dr.Manoranjan Pradhan (Member)
Professor And Head
G.I.T.A
Mr V.S.Sandilya (Convener)
Consultant I.T
Odisha State Open University, Sambalpur,
Learning objectives
1) About Linux
2) Linux vs Windows
3) Why use Linux
4) History of Linux
5) Different types of Linux environment.
6) Linux Commands.
7) File & Directory Management Commands
8) Know Kernel, Gnome of Linux
Structure
3.1 Introduction
3.2 History Of Linux
3.3 Distributions of Linux
3.4 Devises and drivers used
3.5 File System Hierarchy
3.6 The Components: Kernel, Distribution, XFree86, Sawfish, Gnome
3.7 The command-line commands
3.8 File management commands
3.9 Working with Nano.
3.10 Working with the help (man).
3.11 Let us sum up.
3.12 Key words
3.13 References
3.14 Check your progress –possible answers
3.1 Introduction
What is Linux?
An operating system is a program that acts as an interface between the user and
the computer hardware and controls the execution of all kinds of programs.
The Linux operating system is widely used by both home and business users, and
its usage is increasing daily. It is considered that Linux will eventually overtake
Microsoft Windows as the most popular operating system, which could also open
the door further for more free software such as Open Office, The Gimp, Paint,
Thunderbird, Firefox and Scribes. It is easy to install and run alongside your
existing operating system, so give it a try, because it is also easy to remove if you
don’t like it – which is unlikely.
Advantages of Linux
1. It is free
2. It is portable to any hardware platform.
3. It is secure and versatile
4. It is scalable
5. It is VIRUS free OS
This is one of the questions that most people ask. Why bother learning a
completely different computing environment, when the operating system that
ships with most desktops, laptops, and servers works just fine?
To answer that question, I would pose another question. Does that operating
system you’re currently using really work “just fine”? Or are you constantly
battling viruses, malware, slowdowns, crashes, costly repairs, and licensing fees?
If you struggle with the above, and want to free yourself from the constant fear
of losing data or having to take your computer in for the “yearly clean up,” Linux
might be the perfect platform for you. Linux has evolved into one of the most
That’s right, zero cost of entry...as in free. You can install Linux on as many
computers as you like without paying any money for software or server licensing
(including costly Microsoft Client Access License – CALs). Working with Linux
is a dream comes true. No more daily babysitting servers. In fact, Linux is as
close to “set it and forget it” as you will ever find. And, on the off chance, one
service on the server requires restarting; re-configuring, upgrading, etc… most
likely the rest of the server won’t be affected.
The Linux desktop or a server, if zero cost isn’t enough to win you over – what
about having an operating system that will work, trouble free, for as long as you
use it? It is not once have an issue with malware, viruses, or random computer
slow-down and server reboots? Only if the kernel is want to update. It is not out
of the ordinary for a Linux server to go years without being rebooted. That’s
stability and dependability.
Linux is also distributed under an open source license. Open source follows the
following key philosophies:
1969
All modern operating systems have their roots in 1969 when Dennis
Ritchie and Ken Thompson developed the C language and the UNIX operating
system at AT&T Bell Labs. They shared their source code (yes, there was open
source back in the Seventies) with the rest of the world, including the hippies in
Berkeley California. By 1975, when AT&T started selling UNIX commercially,
about half of the source code was written by others. The hippies were not happy
that a commercial company sold software that they had written; the resulting
(legal) battle ended in there being two versions of UNIX: the official AT&T
UNIX, and the free BSD Unix.
1980
In the Eighties many companies started developing their own UNIX:
IBM created AIX, Sun SunOS (later Solaris), HP HP-UX and about a dozen
other companies did the same. The result was a mess of UNIX dialects and a
dozen different ways to do the same thing. And here is the first real root of
Linux, when Richard Stallman aimed to end this era of UNIX separation and
everybody re-inventing the wheel by starting the GNU project (GNU is Not
Unix). His goal was to make an operating system that was freely available to
everyone, and where everyone could work together (like in the Seventies). Many
of the command line tools that you use today on Linux are GNU tools.
https://en.wikipedia.org/wiki/Richard_Stallman
https://en.wikipedia.org/wiki/IBM_AIX
https://en.wikipedia.org/wiki/HP-UX
1990
http://en.wikipedia.org/wiki/Linus_Torvalds
https://en.wikipedia.org/wiki/History_of_Linux
https://en.wikipedia.org/wiki/Linux
https://lwn.net
2015
Today more than 97 percent of the world's supercomputers (including the
complete top 10), more than 80 percent of all smartphones, many millions of
desktop computers, around 70 percent of all web servers, a large chunk of tablet
computers, and several appliances (dvd-players, washing machines, dsl modems,
routers, self-driving cars, space station laptops...) run Linux. Linux is by far the
most commonly used operating system in the world.
Linux kernel version 4.0 was released in April 2015. Its source code grew
by several hundred thousand lines (compared to version 3.19 from February
2015) thanks to contributions of thousands of developers paid by hundreds of
Computers were extremely expensive then, and sacrifices had to be made even
after the original purchase just to get the users to understand how they worked.
The total cost per unit of computing power was enormous.
Technologically the world was not quite that advanced, so they had to live with
the size for another decade. In 1969, a team of developers in the Bell Labs
laboratories started working on a solution for the software problem, to address
these compatibility issues. They developed a new operating system, which was
The Bell Labs developers named their project "UNIX." The code recycling
features were very important. Until then, all commercially available computer
systems were written in a code specifically developed for one system. UNIX on
the other hand needed only a small piece of that special code, which is now
commonly named the kernel. This kernel is the only piece of code that needs to
be adapted for every specific system and forms the base of the UNIX system.
The operating system and all other functions were built around this kernel and
written in a higher programming language, C. This language was especially
developed for creating the UNIX system. Using this new technique, it was much
easier to develop an operating system that could run on many different types of
hardware.
UNIX was initially found only in very large environments with mainframes and
minicomputers (note that a PC is a "micro" computer). You had to work at a
university, for the government or for large financial corporations in order to get
your hands on a UNIX system.
But smaller computers were being developed, and by the end of the 80's,
many people had home computers. By that time, there were several versions of
UNIX available for the PC architecture, but none of them were truly free and
more important: they were all terribly slow, so most people ran MS DOS or
Windows 3.1 on their home PCs.
By the beginning of the 90s home PCs were finally powerful enough to run a
full-blown UNIX. Linus Torvalds, a young man studying computer science at the
University of Helsinki, thought it would be a good idea to have some sort of
freely available academic version of UNIX, and promptly started to code.
He started to ask questions, looking for answers and solutions that would help
him get UNIX on his PC. Below is one of his first posts in comp.os.minix, dating
from 1991:
Due to a project I'm working on (in minix), I'm interested in the posix
standard definition. Could somebody please point me to a (preferably)
machine-readable format of the latest posix rules? Ftp-sites would be
nice.
In those days plug-and-play wasn't invented yet, but so many people were
interested in having a UNIX system of their own, that this was only a small
obstacle. New drivers became available for all kinds of new hardware, at a
continuously rising speed. Almost as soon as a new piece of hardware became
available, someone bought it and submitted it to the Linux test, as the system was
gradually being called, releasing more free code for an ever wider range of
hardware. These coders didn't stop at their PC's; every piece of hardware they
could find was useful for Linux.
Back then, those people were called "nerds" or "freaks", but it didn't
matter to them, as long as the supported hardware list grew longer and longer.
Thanks to these people, Linux is now not only ideal to run on new PC's, but is
also the system of choice for old and exotic hardware that would be useless if
Linux didn't exist.
Two years after Linus' post, there were 12000 Linux users. The project,
popular with hobbyists, grew steadily, all the while staying within the bounds of
the POSIX standard. All the features of UNIX were added over the next couple
of years, resulting in the mature operating system Linux has become today.
Linux is a full UNIX clone, fit for use on workstations as well as on middle-
range and high-end servers. Today, a lot of the important players on the
hardware and software market each have their team of Linux developers; at your
local dealer's you can even buy pre-installed Linux systems with official support
- even though there is still a lot of hardware and software that is not supported,
too.
Linux has a number of different versions to suit nearly any type of user.
From new users to hard-core users, you will find a “flavor” of Linux to match
your needs. These versions are called distributions (or, in the short form,
“distros.”) Nearly every distribution of Linux can be downloaded for free,
burned onto disk (or USB thumb drive), and installed on as many machines as
you like.
1. Ubuntu Linux
2. Fedora
3. Debian
4. OpenSUSE
5. Linux Mint
6. Arch Linux
7. Deepin
Each distribution has a different take on the desktop. Some are for very modern
user interfaces (such as Ubuntu’s Unity, above, and Deepin’s Deepin Desktop),
whereas others stick with a more traditional desktop environment (openSUSE
uses K Desktop Environment (KDE).
With Linux comes choice. Along with that choice, comes debate. Which
desktop is the best? Which offers the user-friendliest experience? The questions
are not only never-ending, but date back over a decade where the “war” between
KDE, GNOME, and every other desktop was given voice. It would, contend,
however, that there is a desktop for every kind of user to be found within the
Linux landscape. To that end, It want to take some of the most popular desktops
and match them to end users.
There are no hard and fast rules, tests to take, or wizards to walk
you through to your final Linux desktop destination. For most people it’s about
taste and features. But if you look at each desktop long enough, you discover
there is a clear connection between desktop and end user. You can examine the
following Linux desktops:
Ubuntu Unity
GNOME 3
Cinnamon
KDE
Enlightenment
XFCE
Deepin Desktop
Each of the above desktops has a strong following (with good reason). As
well, each desktop offers a wholly unique experience with plenty of features to
please anyone. However -- getting connected with the right desktop, up front,
You can check out the top 100 distributions on the http://www.distrowatch.com
site. And don’t think the server has been left behind. For this arena, you can
turn to:
Some of the above server distributions are free (such as Ubuntu Server and
CentOS) and some have an associated price (such as Red Hat Enterprise Linux
and SUSE Enterprise Linux). Those with an associated price also include
support.
Ubuntu
The Ubuntu project has a focus on providing a solid desktop (and server)
experience, and it isn’t afraid to build its own custom technology to do it. Ubuntu
used to use the GNOME 2 desktop environment, but it now uses its own Unity
desktop environment. Ubuntu is even building its own Mir graphical server while
other distributions are working on the Wayland.
Fedora
Fedora is a project with a strong focus on free software — you won’t find an
easy way to install proprietary graphics drivers here, although third-party
repositories are available. Fedora is bleeding edge and contains the latest
versions of software. Unlike Ubuntu, Fedora doesn’t make its own desktop
environment or other software. Instead, the Fedora project uses “upstream”
software, providing a platform that integrates all this upstream software without
adding their own custom tools or patching it too much. Fedora comes with the
GNOME 3 desktop environment by default, although you can also get “spins”
that come with other desktop environments.
Fedora is sponsored by Red Hat, and is the foundation for the commercial
Red Hat Enterprise Linux project. Unlike RHEL, Fedora is bleeding edge and
not supported for long. If you want a more stable release that’s supported for
longer, Red Hat would prefer you use their Enterprise product.
Red Hat Enterprise Linux is a commercial Linux distribution intended for servers
and workstations. It’s based on the open-source Fedora project, but is designed to
be a stable platform with long-term support.
Red Hat uses trademark law to prevent their official Red Hat Enterprise
Linux software from being redistributed. However, the core software is free and
open-source. Cento is a community project that takes the Red Hat Enterprise
Linux code, removes all Red Hat’s trademarks, and makes it available for free
use and distribution. It’s a free version. If you want a stable platform that will be
supported for a long time, Red Hat recently announced they’re collaborating, so
CentOS is now part of Red Hat itself.
Debian
Ubuntu was originally founded to take the core bits of stable Debian and
improve on them more quickly, packaging the software together into a user-
friendly system that’s more frequently updated.
This distribution now has its own identity. You won’t find Ubuntu’s own
Unity desktop here — instead, you get a more traditional Cinnamon or MATE
desktop. Mint takes a more relaxed approach to software updates and won’t
automatically install critical software updates. Controversially, this has led some
Ubuntu developers to label it insecure.
Others
Distributions like CentOS, 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.
Q.1 What is Linux ? What are the various flavors of Linux ? What are the
advantages of Linux ?
A.____________________________________________________________
______________________________________________________________
______________________________________________________________
The CPU is not the only intelligent device in the systems. Every physical
device has its own hardware controller. The keyboard, mouse and serial ports are
controlled by a Super IO (Input Output) chip, the Integrated Drive Electronics
(IDE) disks by an IDE controller, Small Computer System Interface (SCSI) disks
by a SCSI controller and so on. Each hardware controller has its own control and
status registers Certificate Signing Request (CSRs) and these differ between
devices. The CSRs for an Adaptec 2940 SCSI controller are completely different
from those of an NCR 810 SCSI controller. The CSRs are used to start and stop
the device, to initialize it and to diagnose any problems with it. Instead of putting
code to manage the hardware controllers in the system into every application, the
code is kept in the Linux kernel. The kernel is the essential center of a computer
operating system, the core that provides basic services for all other parts of the
operating system. A synonym is nucleus. A kernel can be contrasted with a shell,
the outermost part of an operating system that interacts with user commands. The
software that handles or manages a hardware controller is known as a device
driver. The Linux kernel device drivers are, essentially, a shared library of
privileged, memory resident, low-level hardware handling routines. It is Linux's
device drivers that handle the peculiarities of the devices they are managing.
There are many different device drivers in the Linux kernel (that is one of
Linux's strengths) but they all share some common attributes:
1. Kernel Code
Device drivers are part of the kernel and, like other code within the
kernel, if they go wrong they can seriously damage the system. A badly
written driver may even crash the system, possibly corrupting file
systems and losing data,
4. Loadable
5. Configurable
Linux device drivers can be built into the kernel. Which devices are built
is configurable when the kernel is compiled,
Like any other operating system, Linux organizes information in files and
directories. A directory is a special file that can contain other files and
directories. Because a directory can contain other directories, this method of
organizing files gives rise to a hierarchical structure. This hierarchical
organization of files is the file system.
Linux follows the file system hierarchy system. Each directory that is
inbuilt in Linux is prepared for a particular reason. The files in these directories
carry out the functions of the Linux. The top level directory is root directory.
The root is identified by the symbol /.The /boot directory comprises of the OS
kernel along with files used during boot strap process. The /swap directory
supports virtual memory. Data is written in the swap partition when there is less
memory in the RAM. Linux during installation has to be installed in the un
partitioned disk. Linux takes care of partitioning the disk into 3 partitions. these
are the / or root,/boot,/swap. The /boot takes 200mb and ./ or root takes 5gb of
hard disk. The /swap takes twice of memory, if i have 2 GB RAM 4GB of HDD
is used. The /root directory is the root home directory. It provides the working
environment of the root user. /home is the directory for other users./etc folder
contains start up and shut down shell script used to start and stop individual
programs./usr is the folder that holds default softwares./opt is the optional
directory for the /usr which holds 3rd partysoft wares./SBIN comprises of
commands used by super user./bin contains commands used by normal user./dev
contains device files.
/proc comprises of process files./var comprises of variable files./lib
comprises of library files./opt comprises of optional files./mnt is the mount
directory./media comprises of removable devises such as pen drive./srv
comprises of service data./proc comprises of processing information./foundlost
comprises of accidentally deleted files for recovery.
Partition Of Disk
60 60
/
/boot
/swap
60
If you’re familiar with other operating systems such as Windows, you may find
something missing in the Linux file system: You don’t find drive letters in
Linux. All disk drives and CD-ROM drives are part of a single file system.
In Linux, you can have long filenames (up to 256 characters), and
filenames are case sensitive. Often these filenames have multiple extensions,
such as sample.tar.Z. Unix filenames can take many forms, such as the
following: index.html, Makefile, binutils 2.15.92.0.2-5.i386.rpm, vsftpd_ 2.0.3-
1_i386.deb, .bash_profile, and httpd_src.tar.gz.
Directory Content
/boot Linux kernel and other files that the LILO and
GRUB boot managers need. (The kernel and
other files can be anywhere, but placing them in
the /boot directory is customary.
/sbin directory.
Kernel
Kernel is the core part of Linux. It is responsible for all major activities
of this operating system. It is consists of various modules and it interacts directly
with the underlying hardware. Kernel provides the required abstraction to hide
low level hardware details to system or application programs.
Distribution
Linux comes in broadly 2 kinds of distributions. These are desk top distribution
and the server side distribution. The desktop distribution enable us to load Linux
at the desktop and the server version enables us to load Linux at the Server.
Some of the desktop distributions are Fedora, Ubuntu and that at the server are
the Red Hat Enterprise versions.
XFree86
The Red Hat has a XConfigurator that allows to change graphical environment
The Suse Linux uses SaX2 to configure the Linux environment.
Sawfish
Sawfish is a window manager for the X Window System. It aims to
manage windows in the most flexible and attractive manner possible. It matches
a created window by multiple criteria, and automatically alters the window's
position, sets the software theme per-window, or removes the borders entirely.
There is a GUI configuration utility for users who do not wish to edit
configuration files directly.
Sawfish is an extensible window manager using an Emacs Lisp-like
scripting language. All window decorations are configurable and all user-
interface policy is controlled through the Lisp language. But Sawfish also comes
with a GUI configurator which allows basic customization (including switching
themes) without having to know any Lisp.
Sawfish focuses mainly on its core ability to manage windows, and not
on all the extras like application docks and modules that many modern window
managers provide. This means that Sawfish works really well when used in
conjunction with a desktop environment, particularly GNOME, as that provides
just the facilities that Sawfish lacks. In fact, Sawfish was once the default
window manager for the GNOME desktop.
Gnome
The command line commands are the commands that are issued at the terminal Mode.
The command line commands help the user to run commands to list files, make Folders,
copy files, delete files, hide files etc. It also helps the user to load, update, delete Software
Packages by giving commands. People those who mastered commands prefer command
line commands. Example of command line command is # cd ~ .this command takes the
user to the root home directory
What is the shell?
Shell is a user program or it's environment provided for user interaction. Shell is
an command language interpreter that executes commands read from the standard
input device (keyboard) or from a file.Shell is not part of system kernel, but uses
the system kernel to execute programs, create files etc. Shell in Linux is Bash
shell.
Terminal Mode
Click on open in terminal mode to open Linux in terminal mode as shown below.
So let’s get started. Launch the terminal emulator! Once it comes up, you
should see something like this:
[Sandy@Linuxbox ~]$
If the last character of the prompt is a hash mark (#) rather than a
dollar sign, the terminal session has superuser privileges. This means that
either we are logged in as the root user or we’ve selected a terminal
emulator that provides superuser (administrative) privileges.
Since this command makes no sense, the shell tells us so and gives us
another chance:bash: xyz: command not found [Sandy@Linuxbox ~] $
DATE
A
alias Create an alias •
apropos Search Help manual pages (man -k)
apt-get Search for and install software packages
(Debian/Ubuntu)
aptitude Search for and install software packages
(Debian/Ubuntu)
aspell Spell Checker
awk Find and Replace text, database
sort/validate/index
B
D
date Display or change the date & time
dc Desk Calculator
dd Convert and copy a file, write disk headers,
boot
records
ddrescue Data recovery tool
declare Declare variables and give them attributes •
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls'
J
jobs List active jobs •
join Join lines on a common field
K
kill Kill a process by specifying its PID
killall Kill processes by name
L
less Display output one screen at a time
let Perform arithmetic on shell variables •
link Create a link to a file
ln Create a symbolic link to a file
local Create variables •
locate Find files
logname Print current login name
logout Exit a login shell •
look Display lines beginning with a given string
lpc Line printer control program
lpr Off line print
lprint Print a file
lprintd Abort a print job
lprintq List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)
lsof List open files
A._______________________________________________________________
_______________________________________________________________
________________________________________________________________
A._______________________________________________________________
_______________________________________________________________
________________________________________________________________
A._______________________________________________________________
_______________________________________________________________
________________________________________________________________
A._______________________________________________________________
_______________________________________________________________
________________________________________________________________
ls - directory listing
ls -al - formatted listing with hidden files
cd dir - change directory to dir
cd - change to home
pwd - show current directory
mkdir dir - create a directory dir
rm file - delete file
rm -r dir - delete directory dir
rm -f file - force remove file
rm - rf dir - force remove directory dir *
cp filel fil e2 - cop y fi lel to file2
cp -r dirl dir2 - copy dirl to dir2; create dir2 if it doesn't exist
my filel file2 - rename or move filel to file2
if file2 is an existing directory, moves filel into directory file2
In -s file link - create symbolic link link to file touch file - create
or update file
cat >file - places standard input into file
more file - output the contents of file
head file - output the first 10 lines of file
tail file - output the last 10 lines of file
tail -f file - output the contents of file as it grows, starting with
the last 10 lines
Nano is a small, free and friendly editor which aims to replace Pico, the
default editor included in the non-free Pine package. Rather than just copying
Pico’s look and feel, nano also implements some missing (or disabled by
default) features in Pico, such as "search and replace" and "go to line number".
Note: you won't be able to save unless you have write permissions for
that file.
As above, no. nano is simple. It drops you in edit mode as soon as it opens.
You can use arrow keys, Page Up / Page Down and Home / End as in
gedit. You cannot use the mouse for moving the cursor position.
set softwrap
The example below shows that, if you wish, you may also provide the name of
the file you want to edit:
The top line displays the version of nano in the left corner and the name
of the file being edited.
The 3rd line from the bottom indicates the status of the file you're
editing; in the image below it shows that foo.cpp is a “New File”.
The last two lines of the screen present a menu of useful keyboard
commands. For example, ^X means to press Ctrl+x will exit the nano text
editor. These aren't the only commands available, to see an entire list of
commands enter Ctrl+g, will bring up the help window.
This point you can type in the code for your program:
Enter the source code exactly as you see it in the window below.
Notice after your first keystroke, the word “Modified” appears in the
upper-right corner; this shows that you've changed the contents of your
file but it hasn't been written to the hard drive yet.
Once you've entered all the code, save the code to the disk file by
pressing Ctrl+o (look at the next to last row, the second command
is ^O which means to “write out” the file to the hard drive).
Go ahead and press the Enter key, and nano will tell you how many lines
of text it wrote to disk on the status line. Notice also that the “Modified”
indicator in the upper-right corner has disappeared because the file has been
saved (see image below):
-h or –help
If you’re not sure how to use a specific command, run the command with the -
h or –helpswitches. You’ll see usage information and a list of options you can
use with the command. For example, if you want to know how to use
This will often print a lot of information to the terminal, which can be
inconvenient to scroll through. To read the output more easily, you can pipe
it through the less command, which allows you to scroll through it with the
arrow keys on your keyboard. For example, use the following command to
pipe wget’s help output through less:
help
The help command shows a short list of the commands built into the Bash
shell itself.
The man command shows detailed manuals for each command. These are
referred to as “man pages.” For example, if you wanted to view the man page
for the wget command, you’d typeman wget. Man pages generally contain
much more detailed information than you’ll
Type man intro to see a detailed introduction to using the shell on Linux.
1. What is Shell?
A.____________________________________________________________
____________________________________________________________
____________________________________________________________
A.____________________________________________________________
A.____________________________________________________________
A.____________________________________________________________
A.___________________________________________________________
A.____________________________________________________________
A.____________________________________________________________
Commands that are executed at the command line are termed as command
line commands. The commands that are used to manage the files ,folders and
administer the Linux system are termed as File management commands.
Nano is used as an editor which is used in Linux .XFree86 is free version
of Unix X windows system.it provides graphical interface for users. It uses
a client server model which means that the main operating system works at
one machine
And the rest of the systems communicate to it through sessions. By this client
systems that are available locally can communicate with the server and those
that are very far away or remote systems communicate with the server. This
enables data security and high speed transmission of data. Data is located at
one place which is safe and secure. Sawfish is a window manager for the X
Window System. It aims to manage windows in the most flexible and
attractive manner possible. Gnome is a Windows-like desktop system that
works on UNIX and Linux. Working with a command if help is needed
3.13 References
A.1. The kernel is the essential center of a computer operating system, the
core that provides basic services for all other parts of the operating system.
A synonym is nucleus. A kernel can be contrasted with a shell, the
outermost part of an operating system that interacts with user commands.
A.1. Gnome is a desktop environment that is developed for the Linux operation
system. Gnome helps in creating new files, folders, copying files from one folder
to the other, Delete files, rename files. Because of the graphical user interface a
user does not know the commands on the command line can effortlessly manage
with files and folders.
A.3. Command line commands are the commands that are issued at the
terminal mode of the Linux. Unlike the graphical user interface these commands
given on the terminal mode. Commands given at the terminal mode are taken
care by the shell that takes keyboard commands and passes them to the operating
system to carry out.
A.1 The shell is a program that takes keyboard commands and passes them to
the operating system to carry out.
A.2 ls command
A.3 clear
A.4 cat filename
A.5 mkdir directoryname
A.6 date
A.7 halt
Learning objectives
Structure
What Is SSH?
There are a couple of ways that you can access a shell (command line)
remotely on most Linux/Unix systems. One of the older ways is to use the telnet
program, which is available on most network capable operating systems.
Accessing a shell account through the telnet method though poses a danger in
that everything that you send or receive over that telnet session is visible in plain
text on your local network, and the local network of the machine you are
connecting to. So anyone who can "sniff" the connection in-between can see
your username, password, email that you read, and commands that you run. For
these reasons you need a more sophisticated program than telnet to connect to a
remote host.
SSH, which is an acronym for Secure Shell, was designed and created to provide
the best security when accessing another computer remotely. Not only does it
encrypt the session, it also provides better authentication facilities, as well as
features like secure file transfer, X session forwarding, port forwarding and more
so that you can increase the security of other protocols. It can use different forms
of encryption ranging anywhere from 512 bit on up to as high as 32768 bits and
includes ciphers like AES (Advanced Encryption Scheme), Triple DES,
Blowfish, CAST128 or Arcfour. Of course, the higher the bits, the longer it will
take to generate and use keys as well as the longer it will take to pass data over
the connection.
The second diagram shows how the data in an encrypted connection like SSH is
encrypted on the network and so cannot be read by anyone who doesn't have the
session-negotiated keys, which is just a fancy way of saying the data is
scrambled. The server still can read the information, but only after negotiating
the encrypted session with
This tutorial isn't going to cover how to install SSH, but will cover how to use it
for a variety of tasks. Consult your Linux distribution's document for information
on how to setup OpenSSH.
Chances are that if you are using a version of Linux that was released after 2002,
that you already have OpenSSH installed. The version of SSH that you will want
to use on Linux is called OpenSSH. As of this writing (October 2009), the latest
version available is 5.3, but you may encounter versions from 3.6 on up. If you
are using anything lower than version 3.9, I'd strongly advise you to upgrade it.
X-Forwarding.
Now that you've seen general TCP port forwarding, we move to a new topic:
forwarding of X protocol connections. X is a popular window system for Unix
workstations, and one of its best features is its transparency. Using X, you can
run remote X applications that open their windows on your local display (and
Once again, SSH comes to the rescue. An X protocol connection can be routed
through an SSH connection to provide security and stronger authentication. This
feature is called X forwarding.
ZIP
Zip is probably the most commonly used archiving format out there
today. Its biggest advantage is the fact that it is available on all operating system
platforms such as Linux, Windows, and Mac OS, and generally supported out of
the box. The downside of the zip format is that it does not offer the best level of
compression. Tar.gz and tar.bz2 are far superior in that respect. Let’s move on to
usage now. To compress a directory with zip do the following:
# zip -r archive_name.zip directory_to_compress
Here’s how you extract a zip archive:
# unzip archive_name.zip
TAR
TAR.BZ2
This format has the best level of compression among all of the formats
I’ve mentioned here. But this comes at a cost – in time and in CPU. Here’s how
you compress a directory using tar.bz2:
# tar -jcvf archive_name.tar.bz2 directory_to_compress
This will extract the files in the archive_name.tar.bz2 archive in the current
directory. To extract the files to a different directory use:
# tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/
Data compression is very handy particularly for backups. So if you have a shell
script that takes a backup of your files on a regular basis you should think about
using one of the compression formats you learned about here to shrink your
backup size.
Over time you will realize that there is a trade-off between the level of
compression and the time and CPU taken to compress. You will learn to judge
where you need a quick but less effective compression, and when you need the
compression to be of a high level and you can afford to wait a little while longer.
_________________________________________________________________
_________________________________________________________________
Q.2 What is X-forwarding?
A_______________________________________________________________
_________________________________________________________________
_________________________________________________________________
________________________________________________________________
GNU Screen is a tool which works with a terminal session to allow users to
resume a session after they have disconnected. Screen prevents a session from
“timing out” or disconnecting SSH connections or local terminal emulators. A
single Screen session has the ability to host multiple sessions or “windows.”
Screen may be used for a variety of tasks such as maintaining persistent IRC
sessions and multitasking in a terminal environment.
When installing Screen you will need root privileges. The examples provided do
not use the root account. If you are using your root login then the sudo before the
commands is not necessary.
For a Debian or Ubuntu system use the following commands to update, upgrade,
and install Screen:
For an Arch Linux system, the following commands are used to update and
install Screen:
For a CentOS or Fedora system use the following commands to update the
system and install Screen:
If you do not have screen installed install it using the yum command
You should get a message about screen being terminated once you close
all windows.
1 [screenis terminating]
Alternatively, you can use “Ctrl-a” “k”. You should get a message if you
want to kill the screen.
1. Super user :- Also termed as Root user. Has the privileges to Administer
the Linux server. Has the control to limit the access of other users.
The command to create a super user is
useradd – u 0 username
Here userid =0 is set for superuser
2. System user: - This user is created by the Linux Operating System. Have
more privileges than the normal user.
The command to create a system user is
Useradd – u uid username
uid is user id which ranges from 1 – 499
3. Normal user: - These users are created by the super user. They can access
only those privileges given by the Super user.
The command to create a normal user is
useradd username.
The number of users that can be added in 32 bit computer is 216
The number of users that can be added to 64 bit computer is 232
4. Network user: - Users who opt this type of user accounts are network
engineers and system administrators who monitor the network activity.
Network users can be created at the server level and creation of network
user is beyond the scope of the book.
5. Pseudo user: - This is a replica of the Super user which is granted by the
super user to user accounts.
The command to create a Pseudo user is
usermod -aG sudo username
# cat /etc/passwd
# adduser username
#passwd username :- this command would ask the user to enter the new
password as shown
below
#new password
And confirm password as shown below
#confirm password
#passwd username
#userdel username
#userdel-r username
usermod –u username
Users and groups is the core element of a Red Hat enterprise Linux
System Admin (RHCL).
Users and groups are used to control access to file and resources. Users
all that are created belong to the primary group.
The user can be allocated to secondary groups such as hrgroup, reception
in offices. A user that is created can be added to one or more groups.
#groupadd groupname
Example
#groupadd admin
1) Owner/user level
2) Group level
3) Other users
Reading -4
Writing – 2
Execute- 1
No permission – 0
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
A._______________________________________________________________
The Linux command 'su' is used to switch from one account to another.
The Linux command su, sometimes described as substitute user, super user,
or switch user, is used by a computer user to execute commands with the
privileges of another user account. When the command is used without
specifying the new user id as a command line argument, it defaults to using
the superuser account (user id 0) of the system. By default if I type su it means
super user.The computer will ask me to enter super user password.
shan@localhost:~$ su Sandy
Password:
Sandy@localhost:/home/shan$exit
When used with a hyphen (su -) it can be used to start a login shell. In this mode
users can assume the user environment of the target user:
Shan@localhost:~$ su - Sandy
Password:
Sandy@localhost:~$
The sudo command is used when a normal user does not have the rights of the
root user. For example I am a normal user and Ram my system administrator
is on leave. I want to install a package on Linux as it is very urgent for the
company. That time sudo command comes to help
The command to run the sudo command is sudo apt –get install wine
Sudo :- this give the access to the root user access for 15 minutes
apt –get install :- this command is used to install a software
wine :- this is the name of the software that we want to install
sudo su :- This command allows the normal user to be a super user.
4.6 Printing
The printing command in Linux is
1. Install
Step-1
Step-3
Step-4
Step-5
[root@localhost ~] cd /rhce
Step-6
Step-7
i= install
v =verbose
h=hash
rpm –qa
Example :-
Example :-
Source :- https://www.youtube.com/watch?v=ainF0UqbdOQ
Step-1
Step-2
step-3
step-4
[root@server1 ~] cd /media/packages
step-6
[root@server1 Packages] ls
The above command is used to list all the rpm packages in the package directory
Step-7
1. vsftpd*
2. deltarpm*
3. python-deltarpm*
Step-8
Once these three are done we can install the package createrepo
This command is basically for creating repositories. Without this package we cannot
create a
repository
Step-9
[root@server1 Packages] cd /
Step-10
[root@server1 /]#
Here we will create a folder named Repo by using the mkdir command
Step -11
step-12
Step-13
Step-14
Step-15
Packages:RPM-GPG-KEY-redhat_release
Step-16
[root@server1 media]# cd /
[root@server1 /]#
Step-17
Step-18
/*********Now to check whether all the configurations are correctly done or not
******/
Step-1
/***********************************************************/
Step-1
Step-1
yum grouplist
Q.1 What is su
A.1____________________________________________________
Q.2 What is sudo
A.2____________________________________________________
Q.3 What is the command to print a file
A.3____________________________________________________
Q.4 What is RPM and YUM
A.4____________________________________________________
4.9 Yast
Step-1
Step-2
Step-4
Step-6
Step-8
Step-2
Login as the root
root@test:/# wget http://webmin.com/download/deb/webmin-current.deb
This is going to the webmin website and download the latest version of webmin.
Step-3
Now the latest version of the webmin got downloaded
To check whether the webmin got downloaded or not type ls command
This will show a list of files and among them is webmin shown in red colour
webmin_1.550_all.deb
Step-4
In this step we will install webmin
root@test:/# dpkg - I webmin_1.550_all.deb
Step-5
keep pressing Y when it asks for confirmation
Step-6
Webmin gets installed and is on the port 10000
Step-7
Now we need to find the ip address and the command to get the ip address of
the server is ifconfig. The ip address is 10.1.50.32
Step-8
Now open the web browser
http://localhost:10000/
Step-9
In the beginning it gives a security certificate error
Step-10
Click on I understand the risks
Step-11
Step-12
Click on Get Certificate
Step-13
Click on Confirm Security Exception as shown below
Step-14
4.12 References
1. Linux Bible
2. Google.com
A.1. SSH stands for secured shell. This is used to connect to a remote server
through telnet in as secured manner so that other cannot llok into the data that is
being transmitted. Protects a authenticated user from preying eyes who have
bad intentions such as stealing user name and passwords from the network by
encryption, transmission and decryption.
A.2. X-forwarding is a feature of UNIX where in multiple X applications
located at remote machines can be run by the user.But during access with these
machines leads to transparency in the network. Data transmitted in this manner is
viable to hacking by a third person. To prevent this kind of attack SSH X
forwarding which makes the communication secure by tunneling the x protocol.
A.3. Data compression is used to reduce the size of the file or a directory.
Compressing directories help to compress the entire directory into one file so that
it can be transmitted across the network via email, taken via pen drives. data
compression is done in 4 ways
1. Compressing using zip in Linux. Zip is the most commonly used archive files
which is used in both Linux, Windows and Mac OS. Compressing using the zip
compresses till 60%.
A.1 The types of users are super user, system user, network user ,normal user,
pseudo user
A.2 The command to create a super user is useradd – u 0 username
#groupadd groupname
#userdel-r username
A.4 RPM stands for Red Hat Package Manager and YUM stands for Yellow
dog updater, modifier