Getting Started With Comptia Linux+ Training Course
Getting Started With Comptia Linux+ Training Course
Getting Started With Comptia Linux+ Training Course
CompTIA Linux+
Training Course
In This Lesson:
Who is Your Instructor?
What We Will Be Doing
How to Use This Course
1
Getting Started with CompTIA Linux+ Training Course
CompTIA Linux+ Training
2
Lab Setup
In This Lesson:
The Lab Environment
VirtualBox Setup
Creating a Linux Virtual Machine
3
Getting Started with CompTIA Linux+ Training
CompTIA Linux+ Training
VirtualBox Setup
• Oracle VirtualBox
– Download from Oracle: www.virtualbox.org
• VirtualBox OSE
– Download from Oracle: www.virtualbox.org
– Install with Linux package manager
• Guest additions
– More seamless mouse pointer integration
– Video support (screen resizing)
– File sharing
– Shared clipboard
4
Getting Started with CompTIA Linux+ Training
CompTIA Linux+ Training
What We Covered
The Lab Environment
VirtualBox Setup
Installing a Linux Virtual Machine
5
The Course Scenario
CompTIA Linux+ Training
In This Lesson:
The Globomantics Scenario
The Globomantics Network
Road Warriors
6
Linux Hardware
Settings
In This Lesson:
IRQs
I/O Addresses
DMA Addresses
Boot Disks and Geometry
Coldplug vs. Hotplug Devices
Expansion Card Configuration
Kernel Modules
Configuring USB Devices
Configuring Hard Disks
IRQs
• What is an IRQ
– An interrupt request sent to the CPU
• How does the system use IRQs?
– Keyboard control
– Timer control
– Open for new hardware additions
• Displaying IRQs in use
– /proc virtual filesystem
– cat /proc/interrupts
7
Linux Hardware Settings
CompTIA Linux+ Training
IRQs (cont’d)
IRQ Typical Use Notes
IRQs (cont’d)
9 Open interrupt
10 Open interrupt
11 Open interrupt
12 PS/2 mouse
IRQs (cont’d)
8
Linux Hardware Settings
CompTIA Linux+ Training
I/O Addresses
• I/O (Input/Output) addresses - Unique memory locations reserved
for communications between CPU and hardware devices
• Typical Linux Device Matrix
Linux Device Typical IRQ I/O Address
/dev/ttyS0 4 0x03f8
/dev/ttyS1 3 0x02f8
/dev/ttyS2 4 0x03e8
/dev/ttyS3 3 0x02e8
/dev/lp0 7 0x0378-0x037f
/dev/lp1 5 0x03f0-0x027f
/dev/fd0 6 0x03f0-0x03f7
/dev/fd1 6 0x0370-0x0377
DMA Addresses
• Direct memory addressing
– Alternative method of communicating with I/O ports
– No CPU intervention
– Performance improvements
• Display DMAs in use on your system
– cat /proc/dma
9
Linux Hardware Settings
CompTIA Linux+ Training
10
Linux Hardware Settings
CompTIA Linux+ Training
Option Result
–v Increases verbosity, or depth of output; may also
include –vv or –vvv options
–n Displays results in number codes rather than
manufacturer or device name
–nn Displays manufacturer and device name, along with
numeric code
–x An advanced option that displays PCI configuration
space as a hexadecimal dump; may be tripled (–xxx) or
quadrupled (–xxxx)
Option Result
–b Shows IRQ's and other data as
seen by devices instead of the
kernel
–t Displays a tree view showing
device relationships
–s [[[[domain]:]bus]:][slot][.[func]] Displays only devices that
match the listed specification.
Useful for limiting output
–d [vendor]:[device] Shows data for the specified
device
11
Linux Hardware Settings
CompTIA Linux+ Training
Kernel Modules
• Linux drivers
– /lib/modules
• Determining the current configuration
– lsmod
• Loading modules
– insmod
• insmod /lib/modules/2.6.33/kernel/drivers/vhost/vhost.ko
12
Linux Hardware Settings
CompTIA Linux+ Training
13
Linux Hardware Settings
CompTIA Linux+ Training
What We Covered
IRQs
I/O Addresses
DMA Addresses
Boot Disks and Geometry
Coldplug vs. Hotplug Devices
Expansion Card Configuration
Kernel Modules
Configuring USB Devices
Configuring Hard Disks
14
The Boot Process
CompTIA Linux+ Training
In This Lesson:
The BIOS
The Boot Loader
The Boot Sequence
The Boot Process and the Kernel
Interpreting Log Files
The BIOS
• Basic Input Output System (BIOS) – located on your computer‟s
motherboard in ROM or flash memory
– Power on self test (POST), which tests system components
– Initializes hardware
– Loads the boot loader
– Hands off control to the boot loader
• BIOS functionality
– The role in the boot process
• BIOS configuration
– Function key access
• F1 or F2
– Save, ext and reboot
• F10
15
The Boot Process
CompTIA Linux+ Training
16
The Boot Process
CompTIA Linux+ Training
What We Covered
The BIOS
The Boot Loader
The Boot Sequence
The Boot Process and the Kernel
Interpreting Log Files
Runlevels, System
Shutdown and Reboot
In This Lesson:
Defining Runlevels
Runlevel Services
Managing Runlevels
Checking and Changing Runlevels
Managing Runlevels - Utilities
17
Runlevels, System Shutdown and Reboot
CompTIA Linux+ Training
Defining Runlevels
• What is a runlevel?
– An alternative mode of operation
– 7 runlevels, 0-6
Runlevel Description
0 Halts the system; since it switches
runlevel to another mode, this is a
transitional mode
1, s, or S Runs in single-user mode; services vary,
used primarily for maintenance
2 Debian: runs in multi-user mode with X
and a graphical login; undefined in other
distributions
Runlevel Description
3 Red Hat, Mandriva, Fedora and other
distributions, runs in multi-user mode with
command line interface
4 Unused; available for customization
5 Red Hat, Mandriva, Fedora and others,
same as runlevel 3 with graphical interface
6 Reboots the system
Runlevel Services
• Defining services
– /etc/inittab - defines what programs will run in certain runlevel
• identifier:runlevel:action:process
– id (identifier) –1-4 characters that identifies function
– runlevel – list of runlevels for which this entry applies
– action – action to be taken
– process – tells Linux which process to run for this entry
• System V or SysV startup scripts - run all scripts that are
associated with the current runlevel
– /etc/rd.d/rc?.d, /etc/init.d/rc?.d, or /etc/rc?.d
– Symbolic links stored in /etc/rc.d, /etc/init.d, or /etc/rc.d/init.d
– Starting scripts manually with start command
• /etc/init.d/sshd start
18
Runlevels, System Shutdown and Reboot
CompTIA Linux+ Training
Managing Runlevels
• Configuring default runlevels
– Change 2nd value in /etc/inittab file command
• Specify which system processes are automatically started
• Modify runlevel from the command prompt
• Management utilities
– chkconfig
– ntsysv
19
Runlevels, System Shutdown and Reboot
CompTIA Linux+ Training
What We Covered
Defining Runlevels
Runlevel Services
Managing Runlevels
Checking and Changing Runlevels
Managing Runlevels - Utilities
Linux Installation
Planning
20
Linux Installation Planning
CompTIA Linux+ Training
In This Lesson:
Hard Disk Layout
LILO Boot Manager Configuration
GRUB Boot Manager Configuration
Shared Libraries
21
Linux Installation Planning
CompTIA Linux+ Training
22
Linux Installation Planning
CompTIA Linux+ Training
23
Linux Installation Planning
CompTIA Linux+ Training
24
Linux Installation Planning
CompTIA Linux+ Training
Shared Libraries
• What is a library and why should it be shared?
– Gimp Tool Kit (GTK+)
• Library file locations (/etc/ld.so.conf)
• Path settings
– LD_LIBRARY_PATH
• Command syntax
– export LD_LIBRARY_PATH=[path]
• Library management
– ldd -v
25
Linux Installation Planning
CompTIA Linux+ Training
What We Covered
Hard Disk Layout
LILO Boot Manager Configuration
GRUB Boot Manager Configuration
Shared Libraries
Package Management
26
Package Management
CompTIA Linux+ Training
In This Lesson:
The Role of a Package Manager
Debian Package Management
Apt Package Management
Debian Configuration &
Troubleshooting
RPM Package Management
Yum Package Management
RPM & Yum Configuration &
Troubleshooting
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
27
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
Options Description
-i or --install Installs a package
--configure Reconfigures installed package, runs
post-install script to set site-specific
options
-r or --remove Removes package, leaves config files
-P or --purge Removes package and config files
-p or --print-avail Displays info about installed package
Package Management
CompTIA Linux+ Training
28
Package Management
CompTIA Linux+ Training
Command Description
update Gets updated package info from
/etc/apt/sources.list
upgrade Upgrades all installed packages
dselect-upgrade Performs any undone changes in
package status following dselect
dist-upgrade Upgrades with conflict resolution
install Installs a package by package
name
remove Removes package by package
name
Package Management
CompTIA Linux+ Training
Command Description
source Gets newest source package file by
package filename:
/etc/apt/sources.list
check Checks consistency & broken
packages
clean Clears info about retrieved
packages from Debian database
autoclean Like clean, but removes info about
packages that can‟t be downloaded
Package Management
CompTIA Linux+ Training
29
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
30
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
Operation Description
-i Installs package - can‟t already exist
-U Installs new package or upgrades existing
-F or --freshen Upgrades only if an earlier version exists
-q Queries – installed? Packages it contains
Package Management
CompTIA Linux+ Training
Operation Description
-V or --verify Verifies package – present & unchanged
-e Uninstalls package
-b Builds binary, given source & config - rpmbuild
--rebuild Builds binary, given source RPM file - rpmbuild
--rebuilddb Rebuilds the RPM db to fix errors
31
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
32
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
Package Management
CompTIA Linux+ Training
33
Package Management
CompTIA Linux+ Training
What We Covered
The Role of a Package Manager
Debian Package Management
Apt Package Management
Debian Configuration & Troubleshooting
RPM Package Management
Yum Package Management
RPM & Yum Configuration & Troubleshooting
In This Lesson:
The Linux Command Line
Text Streams & Filters
File Management
Process Management
Searching & Regular Expressions
The Vi Editor
34
GNU and Unix Commands
CompTIA Linux+ Training
35
GNU and Unix Commands
CompTIA Linux+ Training
36
Operator Effect
37
GNU and Unix Commands
CompTIA Linux+ Training
nl Line numbering
• –b style or --body-numbering=style
• –h or --header-numbering=style
• –d=code or --section-delimiter=code
• –p or --no-renumber
• –n format or --number-format=format (ln, rn, rz)
• T - non blank lines
• a - all lines
• n - no lines
• pREGEXP
38
GNU and Unix Commands
CompTIA Linux+ Training
File Management
• The rules
– Case sensitive
– Filenames - omit *, ?, /, \
– Brackets [] match any character in a set
– dot and double dot - ., .. - current and parent directories
• Commands
– List - ls [options] [files]
– Copy - cp [options] source destination
– Move - mv [options] source destination
– Delete - rm [options] files
– Modify timestamp (or create file) - touch [options] files
– Create directory - mkdir [options] directory-name(s)
– Delete directory - rmdir [options] directory-names(s)
39
GNU and Unix Commands
CompTIA Linux+ Training
40
CPIO Option Abbreviation Purpose
--pattern-file=filename E filename Uses contents of filename as
list of files to be extracted in
copy-in mode
--file=filename F filename Uses filename as cpio archive
file
--format=format H format Uses specified format (bin, crc,
tar)
N/A I filename Uses filename instead of
standard output
--list t Displays table of contents for
input
--unconditional u Replaces files without
verification
--verbose v Displays files as added or
extracted
Process Management
• uname option
Option Purpose
-n or --nodename Displays system‟s node name (hostname)
-s or --kernel-name Displays kernel name
-v or --kernel-version Displays kernel version (build date & time)
-r or --kernel-release Displays kernel version number
-m or --machine Displays info about your machine
-p or --processor Displays info about CPU
-i or --hardware-platform Hardware platform (usually unknown)
-o or --operating system Displays OS name
-a or --all Displays all information
41
GNU and Unix Commands
CompTIA Linux+ Training
Option Purpose
-d delay Delays between output updates
-p pid Monitors specific processes (use ps)
-n iter Displays (n) no. updates and quit
-b Batch mode - file instead of screen
h and ? Help
k Kills process (use ps)
q Quits
Option Purpose
r Changes priority (pid & new number)
s Changes display update rate in seconds
P Sorts by CPU use (default)
M Sorts by memory use
42
GNU and Unix Commands
CompTIA Linux+ Training
43
GNU and Unix Commands
CompTIA Linux+ Training
The Vi Editor
• First editor written for Unix
• Small and nimble, perfect for use on an emergency boot disk, or
as a full fledged web development tool
• 3 Modes
– Command - accepts (usually) single letter commands
– Ex or (:) - file manipulation, saving & outside programs
– Insert (R) - enter text
– Esc - exits & returns to command
44
GNU and Unix Commands
CompTIA Linux+ Training
What We Covered
The Linux Command Line
Text Streams & Filters
File Management
Process Management
Searching & Regular Expressions
The Vi Editor
Linux Filesystems
Linux Filesystems
CompTIA Linux+ Training
In This Lesson:
Creating Partitions and Filesystems
Tuning Filesystems
Debugging
Mounting and Unmounting Filesystems
45
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
46
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
47
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
48
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
Linux Filesystems
CompTIA Linux+ Training
What We Covered
Creating Partitions and Filesystems
Tuning Filesystems
Debugging
Mounting and Unmounting Filesystems
49
Managing User
Resources: Quotas and
Permissions
In This Lesson:
Disk Quotas
File Permissions and Ownership
Disk Quotas
• What is a Quota?
– Disk space limitations for Linux users and groups
• Installation
– Kernel 2.6.x and higher
– ext2, ext3, ReiserFS, JFS, and XFS
– rpm –qi quota
– yum install quota (as root)
– /etc/fstab (usrquota,grpquota)
• /dev/sda3 /home ext4 usrquota,grpquota 1 1
50
Managing User Resources: Quotas and Permissions
CompTIA Linux+ Training
Disk Quotas
• Implement quotas
– quotaon
• Enable quotas
– edquota username (–t - filesystem grace period)
• quotacheck
– scans filesystem, verifies & updates quota info
• quota
– –g - groups
– –l - omit NFS
– –q - over limit
• repquota
– Summarizes info about a specified filesystem (–a for all)
51
Managing User Resources: Quotas and Permissions
CompTIA Linux+ Training
52
Managing User Resources: Quotas and Permissions
CompTIA Linux+ Training
Perm. Set Code Meaning Change type Code Perm. to Modify Code
u Owner + (Add) r - Read
g Group - (Remove) w - Write
o World = (Equal to) x - Execute
a All X - Executes only if
file is a dir or already
has exe. perm
s - SUID or SGID
53
Managing User Resources: Quotas and Permissions
CompTIA Linux+ Training
Perm. Set code Meaning Change type Code Perm. to Modify Code
t - Sticky bit
u - Existing owner‟s
permissions
g - Existing group
permissions
O - Existing world
permissions
Files Directories
Default mode: rw-rw-rw- Default mode: rwxrwxrwx
- umask: ----w--w- - umask: ----w--w-
Result: rw-r-r-- Result: rwxr-xr-x
54
Managing User Resources: Quotas and Permissions
CompTIA Linux+ Training
What We Covered
Disk Quotas
File Permissions and Ownership
55
Linux Links and System
Files
In This Lesson:
Understanding Links
Linux System Files
Locating Files
Understanding Links
• What is a link?
– Shortcut or pointer to a target file or location
• Hard links
– Two directory entries that point to the same file (inode)
– To delete the file, must delete both hard links
– Must exist on a single low-level file system (not multiple
partitions, i.e. /root to /home)
• Soft/Symbolic links
– Separate file whose contents point to the linked-to file
– Can point across filesystems
– ls -l will show linked to file
56
Linux Links and System Files
CompTIA Linux+ Training
Shareable Unshareable
Static /usr, /opt /etc, /boot
Variable /home, /var/mail /var/run, /var/lock
Directory Contents
/ Root filesystem or directory - all directories branch off of
root
/boot Contains static and unshareable files related to booting
the computer
/bin Contains critical executable files - most common user
commands like ls, cp, mv, etc.
/sbin Similar to bin, but contains programs run by
administrator, fdisk, etc.
/lib Contains program libraries; /lib/modules contains kernel
modules (drivers)
57
Linux Links and System Files
CompTIA Linux+ Training
Directory Contents
/usr Contains the bulk of systems programs and often splits
to a separate partition; /usr/bin & /usr/lib contains
programs and libraries
/usr/local Contains subdirectories that mirror /usr, like
/usr/local/bin and holds programs admin installs locally
/usr/X11R6 Contains files related to the X, the GUI env
/opt Contains commercial packages
/home Contains user data
Directory Contents
/root Home directory for the root user
/var Contains transient files: log files, print queue, mail
/tmp Holds programs temporary files, sometimes on separate
partition
/mnt For removable media devices: cdrom & floppy
/media Optional, but contains subdirectories for media:
/media/cdrom
/dev Contains device files or hardware interfaces
/proc Virtual filesystem that provides hardware info not
accessible from /dev
Locating Files
• find [path] [expression]
– brute force approach to file location, slower but reliable
Expression Purpose
-name Finds files that match the specified pattern
-perm mode Finds files that have certain permissions
-size n Finds files with a specific size
-gid Searches for files whose GID is indicated
-uid Searches for files owned by indicated user
-maxdepth Searches limited number of subdirectories
58
Linux Links and System Files
CompTIA Linux+ Training
What We Covered
Understanding Links
Linux System Files
Locating Files
59
Preparing for Your CompTIA Linux+ Certification Exam
CompTIA Linux+ Training
In This Lesson:
Exam Overview
Where to Take the Exam
Retake Policy
Preparation Tips
After the Exam
Exam Overview
• Experience
– CompTIA A+, CompTIA Network+ and at least 12 months of
Linux administration experience
– http://www.comptia.org/certifications/testprep/examobjectiv
es.aspx
• LX0-101
Domain % of Examination
101 System Architecture 14%
102 Linux Installation and Package Management 18%
103 GNU and Unix Commands 43%
104 Devices, Linux Filesystems, Filesystem 25%
Hierarchy Standard
Exam Overview
• 60 questions, 90 minutes to complete
– Multiple choice
– Fill-in the blank
• Scoring
– 500 on a scale of 200-800
60
Preparing for Your CompTIA Linux+ Certification Exam
CompTIA Linux+ Training
Retake Policy
• 1st retake has no waiting period, but for 3rd and any
subsequent attempts, must wait 14 days.
– If a Candidate has passed an exam, he/she cannot take it
again without prior consent from CompTIA.
– CompTIA beta examinations may only be taken one (1) time
by each candidate.
– A test result found to be in violation of the retake policy will
not be processed, which will result in no credit awarded for
the test taken. Repeat violators will be banned from
participation in the CompTIA Certification Program.
61
Preparing for Your CompTIA Linux+ Certification Exam
CompTIA Linux+ Training
What We Covered
Exam Overview
Where to Take the Exam
Retake Policy
Preparation Tips
After the Exam
Introduction to
CompTIA Linux+
Training -
Exam LX0-102
CompTIA Linux+ Training
Instructor: Veronica Henry
62
Introduction to CompTIA Linux+ Training - Exam LX0-102
CompTIA Linux+ Training
63
The Linux Shell Environment
CompTIA Linux+ Training
In This Lesson:
Environment Variables
Shell Configuration Files
Aliases
Environment Variables
• Used to pass data to shell programs
• Always in uppercase
• Preceded by $
Environment Variable Purpose
USER or USERNAME Holds current username
SHELL Holds path to current command shell
PWD Holds present working directory
HOSTNAME Holds system hostname
PATH Holds a list of directories to be searched
when running command from shell prompt
HOME Holds path to current user‟s home
directory
64
The Linux Shell Environment
CompTIA Linux+ Training
Aliases
• What are aliases?
– Shortcut to a different file or command
• alias
• alias alias_name=„commands‟
65
The Linux Shell Environment
CompTIA Linux+ Training
What We Covered
Environment Variables
Shell Configuration Files
Aliases
In This Lesson:
Shell Script Components
Shell Script Commands
Conditional Expressions
66
Writing and Editing Scripts
CompTIA Linux+ Training
67
Writing and Editing Scripts
CompTIA Linux+ Training
Conditional Expressions
• Couple of rules
– When you assign a value to a variable from the output of a
command, enclose in ` (backticks)
– Variable names should be preceded by a $
– #!/bin/bash or sh – referred to as shebang, hashbang,
hashpling or pound bang
– Make the script executable with
chmod
– Place script in a directory on the path
68
Writing and Editing Scripts
CompTIA Linux+ Training
What We Covered
Shell Script Components
Shell Script Commands
Conditional Expressions
Linux Databases
69
Linux Databases
CompTIA Linux+ Training
In This Lesson:
SQL Overview
MySQL - Databases and Tables
MySQL - Storing Data
MySQL - Retrieving Data
MySQL - Deleting Data
Linux Databases
CompTIA Linux+ Training
SQL Overview
• Structured Query Language - SQL
• Language used to retrieve data from databases
• SQL Products
• MySQL - included in most Linux distributions
– yum install mysql mysql-server
– /etc/init.d/mysqld start
– mysql_secure_installation
• PostgreSQL - derivative of the Ingres software
• SQLite - a library, not a database
Linux Databases
CompTIA Linux+ Training
Transportation:
70
Linux Databases
CompTIA Linux+ Training
Linux Databases
CompTIA Linux+ Training
Linux Databases
CompTIA Linux+ Training
71
Linux Databases
CompTIA Linux+ Training
• UPDATE tablename;
Linux Databases
CompTIA Linux+ Training
Linux Databases
CompTIA Linux+ Training
72
Linux Databases
CompTIA Linux+ Training
What We Covered
SQL Overview
MySQL - Database & Tables
MySQL - Storing Data
MySQL - Retrieving Data
MySQL - Deleting Data
In This Lesson:
Understanding the Linux GUI
X Configuration Tools
Configuring X
X Font Configuration
73
X11 Installation and Configuration
CompTIA Linux+ Training
X Configuration Tools
• X server tools
• XFree86 –configure
• Xorg –configure
• Queries hardware and produces configuration files:
– /root/XF86Config.new
– /root/xorg.conf.new
• Distribution tools
– Fedora - Display Settings tool
• system-config-display
• xf86cfg (4.x) or xorgcfg - deprecated
• XFree86 3.x - required by video card
– xf86config, Xconfigurator, XF86Setup
Configuring X
• X configuration files
– X.org-X11
• xorg.conf
– Stored in /etc or /etc/X11
– XFree86 4.x
• XF86Config-4
– Stored in /etc/X11
• XF86Config
– Stored in /etc or /etc/X11
– XFree86 3.x
• XF86Config
– Stored in /etc r /etc/X11
74
X11 Installation and Configuration
CompTIA Linux+ Training
Configuring X (cont’d)
• Configuration file format
– Sections for each feature
Section “InputDevice”
Identifier “Mouse0”
Driver “…”
Options…
EndSection
• Runlevels
– telinit 3 (Fedora)
– Shut down guid - /etc/init.d/gdm (or xdm) stop
– Start X again – startx
• X server supports configuration directories /etc/X11/xorg.conf.d
and /usr/share/X11/xorg.conf.d
Configuring X (cont’d)
• Configuration file sections
– Modules - loads X server modules or drivers
• Section “Module”, load
– Keyboard
• Section “InputDevice”, driver & options
– Mouse
• Section “InputDevice”, driver & options
– Monitor
• Section “Monitor”, modelname, horiz & vert sync, refresh,
modelines
– Video Card
• Section “Device”, driver, vendor, ram
• Section “Screen”, device, monitor, depth, display
Configuring X (cont’d)
• Server layout section
– Section “ServerLayout”
Identifier
Screen
InputDevice
InputDevice
EndSection
– xdypinfo
• Information about current display (X, color, resolution)
• Section “InputDevice”, driver & options
– xwininfo
• Technical information about windows
75
X11 Installation and Configuration
CompTIA Linux+ Training
X Font Configuration
• Configured through X or a font server which delivers fonts using
network protocols
• Font types:
– Bitmap - pixels are either active or inactive
– Outline or scalable fonts - each character is represented as
series of lines and curves
• Adobe PostScript Type 1
• TrueType
• X core fonts
– Require font directory
– Require to add font directory to X‟s font path
76
X11 Installation and Configuration
CompTIA Linux+ Training
What We Covered
Understanding the Linux GUI
X Configuration Tools
Configuring X
X Font Configuration
77
Display Manager and Accessibility Options
CompTIA Linux+ Training
In This Lesson:
The X Login System
XDMCP Server Configuration
X and Remote Access
Accessibility Options
78
Display Manager and Accessibility Options
CompTIA Linux+ Training
Accessibility Options
• Keyboard and mouse
– Repeat rate
– Sticky keys
– Slow keys
– Bounce/debounce
– Mouse tracking and click
– Simulated mouse clicks
– Mouse emulation/navigation
– Mouse gestures
– gnome onscreen keyboard (gok)
79
Display Manager and Accessibility Options
CompTIA Linux+ Training
What We Covered
The X Login System
XDMCP Server Configuration
X and Remote Access
Accessibility Options
In This Lesson:
Introduction to Linux Users and Groups
Creating User Accounts
Changing User Accounts
Creating Groups
Changing Groups
80
User and Group Accounts and Files
CompTIA Linux+ Training
81
User and Group Accounts and Files
CompTIA Linux+ Training
Options Purpose
–k Updates an expired account
–l Locks account; ! added to password
–u Unlocks account; Removes !
–f Forces creation with no password
–d Removes password
–S Displays password info
Options Purpose
–m When used with –d, moves users home
directory files
–l Changes user‟s login name
–L & –U Locks or unlocks user password
Options Purpose
–l Displays account expiration info for a user
–m mindays Sets minimum number of days between
password changes
0=multiple times a day
1=once/day
2=every 2 days
–M maxdays Sets maximum number of days between
password changes
82
User and Group Accounts and Files
CompTIA Linux+ Training
Options Purpose
–d lastday Sets last day a password was changed
–I inactivedays Sets number of days between expiration
and disable
–E expiredate Sets expiration date YYYY/MM/DD
–W warndays Sets number of days before expiration that
system will warn user
83
User and Group Accounts and Files
CompTIA Linux+ Training
Option Purpose
–r or --remove Removes all files from user‟s home
directory and mail spool
–f or --force Forces deletion while user logged in
–h or --help Lists of all userdel options
Creating Groups
• groupadd options groupname
Option Purpose
–g GID Specifies a group id (–o to share)
–r Creates GID less than 500
–f Forces creation of a group with existing
name
Changing Groups
• groupmod
– groupmod options groupname
• Options
– –g GID, –n newgroupname
– Use usermod to add user to group
• usermod –G developers ajones
84
User and Group Accounts and Files
CompTIA Linux+ Training
Option Purpose
–a user Adds user to group
–d user Removes user from group
–R Disallows new members with newgrp
–A user Specifies group administrators
–M user Adds users to list of group members
What We Covered
Introduction to Linux Users and Groups
Creating User Accounts
Changing User Accounts
Creating Groups
Changing Groups
85
Job Scheduling
Job Scheduling
CompTIA Linux+ Training
In This Lesson:
Cron Job Overview
Creating Cron Jobs
The Anacron Tool
The At Command
Job Scheduling
CompTIA Linux+ Training
86
Job Scheduling
CompTIA Linux+ Training
Job Scheduling
CompTIA Linux+ Training
Job Scheduling
CompTIA Linux+ Training
87
Job Scheduling
CompTIA Linux+ Training
Job Scheduling
CompTIA Linux+ Training
The At Command
• The at - runs a single command at some point in the future
– at timeofday
• atd daemon must be running to use the at, stored in /etc/init.d
or /etc/rc.d/init.d
– Time of day HH:MM (noon, midnight, teatime-4:00pm)
– Day (if more than 24 hrs in advance) MMDDYY or DD.MM.YY
– Now +specified period in future
• atq - lists pending at jobs
• atrm - removes an at job from the queue
• batch - executes jobs when system load drops below 0.8
• Control access with files:
– /etc/at.allow
– /etc/at.deny
Job Scheduling
CompTIA Linux+ Training
What We Covered
Cron Job Overview
Creating Cron Jobs
The Anacron Tool
The At Command
88
Localization and System
Time
In This Lesson:
Time Zone Settings
Understanding Locales
Linux System Time
Network Time Protocol Configuration
89
Localization and System Time
CompTIA Linux+ Training
Understanding Locales
• A locale specifies language, country info
– language=territory.codeset@modifier
• language = en, sp, fr, etc.
• territory = US, SP, JP, etc.
• codeset = ASCII, ISO-8859, UTF8
• modifier = locale specific code
– locale command displays settings; -a shows all available
• Temporary change: set LC_ALL and LANG env variables
• export LANG=code.encoding
• export LC_ALL=code.encoding
• Permanent change, edit: ~/.bashrc or /etc/profile
• LANG=C
90
Localization and System Time
CompTIA Linux+ Training
91
Localization and System Time
CompTIA Linux+ Training
What We Covered
Time Zone Settings
Understanding Locales
Linux System Time
Network Time Protocol Configuration
92
Managing System and
Kernel Logs
In This Lesson:
The Syslog Daemon
Manual Logging
Log File Rotation
Reviewing Log Files
93
Managing System and Kernel Logs
CompTIA Linux+ Training
Manual Logging
• Tool that manually creates log files
– logger options message
Option Purpose
–i Records the process ID (PID)
–s Echoes data to standard error in addition to log file
–d Uses datagram rather than stream connection to
logger socket
–f file Logs contents of a file
–p pri Sets a priority
–t Removes logger tag in filenames
–u Logs directly to a network socket
94
Managing System and Kernel Logs
CompTIA Linux+ Training
95
Managing System and Kernel Logs
CompTIA Linux+ Training
What We Covered
The Syslog Daemon
Manual Logging
Log File Rotation
Reviewing Log Files
In This Lesson:
Email Basics
Email Software
Managing Your Email
Email Security
Printing Basics
Common Unix Printing System
Managing The Print Queue
96
Email and Printing
CompTIA Linux+ Training
Email Basics
• Protocol - a communications scheme, essentially a program that
allows dissimilar systems to communicate
• Email protocols
– Simple Mail Transfer Protocol (SMTP)
• SMTP servers aka Mail Transfer Agents (MTA)
– Post Office Protocol (POP)
– Internet Message Access Protocol (IMAP)
– /var/spool/mail
– Mail User Agents (MUA)
• Email client
Email Software
• 4 popular email servers:
– Sendmail
– Postfix
– Exim
– Qmail
• Additional software:
– Cyrus IMAP, Dovecot - pull mail servers
– Fetchmail - pulls mail with POP or IMAP and injects it into a
local SMTP mail queue
– Evolution, Kmail, Pine, and Mutt - mail readers (clients)
97
Email and Printing
CompTIA Linux+ Training
Email Security
• Bugs - flaws in the program code that can be exploited by
attackers and used to compromise your system
• Configuration errors - related to the administrator
– open relay - relays messages from any computer to another
Printing Basics
• Linux and postscript printing
– postscript - default printing standard
– ghostscript - converts to printer friendly format
• Configuration files
– /etc/rc.d
– /etc/init.d
– /etc/rc?.d
– Search for configuration files with grep command
98
Email and Printing
CompTIA Linux+ Training
99
Email and Printing
CompTIA Linux+ Training
What We Covered
Email Basics
Email Software
Managing Your Email
Email Security
Printing Basics
Common Unix Printing System
Managing The Print Queue
Internet Protocols
Internet Protocols
CompTIA Linux+ Training
In This Lesson:
Networking and TCP/IP
TCP/IP Protocol Types
IP Addressing
Network Hostnames
Network Ports
100
Internet Protocols
CompTIA Linux+ Training
Internet Protocols
CompTIA Linux+ Training
Internet Protocols
CompTIA Linux+ Training
Transport Transport
Internet/ Internet/
Network Network
Data Link Data Link
Reply
Request
101
Internet Protocols
CompTIA Linux+ Training
Internet Protocols
CompTIA Linux+ Training
IP Addressing
• Network addresses - 6 bytes in length (hex), separated by colons
– Hardware address (Media Access Control (MAC) address)
• ifconfig ethn - discover hardware address
• eth0 Link encap: Ethernet Hwaddr 00:A0:CC:24:BA:02
• IPv4 addresses - 4 bytes in length
– Address Resolution Protocol (ARP) converts between IP &
MAC address
– 4 base-10 numbers (0-255) ex. 192.168.1.1
• IPv6 – 16 bytes in length (hex), separated by colons
– Upgrade to IPv4 - includes more security and more addresses
– Neighbor Discovery Protocol (NDP)
– 8 groups of 4 digit hex numbers
• fe80:0:0:0:200:f8ff:fe21:67cf
Internet Protocols
CompTIA Linux+ Training
IP Addressing (cont’d)
• Network mask (subnet mask or netmask)
– Identifies portion of IP address that a network address and
part that is a computer address, using binary 1 for network
and 0 for computer - 255 or 0 values, 255=network,
0=computer
– Ex. 255.255.255.0 = 1st 3 octets network add, last is node
– Represented by number of network bits in address:
192.168.1.1/24 = netmask 255.255.255.0
102
Internet Protocols
CompTIA Linux+ Training
IP Addressing (cont’d)
• Classless Inter-Domain Routing (CIDR) form
• Broadcast - sent to all computers on network
Internet Protocols
CompTIA Linux+ Training
Network Hostnames
• Hostname - name of a computer
– Two parts - machine name and domain name
– TCP/IP can link computer names to IP addresses
• Resolving hostnames
– Domain Name System (DNS) - a database of computers that
converts between IP addresses and hostnames
• Manual DNS lookup
– nslookup - deprecated
– host - nslookup replacement
– dig - more complex lookup
– whois – general domain information, –H - omits legal
disclaimers
Internet Protocols
CompTIA Linux+ Training
103
Internet Protocols
CompTIA Linux+ Training
Network Ports
• Network ports are program addresses (like web browser)
– servers tie to ports at startup
Internet Protocols
CompTIA Linux+ Training
Internet Protocols
CompTIA Linux+ Training
104
Internet Protocols
CompTIA Linux+ Training
Internet Protocols
CompTIA Linux+ Training
Internet Protocols
CompTIA Linux+ Training
What We Covered
Networking and TCP/IP
TCP/IP Protocol Types
IP Addressing
Network Hostnames
Network Ports
105
Network Configuration
and Troubleshooting
In This Lesson:
Dynamic Host Configuration Protocol
Configuring Static IP Addresses
Configuring Routing
Configuring Devices and Hostnames
Troubleshooting Overview
106
Network Configuration and Troubleshooting
CompTIA Linux+ Training
Configuring Routing
• Creating a route entry
– route [add |del] [-net | -host] target [netmask nm] [gw gw]
[reject] [[dev] interface]
• Enable routing
– echo “1” > /proc/sys/net/ipv4/ip_forward
– Permanent change
• Edit /etc/sysctl.conf to include: net.ipv4.ip_forward = 1
• ifup - initializes or brings up an interface
– ifup device
• ifdown - brings the device down
– ifdown device
107
Network Configuration and Troubleshooting
CompTIA Linux+ Training
Troubleshooting Overview
• ping - sends icmp echo request packet from the source system to
the destination every second
– –c - sets number of packets
– ping –c 5 linux.com
• traceroute - sends 3 packets to each computer that sits between
your system and a target
– –n - says to show the target computers ip‟s instead of hostname
– traceroute –n 191.168.1.1
• tracepath - similar to traceroute but gives you 1 line of output for
each test packet
– tracepath system
108
Network Configuration and Troubleshooting
CompTIA Linux+ Training
What We Covered
Dynamic Host Configuration Protocol
Configuring Static IP Addresses
Configuring Routing
Configuring Devices and Hostnames
Troubleshooting Overview
Security Administration
109
Security Administration
CompTIA Linux+ Training
In This Lesson:
Understanding the Super Server
Unused Servers and Security
The Role of Configuration Files
Host Security
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
110
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
111
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
Host Security
• Password rules
– Use strong passwords
• No dictionary words or names
• Include numbers
• Punctuation marks
• Upper/lower case, etc.
– Shadow passwords (/etc/shadow)
– Force periodic password changes
– Educate users (social engineering, phishing, multiple
passwords)
– Use ssh for remote logins
– Consider using password crackers
112
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
113
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
Security Administration
CompTIA Linux+ Training
What We Covered
Understanding the Super Server
Unused Servers and Security
The Role of Configuration Files
Host Security
114
Encryption Options
Encryption Options
CompTIA Linux+ Training
In This Lesson:
The Secure Shell (SSH) Overview
SSH Configuration
SSH Access Control & Logins
SSH Security
GNU Privacy Guard
GNU Encryption
Encryption Options
CompTIA Linux+ Training
115
Encryption Options
CompTIA Linux+ Training
SSH Configuration
• /etc/ssh/sshd_config
– Option value
• protocol , 1 or 2 (level 2 recommended)
• PermitRootLogin - set to no for added security
• X11Forwarding - enables tunneling features
• /etc/ssh/ssh_config (can be overridden by local file)
• Encryption keys (/etc/ssh/ssh_host_rsa_key &
ssh_host_dsa_key, .pub for public keys, ssh_host_rsa1_key)
– Private & public keys
– Generate keys with ssh-keygen
– ssh-keygen -q -t rsa1 -f /etc/ssh/ssh_host_key -C „‟ -N „‟
– ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C „‟ -N „‟
– ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key -C „‟ -N „‟
Encryption Options
CompTIA Linux+ Training
Encryption Options
CompTIA Linux+ Training
116
Encryption Options
CompTIA Linux+ Training
Encryption Options
CompTIA Linux+ Training
Encryption Options
CompTIA Linux+ Training
SSH Security
• Set ssh to:
– Accept only level 2 protocol connections
– Refuse direct root logins
– Disable X forwarding if not needed
– Use TCP Wrappers or firewall to limit access
– Update software
– Protect private keys
117
Encryption Options
CompTIA Linux+ Training
Encryption Options
CompTIA Linux+ Training
GNU Encryption
• Encrypt data
– gpg --out encrypted-file --recipient uid --armor --encrypt
original-file
• Decrypt data
– gpg --out decrypted-file --decrypt encrypted-file
• enter passphrase
• Sign messages
– gpg --clearsign file (--sign creates new file with.gpg)
• Verify messages
– gpg --verify file
Encryption Options
CompTIA Linux+ Training
What We Covered
The Secure Shell (SSH) Overview
SSH Configuration
SSH Access Control & Logins
SSH Security
GNU Privacy Guard
GNU Encryption
118
Preparing for Your
CompTIA Linux+
Certification Exam
(LX0-102)
CompTIA Linux+ Training
Instructor: Veronica Henry
In This Lesson:
Exam Overview
Where to Take the Exam
Retake Policy
Exam Preparation Tips
After the Exam
Exam Overview
• Experience
– CompTIA A+, CompTIA Network+ and at least 12 months of
Linux administration experience
– http://www.comptia.org/certifications/testprep/examobjectiv
es.aspx
• LX0-102
Domain % of Examination
105 Shells, Scripting and Data Management 17%
106 User Interfaces and Desktops 8%
107 Administrative Tasks 20%
108 Essential System Services 17%
109 Networking Fundamentals 23%
110 Security 15%
119
Preparing for Your CompTIA Linux+ Certification Exam
CompTIA Linux+ Training
Exam Overview
• 60 Questions, 90 minutes to complete
– Multiple choice
– Fill-in the blank
• Scoring
– 500 on a scale of 200-800
Retake Policy
• 1st retake has no waiting period, but for 3rd and any
subsequent attempts, must wait 14 days.
– If a Candidate has passed an exam, he/she cannot take it
again without prior consent from CompTIA.
– CompTIA beta examinations may only be taken one (1) time
by each candidate.
– A test result found to be in violation of the retake policy will
not be processed, which will result in no credit awarded for
the test taken. Repeat violators will be banned from
participation in the CompTIA Certification Program.
120
Preparing for Your CompTIA Linux+ Certification Exam
CompTIA Linux+ Training
What We Covered
Exam Overview
Where to Take the Exam
Retake Policy
Exam Preparation Tips
After the Exam
121
Next Steps
Next Steps
CompTIA Linux+ Training
In This Lesson:
What We Learned
Follow Up
What‟s Next
Next Steps
CompTIA Linux+ Training
What We Learned
• System Architecture
• Linux Installation and Package Management
• GNU and Unix Commands
• Devices, Filesystems and Filesystem Hierarchy Standard
• Shells, Scripting and Data Management
• User Interfaces and Desktops
• Administrative Tasks
• Essential System Services
• Networking Fundamentals
• Security
122
Next Steps
CompTIA Linux+ Training
Follow Up
• Preparing for the Linux+ Certification Exams
• Transcender Lessons
• Course Reference Material
• CompTIA Linux+
– http://www.comptia.org/certifications/listed/linux.aspx
Next Steps
CompTIA Linux+ Training
What’s Next
• After passing LX0-101 and LX0-102, you will be Linux+ certified
– Linux Professional Institute LPIC-1
– Novell Certified Linux Administrator (CLA)
• Linux Professional Institute Certification
– Advanced Level Linux Professional LPIC-2
– Senior Level Linux Professional LPIC-3
– http://www.lpi.org/eng/certification/the_lpic_program
• Novell Certifications
– Novell Certified Linux Desktop Administrator
– Novell Certified Linux Engineer
– http://www.novell.com/training/certinfo/
123