Happy 25th
birthday Linux !
(Aug 25, 2015)
Red Hat - Linux Essentials
ROHIT SANSIYA
MANIT Bhopal
rsansiya@ieee.org
Rohit Sansiya
Outline
•What is Linux ?
•Linux scenarios – Weaknesses
•Linux Issues – Security
•Linux features – Basic Commands
•Discussion
Outline
•What is Linux ?
•Linux scenarios – Weaknesses
•Linux Issues – Security
•Linux features – Basic Commands
•Discussion
Linux
•Natural: Ease of-use
•Artificial: Cross-platform portability
-(Software)
What is Linux?
• Linux is Enterprise-targeted operating system as well as
accomplish common command-line tasks and desktop
productivity roles (typically the software)
Red-Hat definition
• A comprehensive software delivery,
system management, and monitoring
framework included with all Red Hat
Enterprise Linux subscriptions. Red
Hat sponsored open source project, An
open, community-supported proving
ground for technologies which may be
used in upcoming enterprise products.
Linux Enabling Technologies
Other Red Hat Supported Software
• Global Filesystem
• Directory Server
• Certificate Server
• Red Hat Application Stack
• JBoss Middleware Application Suite
Open Source
Software and source code available to all. The freedom
to distribute software and source code.
What do you expect Linux to do?
• Provide distribution
1.Red Hat Enterprise Linux
2.The Fedora Project
Everything is a file (including hardware) ...
Connected with Linux
Outline
•What is Linux ?
•Linux scenarios – Weaknesses
•Linux Issues – Security
•Linux features – Basic Commands
•Discussion
Linux Scenarios
1984: The GNU Project and the Free Software Foundation
• Creates open source version of UNIX utilities
• Creates the General Public License (GPL)
1991: Linus Torvalds
• Creates open source, UNIX-like kernel, released under
the GPL
Today:
• Linux kernel + GNU utilities = complete, open source
Linux principals
• Small, single-purpose programs
• Ability to chain programs together to perform complex tasks
• Avoid captive user interfaces
• Configuration data stored in text
Where is Security Challenge?
Recap
Outline
•What is Linux ?
•Linux scenarios – Weaknesses
•Linux Issues – Security
•Linux features – Basic Commands
•Discussion
Linux Scenarios
1984: The GNU Project and the Free Software Foundation
• Creates open source version of UNIX utilities
• Creates the General Public License (GPL)
1991: Linus Torvalds
• Creates open source, UNIX-like kernel, released under
the GPL
Today:
• Linux kernel + GNU utilities = complete, open source
Linux principals
• Small, single-purpose programs
• Ability to chain programs together to perform complex tasks
• Avoid captive user interfaces
• Configuration data stored in text
Explain the Linux security model
Linux File Security
• Every file is owned by a UID and a GID
• Every process runs as a UID and one or more GIDs
• If UID matches, user permissions apply otherwise if GID matches
group permissions apply
• If neither match, other permissions apply
Requirement of security
Four symbols are used when require permissions:
r: permission to read a file or list a directory's contents
w: permission to write to a file or create and remove files from a directory
x: permission to execute a program or change into a directory and do a
long listing of the directory
Exception rule
-: no permission (in place of the r, w, or x)
File permissions may be viewed using ls -l
$ ls -l /bin/login
-rwxr-xr-x 1 root root 19080 Apr 1 18:26 /bin/login
Outline
•What is Linux ?
•Linux scenarios – Weaknesses
•Linux Issues – Security
•Linux features – Basic Commands
•Discussion
Basic - Commands
Starting the X server
• The X server must be pre - configured by the system administrator.
• The X server appears on Ctrl-Alt-F7
a. On some systems, the X server starts automatically at boot time.
b. Otherwise, if systems come up in virtual consoles, users must start the X
server manually
Changing Your Password
To change your password using GNOME, navigate to:
System->Preferences->About Me and then click Password.
Or ….
To change your password from a terminal:
passwd
Editing text files
The nano editor
● Easy to learn, easy to use
Other editors:
• gedit, a simple graphical editor
• vim, an advanced, full feature editor
Outline
•What is Linux ?
•Linux scenarios – Weaknesses
•Linux Issues – Security
•Linux features – Basic Commands
•Discussion
Running Commands and Getting Help
Simple commands
Running Commands
• Commands have the following syntax
command options arguments
• Arguments are file names or other data needed by the command
Some Simple Commands
• date - display date and time
• cal - display calendar
Linux Firewall
• System-> Administration->Security Level and Firewall
• Selectively allow incoming connections by port
• Specify interfaces to trust all traffic from
• More advanced configuration possible with other tools
Getting Help
Standards Again ....
Don't try to memorize everything!
• Levels of help
• whatis
• command --help
??????
The man Command
• Provides documentation for commands
• man [<chapter>] <command>
• Pages are grouped into "chapters"
• While viewing a man page
• Navigate with arrows, PgUp, PgDn
• /text searches for text
• n/N goes to next/previous match
• q quits
Linux File Hierarchy Concepts
• Files and directories are organized into a single-rooted inverted tree
structure.
• Filesystem begins at the root directory, represented by a lone '/'
character.
• Names are case-sensitive.
• Paths are delimited by /
Some Important Directories
• Home Directories: /root,/home/username
• User Executables: /bin, /usr/bin, /usr/local/bin
• System Executables: /sbin, /usr/sbin, /usr/local/sbin
• Other Mountpoints: /media, /mnt
• Configuration: /etc
• Kernels and Bootloader: /boot
• Server Data: /var, /srv
• Shared Libraries: /lib, /usr/lib, /usr/local/lib
Current Working Directory
• Each shell and system process has a “current working directory”
pwd: Displays the absolute path to the shell's cwd
Changing Directories
• cd changes directories
• To an absolute or relative path:
• cd /home/...........
• To a directory one level up: cd ..
• To your home directory: cd
• To your previous working directory: cd -
Listing Directory Contents
• Lists the contents of the current directory or a specified directory
• Usage:
ls [options] [files_or_dirs]
Example:
• ls -a (include hidden files)
• ls -l (display extra information)
Copying Files and Directories
• cp - copy files and directories
• Usage:
cp [options] file destination
or …
cp [options] file1 file2 dest.
Moving and Renaming Files and Directories
• mv - move and/or rename files and directories
• Usage:
mv [options] file destination
or …
mv [options] file1 file2 destination
Creating and Removing Files
• touch - create empty files or update file timestamps
• rm - remove files
• Usage:
rm [options] <file>...
• mkdir creates directories
• rmdir removes empty directories
• rm -rf remove directory
Text Processing Tools
• Use tools for extracting, analyzing and manipulating text data
Tools for Extracting Text
• File Contents: less and cat
• File Excerpts: head and tail
Extracting by keyword itself
• grep
let's start ...
Viewing File Contents “less and cat”
General Syntax
cat [OPTION] [FILE]...
1. Display Contents of File
# cat /etc/passwd
2. View Contents of Multiple Files in terminal
# cat test test1
Hello everybody
Hi world,
3. Create a File with Cat Command
# cat >test2 (The text will be written in test2 file. You can see content of file with following cat command.)
# cat test2
hello everyone, how do you do?
4. Use Cat Command with More & Less Options
# cat song.txt | more
# cat song.txt | less
5. Display Multiple Files at Once
# cat test; cat test1; cat test2
This is test file
This is test1 file.
This is test2 file.
Viewing File Contents “head and tail”
• tail command syntax
tail [OPTION]... [FILE]... (tail /path/to/file)
Use -n to change number of lines displayed
when you want to view a certain part at the beginning or at the end of a file,
which prints the last few number of lines (10 lines by default) of a certain
file.
Head command
Head command will obviously on the contrary to tail, it will print the first
10 lines of the file.
head command syntax
head [OPTION]... [FILE]...
As mention earlier print first 10 lines.
# head /etc/passwd
What next ?
Use -n to change number of lines displayed
# head -n <number of lines preceeded with "-"> /path/to/file
# head -n 2 /etc/passwd
Extracting Text by Keyword grep
Prints lines of files or STDIN where a pattern is matched
$ grep 'john' /etc/passwd
$ date --help | grep year
Use -i to search case-insensitively
Use -n to print line numbers of matches
grep syntax
grep [OPTIONS] PATTERN [FILE...]
Thanks …
Rohit Sansiya
rsansiya@ieee.org

