Linux Presentation
Operating Systems
• A program that acts as an intermediary between
a user of a computer and the computer
hardware.
• Operating systems provide an environment in
which a user can execute programs.
• A program that controls the execution of
application programs.
LINUX vs Windows
Particular Linux Windows
Software Cost Free /Low Costly
Easy Easy Easier
Reliability More Reliable than
windows
Required further
improvement
Sofware Tools Less Numbers but freely More but Cost
Hardware driver and
user interfaces
Few Many
Security Very few attacks More vulnerable to
Viruses/Attacks
Open Source Yes No
Support Less Compare to
windows
Better Support
INTRODUCTION TO LINUX
• Open Source.
• Strong Security.
• Structured File Systems.
• Multi-User, Multi-Tasking Operating System.
LINUX FILE STRUCTURE
• In the Linux operating system, all filesystems are
contained within one directory hierarchy.
• The root directory is the top level directory, and
all its subdirectories make up the directory
hierarchy.
• This differs to other operating systems such as
MS-Windows.
• All directories are grouped under the root entry
"/".
LINUX FILE STRUCTURE...
 /bin : Important Linux commands available to the average user.
 /boot : The files necessary for the system to boot. Not all Linux distributions
use this one. Fedora does.
 /dev : All device drivers. Device drivers are the files that your Linux system
uses to talk to your hardware. For example, there's a file in the /dev directory
for your particular make and model of monitor, and all of your Linux
computer's communications with the monitor go through that file.
 /etc : System configuration files.
 /home : Every user except root gets her own folder in here, named for her
login account. So, the user who logs in with linda has the directory
/home/linda, where all of her personal files are kept.
 /lib : System libraries. Libraries are just bunches of programming code that
the programs on your system use to get things done.
LINUX FILE STRUCTURE...
 /mnt : Mount points. When you temporarily load the contents of a CD-ROM or USB
drive, you typically use a special name under /mnt. For example, many
distributions (including Fedora) come, by default, with the directory /mnt/cdrom,
which is where your CD-ROM drive's contents are made accessible.
 /root : The root user's home directory.
 /sbin : Essential commands that are only for the system administrator.
 /tmp : Temporary files and storage space. Don't put anything in here that you want
to keep. Most Linux distributions (including Fedora) are set up to delete any file
that's been in this directory longer than three days.
 /usr : Programs and data that can be shared across many systems and don't need
