© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 8 Linux on the Desktop McGraw-Hill.

Slides:



Advertisements
Similar presentations
LIS651 lecture 5 direct use of wotan Thomas Krichel
Advertisements

A Guide to Unix Using Linux Fourth Edition
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Jump to first page Unix Commands Monica Stoica Jump to first page Introduction to Unix n Unix was born in 1969 at Bell Laboratories, a research subdivision.
Chapter One The Essence of UNIX.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Linux+ Guide to Linux Certification, Second Edition
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 6 Using the Shell and Text Files.
Installing Windows XP Professional Using Attended Installation Slide 1 of 41Session 2 Ver. 1.0 CompTIA A+ Certification: A Comprehensive Approach for all.
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
1. This presentation covers :  User Interface Administration  Files System and Services Management 2.
Using the “CLI” Unix / Linux Preparation Course May 25 Djibouti.
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
1 Web Server Administration Chapter 3 Installing the Server.
Chapter-4 Windows 2000 Professional Win2K Professional provides a very usable interface and was designed for use in the desktop PC. Microsoft server system.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 6 Today’s Windows Windows Vista and Windows 7 McGraw-Hill.
Introduction to Shell Script Programming
Introduction to Unix/Linux Chapter One The Essence of UNIX.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 5 Windows XP Professional McGraw-Hill.
Managing User Accounts. Module 2 – Creating and Managing Users ♦ Overview ► One should log into a Linux system with a valid user name and password granted.
Unix Basics Chapter 4.
CENT 305 Information Systems Security Linux Introduction.
1 Web Server Administration Chapter 3 Installing the Server.
Gorman, Stubbs, & CEP Inc. 1 Introduction to Operating Systems Lesson 4 Microsoft Windows XP.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
SUSE Linux Enterprise Desktop Administration Chapter 2 Use the Linux Desktop.
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Chapter Two Exploring the UNIX File System and File Security.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
McGraw-Hill/Irwin© 2006 The McGraw-Hill Companies, Inc. All rights reserved
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
Introduction to Programming Using C An Introduction to Operating Systems.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Linux Commands C151 Multi-User Operating Systems.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 6 Today’s Windows Windows Vista and Windows 7 McGraw-Hill.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
© 2015 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not authorized for sale or distribution in any manner.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
2Operating Systems  Program that runs on a computer  Manages hardware resources  Allows for execution of programs  Acts as an intermediary between.
Course : PGClass : MCA Subject: Operating SystemSub.Code : 3CT11 Staff Name : S.SomasundaramYear & Sem : II nd & III rd.
Overview of Linux Fall 2016 Dr. Donghyun Kim
Guide to Operating Systems, 5th Edition
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Guide to Linux Installation and Administration, 2e
SUSE Linux Enterprise Desktop Administration
9 Linux on the Desktop.
Chapter 1 The Essence of UNIX and Linux
Unix : Introduction and Commands
Web Programming Essentials:
Linux Professor Sabol.
Presentation transcript:

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 1 Third Edition Chapter 8 Linux on the Desktop McGraw-Hill

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 2 Learning Outcomes Describe Linux Install Linux Demonstrate basic skills for using Linux Manage Linux files and directories with shell commands Secure a Linux desktop Troubleshoot common Linux problems

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 3 Linux Overview Why Learn Linux? – Qualifying for a Job – Improving Your Skills

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 4 Linux Overview The Evolution of Linux – Ken Thompson of Bell Labs wrote an operating system in the 1970's that evolved into UNIX – UNIX went on to power the computers of most of the universities, corporations, and governments of the world – UNIX has a reputation as a powerful, stable, and fast system – 1984: GNU formed to develop a free version of a UNIX-like OS

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 5 Linux Overview The Evolution of Linux (cont.) – 1988: UNIX licensees formed the Open System Foundation (OSF) – AT&T and others formed UNIX International to oppose OSF – 1991: Linus Torvalds and others began development of Linux as an open-source operating system based on UNIX – Open source software is distributed with all its source code

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 6 Linux Overview Linux Today – Novell and IBM (and others) have integrated open source software into their product mix – Manufacturers sell Web servers running Apache Web Server on Linux – Linux now on computers ranging from desktops to corporate servers

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 7 Linux Overview Features and Benefits of Linux – Free or Inexpensive – Runs on Old Equipment – Fast – Command line only or add a GUI – Stable – Secure – Open Source

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 8 Linux Overview Drawbacks of Linux – Lack of Centralized Support – Limited Software Selection – Limited Hardware Support – Complexity

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 9 Linux Overview Acquiring Linux for the Desktop – Many sources: select by role Server or desktop? Select a source that meets your support needs Desktop Linux sources – Ubuntu ( – Fedora (fedoraproject.org) – OpenSUSE (

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 10 Linux Overview Acquiring Linux for the Desktop – Ubuntu Download includes a LiveCD distribution Complete software bundle – OpenOffice – Firefox Up to 700 MB download

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 11 Step-by-Step 8.01 Downloading Linux and Creating a LiveCD Linux Overview

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 12 Installing Linux Preparing for Linux Installation – Keep Your Linux Installation Simple – Prepare a Password – Hardware Requirements – Clean Installation versus Dual Booting – Booting into the Linux Installation Program

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 13 Table 8-1 Ubuntu Linux Minimum Requirements versus Recommended System Configuration

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 14 Installing Linux Performing the Installation – Boot into Linux installation – Guides you through process – Ubuntu GUI installation include online help

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 15 Step-by-Step 8.02 Installing Linux

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 16 Linux Basics Logging in to Linux – Linux requires authentication of each user – Command-line login at login prompt Name of computer, followed by a space and the word login, followed by a colon and a blinking cursor Enter user name Prompt asks for password Type password After successful login, last login information displays, followed by the standard command-line prompt

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 17 Figure 8-1 The Login prompt

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 18 Figure 8-2 The $ prompt shows user name, computer name, and current directory

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 19 Linux Basics Logging in to Linux – The Linux CLI prompt Your user name and the computer name (hostname) separated by sign followed by your user name again Contained within square brackets followed by a $ sign The $ prompt Root account has a # sign at end of prompt

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 20 Linux Basics Logging in to Linux – Log out Type Exit or Press Ctrl-D

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 21 Linux Basics Shutting Down Linux – Only root can shut down Linux from CLI Type shutdown -h now Type shutdown -r now Learn more: type man shutdown – Ordinary user can shutdown in Linux GUI Select Log Out | Shutdown Root can disable this feature in the GUI

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 22 Linux Basics The Ubuntu GNOME Terminal Window – Terminal window equivalent to a Windows Command Prompt window – Open from the GNOME Applications menu

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 23

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 24 Figure 8-3 A GNOME terminal window

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 25 Linux Basics Working with Linux Commands – The Command Line Interface Shell BASH, an acronym for Bourne Again Shell Shell commands

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 26 Linux Basics Working with Linux Commands – The Command Line Interface Shell (cont.) The Command Syntax – The first string of characters is the command – A space follows the command – Options follow – In general the syntax is: command –switch parameter – Example: ls –a /etc

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 27 Figure 8-4 Entering this command in all caps resulted in an error message

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 28 Figure 8-5 Entering the previous command in lowercase resulted in running the correct command, showing the user manual entry for the ls command

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 29 Linux Basics Working with Linux Commands – The Command Line Interface Shell (cont.) Command Line History – Linux saves shell commands entered during a session – Scroll through the commands at the $ prompt – Move within a command to edit it – Press Enter to run a command – Command history saved a file called bash_history

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 30 Linux Basics Working with Linux Commands – The Command Line Interface Shell (cont.) Command Completion – A feature that completes a command line – Enter portion of a command and press the Tab key – Linux will try to guess the remaining portion

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 31 Linux Basics Working with Linux Commands – The Command Line Interface Shell (cont.) The Help Manual – Online manual accessed with man command – Syntax: man command – Enter man man to see documentation for the man command – Page Down and Page Up to scroll one screen at a time – Up Arrow and Down Arrow to scroll one line at a time

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 32 Figure 8-6 The manual command documentation

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 33 The date and cal commands

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 34 Linux Basics Working with Linux Commands – The Command Line Interface Shell (cont.) Use of Spaces – Separate each part of a command line entry with a space – Example that won’t work » shutdown-h now

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 35 Figure 8-7 Example of a BASH error for an unrecognized command

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 36 Figure 8-8 An unrecognized command in a GNOME terminal window

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 37 Linux Basics Working with Linux Commands – The Command Line Interface Shell (cont.) Paths – No drive letter – Path begins with a forward slash (/) which also separates directories – Drives and other devices are given names, such as /dev/sda0 (the first hard drive on a SCSI interface) or /dev/hda1 (the first hard drive on an IDE interface)

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 38 Linux Basics Working with Linux Commands – The Command Line Interface Shell (cont.) Linux Feedback – Similar to DOS and Windows shell commands – Cryptic feedback – Success of a command not usually reported – Only errors – Output minimal and controlled by options » Example: ls -l

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 39 Figure 8-9 Linux error messages are not very helpful

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 40 Figure 8-10 Output from the ls and ls –l commands

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 41 Managing Files and Directories with Shell Commands Working with Directories in Linux – Linux Directory Hierarchy A home directory for each user – /home/user name – User has full control over contents of the home directory – Becomes current at login Predefined directories used by the system – /etc – /bin

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 42 Table 8-2 Linux Default Directories

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 43 Table 8-3 Basic Shell Commands for File Management

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 44 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Listing the Contents of a Directory Simple Directory Listings: ls Fancy Directory Listings: ls –l /etc

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 45 Table 8-4 Commonly Used Options for the ls Command

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 46 Figure 8-11 File listing of the /etc directory

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 47 Figure 8-12 File listing with more details

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 48 Figure 8-13 A listing with all entries displayed

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 49 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Changing the Current Directory cd command cd private cd /usr/sbin

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 50 Figure 8-14 Changing directories Figure 8-15 Changing back to a home directory using the tilde (~)

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 51 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Relative Path Move up one directory level: cd.. Move back to current user’s home directory: cd ~ Move up two levels and : cd../../etc

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 52 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Wildcards Symbols that replace one or more characters – * : bi* refers to all files or directories beginning with "bi“ – Enter a range of characters to be substituted as wildcards » ls [c-d]* lists all files beginning with c through d – $ represents a single character

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 53 Using wildcards

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 54 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Creating Directories Use the mkdir command Requires at least the name of the directory Example: mkdir junk Verify success using the ls command Create several directories at once mkdir perl html bin data

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 55 Figure 8-16 Using mkdir to create directories and ls to show them

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 56 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Copying Files in Linux cp is Linux copy command Requires two parameters – Source file – Target filename or location – Can use relative path and wildcards

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 57 Figure 8-17 Copying the ntp.conf file

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 58 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Creating and Editing Files in Linux Using Pico – Commands shown at bottom of the screen – Keyboard works as expected (especially backspace and delete keys) – Text wraps after 80 characters – ctrl-t opens spell checker

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 59 Table 8-5 Common Pico Commands

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 60 Figure 8-18 The Pico editor with an open document

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 61 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – The Vi/Vim Text Editor Line editor Latest, Vi Improved (VIM) Voted the most popular Linux editor by readers

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 62 Figure 8-19 The Vim user interface with a document open

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 63 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – The Emacs Text Editor Voted a distant second to Vim at Designed for programmers

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 64 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Deleting Files in Linux rm command – Requires at least one parameter: a file name – Include multiple file names to delete more than one – Use the ls command to confirm a deletion

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 65 Figure 8-20 Using the rm command to delete a file

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 66 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Renaming or Moving Files in Linux mv command – Name of original file – New name or location of file

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 67 Renaming a file with the mv command

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 68 Managing Files and Directories with Shell Commands Working with Directories in Linux (cont.) – Viewing the Contents of a File Several commands for viewing text files If used on binary files, they display “garbage” more command displays file one screenful at a time head command displays just the first 10 lines of a file less command moves forward or backward tail command displays the last 10 lines of a file cat command displays the entire contents

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 69 Figure 8-21 Using the more command

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 70 Securing a Linux Desktop Using the Root Account – Create a strong password – Root is also called superuser in some Linux references

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 71 Figure 8-22 After logging on as the root the # prompt displays

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 72 Securing a Linux Desktop Performing Administrative Tasks at the Command Shell or Terminal Window – While logged on as an ordinary user, enter su root This substitutes the root user temporarily Only change to prompt is the ending #

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 73 Securing a Linux Desktop Performing Administrative Tasks at the Command Shell or Terminal Window (cont.) – Ubuntu includes sudo Logged on user borrows root privileges Works like a Windows standard account with UAC enabled Example: sudo pico – User enters their own password – Command completes gksudo is GNOME version of sudo

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 74 The sudo command prompts for a password before executing a command

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 75 Figure 8-23 The gksudo command prompts you for the password of the current user—not the root account

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 76 Securing a Linux Desktop Performing Administrative Tasks at the Command Shell or Terminal Window (cont.) – Performing Administrative Tasks in a GUI While logged on as an ordinary user, enter a command that requires root A dialog box will prompt for your password

© 2012 The McGraw-Hill Companies, Inc. All rights reserved Supply your password to perform an administrative task

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 78 Securing a Linux Desktop Managing Users – Several users can use one computer – Each user must have a unique account – Creates a home directory for each user – Users can further protect home directory with permissions

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 79 Table 8-6 Shell Commands for User Management

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 80 Figure 8-25 A GUI tool for user management

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 81 Securing a Linux Desktop Managing Users (cont.) – Creating User Accounts Each name must be unique Determine a naming convention Create a user with useradd Confirm account with the finger command

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 82 Installing the finger daemon

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 83 Figure 8-26 Using the useradd command to create a user

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 84 Securing a Linux Desktop Managing Users (cont.) – Changing User Passwords Change passwords with passwd Entering passwd without parameters will allow you to change your own password The root account can change any account's pass­word – passwd username Linux will only accept complex passwords

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 85 Figure 8-27 Using root to change another account’s password

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 86 Securing a Linux Desktop Managing Users (cont.) – Deleting Users Delete users with userdel – userdel username Home directory not removed when user is deleted Manually delete this directory and its contents

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 87 Securing a Linux Desktop File and Folder Permissions – File and Folder Attributes Run ls –l to see the attributes First 10 characters 1 st character: file (-), directory (d), or link (l) Next 9 are permissions for three different entities 2 nd, 3 rd, and 4 th show permissions of owner 5 th, 6 th, and 7 th show permissions of group 8 th, 9 th, and 10 th show permissions of all others

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 88 Figure 8-28 A sample listing showing attributes

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 89 Securing a Linux Desktop File and Folder Permissions – Permissions r = read w = write x = execute - = disabled – Permission mode values read = 4 write = 2 execute = 1

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 90 Securing a Linux Desktop File and Folder Permissions – Change permissions with chmod Requires two parameters – Access mode number – File or directory name to change – Example: chmod 644 reports

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 91 Table 8-7 Access Mode Numbers

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 92 Step-by-Step 8.03 Working with Directories Securing a Linux Desktop

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 93 Troubleshooting Common Linux Problems Cannot Save File – Usually result of trying to save a file in a location outside the user's home directory – Direct the application to save the file in a location within the user's directory

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 94 Figure 8-29 Error screen in an application indicating trouble saving a file

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 95 Troubleshooting Common Linux Problems Screen Displays Gibberish – Usually result of trying to view nontext data as text – Example: cat a.out The a.out file is binary, so the output is gibberish – If problem persists after output is complete, log out and log in again

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 96 Figure 8-30 Results of entering a head command for a.out

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 97 Troubleshooting Common Linux Problems Command Not Found Error – Number one cause is typos – Review command-line history – Use the Left Arrow and Right Arrow keys to move through the line and correct error – Press Enter to test correction

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 98 Chapter 8 Summary Linux Overview – Linux, originally created by Linus Torvalds, is free, open source software that is like UNIX in stability and function. – Many versions of Linux exist for all types of computers, and people often use Linux on Web servers.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 99 Chapter 8 Summary Linux Overview (cont.) – Linux benefits include cost (it is free or inexpensively bundled), the ability to run on old hardware, speed, and stability. – Drawbacks of Linux include lack of centralized support, limited software selection, limited hardware support, and complexity.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 100 Chapter 8 Summary Installing Linux – Decide how to install—clean installation, upgrade, or dual boot. Keep the installation simple and fine-tune it later, especially as far as undetected devices go. – Linux memory and hard disk space requirements are small compared to Windows operating systems.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 101 Chapter 8 Summary Installing Linux (cont.) – Linux supports all standard video graphics adapters and monitors; supports the use of a mouse, primarily in graphics interfaces; and supports many printers, modems, and network adapters.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 102 Chapter 8 Summary Installing Linux (cont.) – Be prepared to work with the root account (superuser) before installing Linux; give this account a strong password, and only use it when you need to perform system maintenance tasks. – Many Linux installation programs now run in GUI mode, providing online help in a pane on screen throughout the process.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 103 Chapter 8 Summary Linux Basics – Linux requires authentication via a login— either in the command shell or in a GUI. – The Linux shell is called BASH. – The $ (dollar) prompt appears when an ordinary user logs in to the command shell. It consists of the user name and the computer name (host name) separated by sign, followed again by the user name (this last indicates the name of the current directory).

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 104 Chapter 8 Summary Linux Basics (cont.) – When the root account logs in at the command shell, the prompt is similar, but ends with a # sign. – Log out of Linux by typing exit at the prompt, which allows you to leave Linux without shutting down. – Only root can shut down Linux from the command line. You accomplish this with the shutdown command, which has many options (that change the outcome of a command).

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 105 Chapter 8 Summary Linux Basics (cont.) – Linux is case sensitive, while DOS and the Windows command prompt are case insensitive. – An option is a subcommand that changes the outcome of a command. Many options are preceded by a hyphen (-). – Linux requires that you separate each part of a command line entry with a space.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 106 Chapter 8 Summary Linux Basics (cont.) – In DOS, a full path to a file or directory begins with a drive letter, but Linux does not use drive letters. – Linux shows each device as part of the file system as in /dev/sda0 (the first hard drive on a SCSI interface). – The man command gives you access to the Linux shell commands help manual.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 107 Chapter 8 Summary Managing Files and Directories with Shell Commands – Linux has several directories for system files and a home directory for each user. – Your home directory is the only place you can save files, and when you log in this directory becomes your current (or working) directory. – The /bin directory within your home directory contains many of the Linux commands.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 108 Chapter 8 Summary Managing Files and Directories with Shell Commands (cont.) – The /etc directory contains settings and configuration data for your Linux computer. There are many other directories created for the system’s use, and an ordinary user cannot access these directories. – You use the ls, cd, more, mkdir, cp, rm, and mv commands in file management. – You can use the, head, less, tail, and cat commands to view files.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 109 Chapter 8 Summary Managing Files and Directories with Shell Commands (cont.) – You can use special symbols with the shell commands to navigate to directories that are relative to your current directory. – Use the asterisk (*) wildcard to replace all the characters from the point where you place the asterisk to the end of the name. Use square brackets with the asterisk to include a range of characters to precede the wildcard.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 110 Chapter 8 Summary Managing Files and Directories with Shell Commands (cont.) – A text editor works with plain text. Pico, Vi, Vim, and Emacs are text editors that come with some distributions of Linux.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 111 Chapter 8 Summary Securing a Linux Desktop – You must use the root account to create and manage users, and to make system changes. – When logged on as an ordinary user, use the su command to log on as another user (most often root). – When logged on as an ordinary user in a GUI, any time you attempt to perform a root-only function you will automatically be prompted to provide the root password.

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 112 Chapter 8 Summary Securing a Linux Desktop – Common commands for working with user accounts are useradd, userdel, passwd, and finger. – Use permission attributes on files and folders to control access to them. – The permissions include: r (read), w (write), x (execute), and - (disabled).

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 113 Chapter 8 Summary Securing a Linux Desktop – Use the chmod command to modify attributes, based on mode number. – Permission attribute modes are 1 (execute), 2 (write), and 4 (read).

© 2012 The McGraw-Hill Companies, Inc. All rights reserved. 114 Chapter 8 Summary Troubleshoot Common Linux Problems – You must have permission to save a file in a directory. – Trying to display a binary file results in garbage on the screen. – The “Command Not Found Error” usually results from a typo at the command prompt.