Linux: Everyting-as-a-service

  • 1.
    Happy 25th birthday Linux! (Aug 25, 2015)
  • 2.
    Red Hat -Linux Essentials ROHIT SANSIYA MANIT Bhopal rsansiya@ieee.org Rohit Sansiya
  • 3.
    Outline •What is Linux? •Linux scenarios – Weaknesses •Linux Issues – Security •Linux features – Basic Commands •Discussion
  • 4.
    Outline •What is Linux? •Linux scenarios – Weaknesses •Linux Issues – Security •Linux features – Basic Commands •Discussion
  • 5.
    Linux •Natural: Ease of-use •Artificial:Cross-platform portability -(Software)
  • 6.
    What is Linux? •Linux is Enterprise-targeted operating system as well as accomplish common command-line tasks and desktop productivity roles (typically the software)
  • 7.
    Red-Hat definition • Acomprehensive software delivery, system management, and monitoring framework included with all Red Hat Enterprise Linux subscriptions. Red Hat sponsored open source project, An open, community-supported proving ground for technologies which may be used in upcoming enterprise products.
  • 8.
  • 9.
    Other Red HatSupported Software • Global Filesystem • Directory Server • Certificate Server • Red Hat Application Stack • JBoss Middleware Application Suite
  • 10.
    Open Source Software andsource code available to all. The freedom to distribute software and source code.
  • 11.
    What do youexpect Linux to do? • Provide distribution 1.Red Hat Enterprise Linux 2.The Fedora Project Everything is a file (including hardware) ...
  • 12.
  • 13.
    Outline •What is Linux? •Linux scenarios – Weaknesses •Linux Issues – Security •Linux features – Basic Commands •Discussion
  • 14.
    Linux Scenarios 1984: TheGNU Project and the Free Software Foundation • Creates open source version of UNIX utilities • Creates the General Public License (GPL) 1991: Linus Torvalds • Creates open source, UNIX-like kernel, released under the GPL Today: • Linux kernel + GNU utilities = complete, open source
  • 15.
    Linux principals • Small,single-purpose programs • Ability to chain programs together to perform complex tasks • Avoid captive user interfaces • Configuration data stored in text
  • 16.
    Where is SecurityChallenge? Recap
  • 17.
    Outline •What is Linux? •Linux scenarios – Weaknesses •Linux Issues – Security •Linux features – Basic Commands •Discussion
  • 18.
    Linux Scenarios 1984: TheGNU Project and the Free Software Foundation • Creates open source version of UNIX utilities • Creates the General Public License (GPL) 1991: Linus Torvalds • Creates open source, UNIX-like kernel, released under the GPL Today: • Linux kernel + GNU utilities = complete, open source
  • 19.
    Linux principals • Small,single-purpose programs • Ability to chain programs together to perform complex tasks • Avoid captive user interfaces • Configuration data stored in text
  • 20.
    Explain the Linuxsecurity model Linux File Security • Every file is owned by a UID and a GID • Every process runs as a UID and one or more GIDs • If UID matches, user permissions apply otherwise if GID matches group permissions apply • If neither match, other permissions apply
  • 21.
    Requirement of security Foursymbols are used when require permissions: r: permission to read a file or list a directory's contents w: permission to write to a file or create and remove files from a directory x: permission to execute a program or change into a directory and do a long listing of the directory Exception rule -: no permission (in place of the r, w, or x) File permissions may be viewed using ls -l $ ls -l /bin/login -rwxr-xr-x 1 root root 19080 Apr 1 18:26 /bin/login
  • 22.
    Outline •What is Linux? •Linux scenarios – Weaknesses •Linux Issues – Security •Linux features – Basic Commands •Discussion
  • 23.
  • 24.
    Starting the Xserver • The X server must be pre - configured by the system administrator. • The X server appears on Ctrl-Alt-F7 a. On some systems, the X server starts automatically at boot time. b. Otherwise, if systems come up in virtual consoles, users must start the X server manually
  • 25.
    Changing Your Password Tochange your password using GNOME, navigate to: System->Preferences->About Me and then click Password. Or …. To change your password from a terminal: passwd
  • 26.
    Editing text files Thenano editor ● Easy to learn, easy to use Other editors: • gedit, a simple graphical editor • vim, an advanced, full feature editor
  • 27.
    Outline •What is Linux? •Linux scenarios – Weaknesses •Linux Issues – Security •Linux features – Basic Commands •Discussion
  • 28.
  • 29.
    Simple commands Running Commands •Commands have the following syntax command options arguments • Arguments are file names or other data needed by the command Some Simple Commands • date - display date and time • cal - display calendar
  • 30.
    Linux Firewall • System->Administration->Security Level and Firewall • Selectively allow incoming connections by port • Specify interfaces to trust all traffic from • More advanced configuration possible with other tools
  • 31.
  • 32.
    Standards Again .... Don'ttry to memorize everything! • Levels of help • whatis • command --help ??????
  • 33.
    The man Command •Provides documentation for commands • man [<chapter>] <command> • Pages are grouped into "chapters" • While viewing a man page • Navigate with arrows, PgUp, PgDn • /text searches for text • n/N goes to next/previous match • q quits
  • 34.
    Linux File HierarchyConcepts • Files and directories are organized into a single-rooted inverted tree structure. • Filesystem begins at the root directory, represented by a lone '/' character. • Names are case-sensitive. • Paths are delimited by /
  • 35.
    Some Important Directories •Home Directories: /root,/home/username • User Executables: /bin, /usr/bin, /usr/local/bin • System Executables: /sbin, /usr/sbin, /usr/local/sbin • Other Mountpoints: /media, /mnt • Configuration: /etc • Kernels and Bootloader: /boot • Server Data: /var, /srv • Shared Libraries: /lib, /usr/lib, /usr/local/lib
  • 36.
    Current Working Directory •Each shell and system process has a “current working directory” pwd: Displays the absolute path to the shell's cwd Changing Directories • cd changes directories • To an absolute or relative path: • cd /home/........... • To a directory one level up: cd .. • To your home directory: cd • To your previous working directory: cd -
  • 37.
    Listing Directory Contents •Lists the contents of the current directory or a specified directory • Usage: ls [options] [files_or_dirs] Example: • ls -a (include hidden files) • ls -l (display extra information)
  • 38.
    Copying Files andDirectories • cp - copy files and directories • Usage: cp [options] file destination or … cp [options] file1 file2 dest. Moving and Renaming Files and Directories • mv - move and/or rename files and directories • Usage: mv [options] file destination or … mv [options] file1 file2 destination
  • 39.
    Creating and RemovingFiles • touch - create empty files or update file timestamps • rm - remove files • Usage: rm [options] <file>... • mkdir creates directories • rmdir removes empty directories • rm -rf remove directory
  • 40.
    Text Processing Tools •Use tools for extracting, analyzing and manipulating text data Tools for Extracting Text • File Contents: less and cat • File Excerpts: head and tail Extracting by keyword itself • grep let's start ...
  • 41.
    Viewing File Contents“less and cat” General Syntax cat [OPTION] [FILE]... 1. Display Contents of File # cat /etc/passwd 2. View Contents of Multiple Files in terminal # cat test test1 Hello everybody Hi world,
  • 42.
    3. Create aFile with Cat Command # cat >test2 (The text will be written in test2 file. You can see content of file with following cat command.) # cat test2 hello everyone, how do you do? 4. Use Cat Command with More & Less Options # cat song.txt | more # cat song.txt | less 5. Display Multiple Files at Once # cat test; cat test1; cat test2 This is test file This is test1 file. This is test2 file.
  • 43.
    Viewing File Contents“head and tail” • tail command syntax tail [OPTION]... [FILE]... (tail /path/to/file) Use -n to change number of lines displayed when you want to view a certain part at the beginning or at the end of a file, which prints the last few number of lines (10 lines by default) of a certain file. Head command Head command will obviously on the contrary to tail, it will print the first 10 lines of the file.
  • 44.
    head command syntax head[OPTION]... [FILE]... As mention earlier print first 10 lines. # head /etc/passwd What next ? Use -n to change number of lines displayed # head -n <number of lines preceeded with "-"> /path/to/file # head -n 2 /etc/passwd
  • 45.
    Extracting Text byKeyword grep Prints lines of files or STDIN where a pattern is matched $ grep 'john' /etc/passwd $ date --help | grep year Use -i to search case-insensitively Use -n to print line numbers of matches grep syntax grep [OPTIONS] PATTERN [FILE...]
  • 46.