to be changed.
 /var : Data that changes constantly (log files that contain information about what's
happening on your system, data on its way to the printer, and so
SHELLS IN LINUX
A shell is a program that provides the traditional, text-only user
interface for Linux user interface to the Linux kernel. Its primary
function is to read commands that are typed into a console.
Types of shells:
* Bourne shell (sh) - /bin/sh
* C shell (csh) - /bin/csh
* TC shell (tcsh) - /bin/tcsh
* Korn shell (ksh) - /bin/ksh
* Bourne Again SHell (bash)- /bin/bash
Working in the File System
• Viewing the file system
• Creating files and Directories
• Removing files and Directories
• Linking Files
• Change Directory
• List of Files
• Copy or Move files and Directories
• Clear Shell Commands
• Exit, Shutdown & Reboot
Change Directory
Change the current working directory to dirName.
Ex: cd /usr/scripts
cd personal - change the directory into personal.
cd .. - Back to the previous directory
cd - switch to the previous previous directory
7
BASIC COMMANDS
 pwd - print current working directory
 ls - List information about the FILEs.
 cat - is to read and redirect the output to another file.
 nano - using nano create a file also to view and edit already
created file.
 vi - using vi create a file also to view and edit already created file.
 touch - create a simple empty file
 mkdir - Create one or more directories.
 cp - Copies files from one location to another within syste.
BASIC COMMANDS (CONTINUE..)
 rm - Allows the user to remove one or more files and and
directories.
 mv -To change the location of a file, use the mv command.
 tail - Output the last part of files
 less - lets an admin scroll through configuration and error log files
 more - Paginates the specified file so it can be read line by line
 clear - Clears your screen.
 exit - The exit causes normal program terminate.
 logout - Exit a login shell.
Managing File Permissions
● Setting File Permissions
File Permission (1)
In linux user can set file permissions, they are
read, write and execute.
If the command ls -l is given, a long list of file
names is displayed.
The first column in this list details the permissions
applying to the file.
File Permission (2)
Read = 4
Write = 2
Execute = 1
User Administration
● Create user (useradd name)
● Delete user (userdel name)
● Create Group (groupadd name)
● Delete Group (groupdel name)
For password change of any user we can use:
passwd username
File System Management in Linux
● Viewing Diskspace Usage (df or df –h)
● Viewing Space by Files (du or du –h)
● Finding Files
Filesystem Disk Space Usage
df - Disk Free
● Viewing Filesystem usage
● Viewing Available disk space.
Ex: df -h
-h - print sizes in human readable format
(e.g., 1K, 234M, 2G)
Viewing Diskspace by Files
du - Disk Usage
du (i.e., disk usage) command reports the sizes of
directory trees inclusive of all of their contents and
the sizes of individual files.
Ex: (1) du /sbin/file1
(2) du -h /home
Finding Files
grep (Grand Regular Expression)
The grep command searches one or more input
files for lines containing a match to a specified
pattern.
Ex: (1) ls /usr/scripts/ | grep payel
This searches for pattern specified.
Finding Files (2)
find
● Used to locate files on a Unix or Linux system.
● Search any set of directories you specify for files
that match the supplied search criteria.
Ex: (1) find / -name otrs
finds the file or directory named otrs
Process Management in Linux
● Viewing Running Services and Runlevel
● Viewing Running Process
● Killing a Running Process
Viewing Running Process (1)
top
Provides an outgoing look at processor activity
and update dynamically.
Listing of the process based on
● CPU usage
● Memory usage
● Runtime.
Can monitor process belongs to the specific
process id.
Viewing Running Process (2)
ps
● Enumerates the currently running processes.
● Process are identified by its id (pid).
● List the Process with its id, state, usage too.
Ex: (1) ps au
a - lists all process
u - select by effective user-id
Viewing Running Process (3)
We can combine ps with grep to find a process by
name.
Ex: (1) ps aux | grep httpd
● Lists the process whose name is httpd.
● List the Process with its id, state, usage too.
Viewing Running Process (4)
Pidof shows the process id of a running process
Ex: pidof httpd
● Lists the process id’s of httpd process
Kill a Running Process
● ps is most often used to obtain the PID.
● using pid kill/terminate a unintended process.
● if the PID of a program is found to be 1125
● combine ps with grep to find a process by name.
Ex: kill process-id
(1) Kill -9 1125
Basic Networking Commands
➔ ifconfig (to view network config)
➔ ping (same as window)
➔ netstat (gives interface statistics) (-pant will display open ports)
Shell and Remote Copy
● Secure Shell (ssh)
● Secure Copy
Secure Shell
ssh
● Allows logging into remote machine
● Provides secure encrypted communications
● Must need an identity
Ex: ssh username@ip-address
(1) ssh otc@10.163.14.100
Secure Copy
scp
● scp copies files between hosts on a network.
● use ssh for data transfer
● provides security as ssh.
● scp will ask for passwords for authentication.
Ex: scp /backup root@174.136.40.69:/backup
man
man is the system’s manual pager. Each page
argument given to man is normally the name of a
program, utility or function. The manual page
associated with each of these arguments is then
found and displayed. A section, if provided, will
direct man to look only in that section of the
manual. The default action is to search in all of
the available sections, following a pre-defined
order and to show only the first page found, even
if page exists in several sections.
PACKAGE INSTALLATION
Install packages from source
The installation procedure for software that comes
in tar.gz and tar.bz2 packages isn't always the
same, but usually it's like this:
# tar -xvzf package-name.tar.gz
# cd package-name
# ./configure
# make
# make install
PACKAGE INSTALLATION
 wget
$ wget http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs-3.1.10-
01.noarch.rpm
 rpm
rpm -ivh otrs-3.1.10-01.noarch.rpm
 yum
yum mysql
YUM REPOSITORIES
 at /etc/yum.repos.d
 enables to directly download and update packages
CPAN is also a tool for package installation
Server
Apache Webserver
OpenSSH Server
FTP Server
APACHE SERVER
●
●
●
●
●
Web server
Fully open source
Developed by Apache Software Foundation
Directives that control the configuration of Apache.
Secure Sockets Layer.
main config. file at nms is /etc/httpd/conf/httpd.conf
OpenSSH Server
Secure Shell or SSH is a network protocol that allows
data to be exchanged using a secure channel between
two networked devices.
Ex: 1. ssh user@host
2. ssh -p user@host
- connect to host on port as user.
FTP SERVER
● FTP (File Transfer Protocol) is the simplest and most
secure way to exchange files over the Internet.
FTP CONNECTION E.G
 We can get/put files from and to the nms2
 Also mget/mput for several files can be used
FTP CONNECTION E.G 2
 We can change directories by cd also.
MRTG
 Data Transfer from all SBS’s to NMS using FTP
 Data Used through scripts in /usr/scripts/
 Result of these scripts is processed through MRTG main
script at /etc/nocnms/nocnms resulting three files
 Php, html, and log files created
MRTG (CONTINUE ..)
 These created files are placed at /var/www/html/noc1/
 As in the main appache server file (i.e at
/etc/httpd/conf/httpd.conf) nms.bhaoo.com is assigned to the
directory /var/www/html/noc1
 Also demoFramesetNodes.js file at
var/www/html/noc1enables us to break into nms.bhaoo.com
directory
OTRS
Ticketing system.
Open source and well documented on web
Infinite option to optimize as per our requirement
INSTALLATION BRIEF
 #setenforce 0
 # yum install mysql-server mysql php-mysql
 #service mysqld start
 # /usr/bin/mysql_secure_installation
 #$ wget http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs-
3.1.10-01.noarch.rpm
 #rpm -ivh otrs-3.1.10-01.noarch.rpm
 # service httpd restart
Q/A SESSION
Thank you

Linux Presentation

  • 1.
  • 2.
    Operating Systems • Aprogram that acts as an intermediary between a user of a computer and the computer hardware. • Operating systems provide an environment in which a user can execute programs. • A program that controls the execution of application programs.
  • 3.
    LINUX vs Windows ParticularLinux Windows Software Cost Free /Low Costly Easy Easy Easier Reliability More Reliable than windows Required further improvement Sofware Tools Less Numbers but freely More but Cost Hardware driver and user interfaces Few Many Security Very few attacks More vulnerable to Viruses/Attacks Open Source Yes No Support Less Compare to windows Better Support
  • 4.
    INTRODUCTION TO LINUX •Open Source. • Strong Security. • Structured File Systems. • Multi-User, Multi-Tasking Operating System.
  • 5.
    LINUX FILE STRUCTURE •In the Linux operating system, all filesystems are contained within one directory hierarchy. • The root directory is the top level directory, and all its subdirectories make up the directory hierarchy. • This differs to other operating systems such as MS-Windows. • All directories are grouped under the root entry "/".
  • 7.
    LINUX FILE STRUCTURE... /bin : Important Linux commands available to the average user.  /boot : The files necessary for the system to boot. Not all Linux distributions use this one. Fedora does.  /dev : All device drivers. Device drivers are the files that your Linux system uses to talk to your hardware. For example, there's a file in the /dev directory for your particular make and model of monitor, and all of your Linux computer's communications with the monitor go through that file.  /etc : System configuration files.  /home : Every user except root gets her own folder in here, named for her login account. So, the user who logs in with linda has the directory /home/linda, where all of her personal files are kept.  /lib : System libraries. Libraries are just bunches of programming code that the programs on your system use to get things done.
  • 8.
    LINUX FILE STRUCTURE... /mnt : Mount points. When you temporarily load the contents of a CD-ROM or USB drive, you typically use a special name under /mnt. For example, many distributions (including Fedora) come, by default, with the directory /mnt/cdrom, which is where your CD-ROM drive's contents are made accessible.  /root : The root user's home directory.  /sbin : Essential commands that are only for the system administrator.  /tmp : Temporary files and storage space. Don't put anything in here that you want to keep. Most Linux distributions (including Fedora) are set up to delete any file that's been in this directory longer than three days.  /usr : Programs and data that can be shared across many systems and don't need to be changed.  /var : Data that changes constantly (log files that contain information about what's happening on your system, data on its way to the printer, and so
  • 9.
    SHELLS IN LINUX Ashell is a program that provides the traditional, text-only user interface for Linux user interface to the Linux kernel. Its primary function is to read commands that are typed into a console. Types of shells: * Bourne shell (sh) - /bin/sh * C shell (csh) - /bin/csh * TC shell (tcsh) - /bin/tcsh * Korn shell (ksh) - /bin/ksh * Bourne Again SHell (bash)- /bin/bash
  • 10.
    Working in theFile System • Viewing the file system • Creating files and Directories • Removing files and Directories • Linking Files • Change Directory • List of Files • Copy or Move files and Directories • Clear Shell Commands • Exit, Shutdown & Reboot
  • 11.
    Change Directory Change thecurrent working directory to dirName. Ex: cd /usr/scripts cd personal - change the directory into personal. cd .. - Back to the previous directory cd - switch to the previous previous directory 7
  • 12.
    BASIC COMMANDS  pwd- print current working directory  ls - List information about the FILEs.  cat - is to read and redirect the output to another file.  nano - using nano create a file also to view and edit already created file.  vi - using vi create a file also to view and edit already created file.  touch - create a simple empty file  mkdir - Create one or more directories.  cp - Copies files from one location to another within syste.
  • 13.
    BASIC COMMANDS (CONTINUE..) rm - Allows the user to remove one or more files and and directories.  mv -To change the location of a file, use the mv command.  tail - Output the last part of files  less - lets an admin scroll through configuration and error log files  more - Paginates the specified file so it can be read line by line  clear - Clears your screen.  exit - The exit causes normal program terminate.  logout - Exit a login shell.
  • 14.
    Managing File Permissions ●Setting File Permissions
  • 15.
    File Permission (1) Inlinux user can set file permissions, they are read, write and execute. If the command ls -l is given, a long list of file names is displayed. The first column in this list details the permissions applying to the file.
  • 16.
    File Permission (2) Read= 4 Write = 2 Execute = 1
  • 17.
    User Administration ● Createuser (useradd name) ● Delete user (userdel name) ● Create Group (groupadd name) ● Delete Group (groupdel name) For password change of any user we can use: passwd username
  • 18.
    File System Managementin Linux ● Viewing Diskspace Usage (df or df –h) ● Viewing Space by Files (du or du –h) ● Finding Files
  • 19.
    Filesystem Disk SpaceUsage df - Disk Free ● Viewing Filesystem usage ● Viewing Available disk space. Ex: df -h -h - print sizes in human readable format (e.g., 1K, 234M, 2G)
  • 20.
    Viewing Diskspace byFiles du - Disk Usage du (i.e., disk usage) command reports the sizes of directory trees inclusive of all of their contents and the sizes of individual files. Ex: (1) du /sbin/file1 (2) du -h /home
  • 21.
    Finding Files grep (GrandRegular Expression) The grep command searches one or more input files for lines containing a match to a specified pattern. Ex: (1) ls /usr/scripts/ | grep payel This searches for pattern specified.
  • 22.
    Finding Files (2) find ●Used to locate files on a Unix or Linux system. ● Search any set of directories you specify for files that match the supplied search criteria. Ex: (1) find / -name otrs finds the file or directory named otrs
  • 23.
    Process Management inLinux ● Viewing Running Services and Runlevel ● Viewing Running Process ● Killing a Running Process
  • 24.
    Viewing Running Process(1) top Provides an outgoing look at processor activity and update dynamically. Listing of the process based on ● CPU usage ● Memory usage ● Runtime. Can monitor process belongs to the specific process id.
  • 25.
    Viewing Running Process(2) ps ● Enumerates the currently running processes. ● Process are identified by its id (pid). ● List the Process with its id, state, usage too. Ex: (1) ps au a - lists all process u - select by effective user-id
  • 26.
    Viewing Running Process(3) We can combine ps with grep to find a process by name. Ex: (1) ps aux | grep httpd ● Lists the process whose name is httpd. ● List the Process with its id, state, usage too.
  • 27.
    Viewing Running Process(4) Pidof shows the process id of a running process Ex: pidof httpd ● Lists the process id’s of httpd process
  • 28.
    Kill a RunningProcess ● ps is most often used to obtain the PID. ● using pid kill/terminate a unintended process. ● if the PID of a program is found to be 1125 ● combine ps with grep to find a process by name. Ex: kill process-id (1) Kill -9 1125
  • 29.
    Basic Networking Commands ➔ifconfig (to view network config) ➔ ping (same as window) ➔ netstat (gives interface statistics) (-pant will display open ports)
  • 30.
    Shell and RemoteCopy ● Secure Shell (ssh) ● Secure Copy
  • 31.
    Secure Shell ssh ● Allowslogging into remote machine ● Provides secure encrypted communications ● Must need an identity Ex: ssh username@ip-address (1) ssh otc@10.163.14.100
  • 32.
    Secure Copy scp ● scpcopies files between hosts on a network. ● use ssh for data transfer ● provides security as ssh. ● scp will ask for passwords for authentication. Ex: scp /backup root@174.136.40.69:/backup
  • 33.
    man man is thesystem’s manual pager. Each page argument given to man is normally the name of a program, utility or function. The manual page associated with each of these arguments is then found and displayed. A section, if provided, will direct man to look only in that section of the manual. The default action is to search in all of the available sections, following a pre-defined order and to show only the first page found, even if page exists in several sections.
  • 34.
    PACKAGE INSTALLATION Install packagesfrom source The installation procedure for software that comes in tar.gz and tar.bz2 packages isn't always the same, but usually it's like this: # tar -xvzf package-name.tar.gz # cd package-name # ./configure # make # make install
  • 35.
    PACKAGE INSTALLATION  wget $wget http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs-3.1.10- 01.noarch.rpm  rpm rpm -ivh otrs-3.1.10-01.noarch.rpm  yum yum mysql
  • 36.
    YUM REPOSITORIES  at/etc/yum.repos.d  enables to directly download and update packages CPAN is also a tool for package installation
  • 37.
  • 38.
    APACHE SERVER ● ● ● ● ● Web server Fullyopen source Developed by Apache Software Foundation Directives that control the configuration of Apache. Secure Sockets Layer. main config. file at nms is /etc/httpd/conf/httpd.conf
  • 39.
    OpenSSH Server Secure Shellor SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Ex: 1. ssh user@host 2. ssh -p user@host - connect to host on port as user.
  • 40.
    FTP SERVER ● FTP(File Transfer Protocol) is the simplest and most secure way to exchange files over the Internet.
  • 41.
    FTP CONNECTION E.G We can get/put files from and to the nms2  Also mget/mput for several files can be used
  • 42.
    FTP CONNECTION E.G2  We can change directories by cd also.
  • 43.
    MRTG  Data Transferfrom all SBS’s to NMS using FTP  Data Used through scripts in /usr/scripts/  Result of these scripts is processed through MRTG main script at /etc/nocnms/nocnms resulting three files  Php, html, and log files created
  • 44.
    MRTG (CONTINUE ..) These created files are placed at /var/www/html/noc1/  As in the main appache server file (i.e at /etc/httpd/conf/httpd.conf) nms.bhaoo.com is assigned to the directory /var/www/html/noc1  Also demoFramesetNodes.js file at var/www/html/noc1enables us to break into nms.bhaoo.com directory
  • 45.
    OTRS Ticketing system. Open sourceand well documented on web Infinite option to optimize as per our requirement
  • 46.
    INSTALLATION BRIEF  #setenforce0  # yum install mysql-server mysql php-mysql  #service mysqld start  # /usr/bin/mysql_secure_installation  #$ wget http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs- 3.1.10-01.noarch.rpm  #rpm -ivh otrs-3.1.10-01.noarch.rpm  # service httpd restart
  • 47.
  • 48.