1 / 65

Welcome to RHA030

Welcome to RHA030. Pace Center for Business and Technology. Introduction RHA030 – Computing Essentials. Pace Center for Business and Technology. Introduction RHA030 – Computing Essentials. Audience

piper
Download Presentation

Welcome to RHA030

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome to RHA030 Pace Center for Business and Technology

  2. IntroductionRHA030 – Computing Essentials Pace Center for Business and Technology

  3. IntroductionRHA030 – Computing Essentials Audience Users who are new to Linux and have no prior UNIX or command-line skills, who want to develop and practice the basic skills to use and control their own Red hat Linux system. Assumed Knowledge User-level experience with any computer system, use of mouse, use of menus, use of any graphical user interface. Aims Students will learn to be effective users of Linux systems, acquiring skills and understanding of command line functions, file systems, users and groups, bash shell, process management, text editors, network applications, searching and organizing data, and graphical applications. Objectives Upon successful completion of this curse, the student will be a Red Hat Linux user productive in using and customizing a Red Hat Linux system for common command line processes and desktop productivity roles.

  4. Classroom Environment • Computers are equipped with Red Hat Enterprise Linux 6 • The setup: • Instructor computer – Primary classroom server: • cifs-file-server (Common Internet File System) • directory-server • ftp-server • network-server • nfs-file-server • web-server • Student computers – Red Hat Client Workstations: • VMWare Player • A VM for each course RHEL6-030, RHEL6-130, and RHEL6-230/250 • For this class we will be using the RHEL6-030. The VM has all the required software to facilitate your learning and experience of the Red Hat Enterprise Linux OS.

  5. Lets Demo The VM - Classroom Environment

  6. Classroom EnvironmentVirtual Machine • VMs must be shut down via the normal “System Shutdown” after class ends to avoid confusion for the next class. • Do not click “X” on a VM once opened – it will put it in Suspend mode and will take a very long time when re-opening • Once you open the VM player via the “Student” account (password = redhat), you will see three VM options: RHEL6 030 RHEL6 130 RHEL 230/250 • Select the RHEL6 030 • 030 VM is a preconfigured VM with RHEL already installed; is ready to go for an 030 class (it has base and student RPMs installed).  A suggestion is to have the students change the view to Full Screen so they don’t get confused with the double menus on top of the screen (Host and VM)

  7. Red Hat Academy Curriculum Structure Red Hat Academy curriculum is structured enough to be programmatically managed, but flexible enough to present information in a manner that promotes effective learning by the student. The following sections describe the design elements that will become familiar to users of Red Hat Academy.

  8. Red Hat Academy Curriculum Structure Red Hat Academy courses draw from our corporate training courses, but greatly expands the material with many examples and exercises to provide a semester-long course appropriate for the academic environment. Courses: Currently, the following courses are offered through Red Hat Academy, with more to be offered in the future. RHA030: Red Hat Enterprise Linux Computing Essentials (10 workbooks) RHA130: Red Hat Enterprise Linux Core System Administration (10 workbooks) RHA230: Red Hat Enterprise Linux Network Applications (6 workbooks) RHA250: Red Hat Linux Security Administration (4 workbooks) Workbooks: RHA courses consist of multiple workbooks, which are designed to be a week or two of material, but vary in length depending on the nature of the material being covered. Each Workbook consists of multiple Lessons, a Pretest, Lab Test, and Exam.

  9. Certifications Red Hat Certified System Administrator — RHCSA: (Ready to administer Red Hat Enterprise Linux environments) Certification program requirements: • The Red Hat Certified System Administrator (RHCSA) exam consists of one section lasting up to 2.5 hours. • The certification exam is performance-based, meaning that candidates must perform tasks on a live system, rather than answering questions about how one might perform those tasks. • The hands-on nature of this exam make real-world experience a critical facet of preparation. • RHCSA certifications have a current window for 3 calendar years after they are earned. Red Hat Certified Engineer — RHCE: (Be a senior system administrator of Red Hat Enterprise Linux systems) • RHCE candidates must have earned their RHCSA certification to be eligible to become an RHCE. • An RHCE exam consists of 1 section lasting up to 2 hours. • The certification exam is performance-based, meaning that candidates must perform tasks on a live system, rather than answering questions about how one might perform those tasks. • The hands-on nature of this exam makes real-world experience a critical facet of preparation. • RHCEs, who are certified on Red Hat Enterprise Linux 6, will have a current status for 3 calendar years after it is earned For additional information about Red Hat Enterprise Linux certifications please go to: http://www.redhat.com/training/certifications/

  10. Questions Feel free to ask questions Your Instructor will have three responses: • “The answer is…” • “We’ll be discussing that in a future unit” • “I don’t know, but I will find out” It’s impossible to know everything, so feel free to share pertinent information as we go throughout the course since we can all learn from each other.

  11. Logistics • Security office – at the middle of the hall directly in front of the elevators • Restrooms (down the hall make a right and its on the left corner of the next hallway) • Snacks, drinks, places to eat • Cell phones turned off or set to silent mode • Computer lab closed after class, but is available for daytime use if a class is not scheduled; procedure = call 1st to check

  12. Class Schedule Each Saturday, the class will follow this schedule: Start class9:00am Breaks(2x15min)10:15am & 3:15pm Lunch12:30pm Resume class1:30pm Adjourn5:00pm

  13. About Your Course InstructorAugusto Delgado • Background and experience • Education • Current positions

  14. About You and Your Fellow Participants • Your name • Current position if presently employed • Background • Expectations

  15. Practicing Outside of the RHA030 Class Vulcan Linux Accounts introduction This is how you will be able to practice Linux commands from home or any internet connection

  16. LET’S GET STARTEDWorkbook 1:Quick Tour Key Concepts In Linux, user sessions are started by "logging in" to the machine. To login, you must have already been provided a username and password. If a Linux machine is running an X server, users may login using the graphical interface. Users may login on any of six virtual consoles. The CTRL+ALT+F2 through CTRL+ALT+F6 key sequences switch between the six virtual consoles. The CTRL+ALT+F1 key sequence switches to the default X server. If a Linux machine supports it, users can login in over the network using a remote shell. The who command lists which users are currently logged in, and how they logged on.

  17. Virtual Consoles Red Hat Enterprise Linux provides six "virtual consoles" that are available to users physically at the computer. The virtual consoles act like "dumb terminals". The virtual consoles are accessed using the CTRL+ALT+F2 through CTRL+ALT+F6 key sequences, with one virtual console mapped to each of the first 6 function keys. (If you are in a graphical environment, you should know that CTRL+ALT+F1 will return you to it before trying to switch to a virtual console.) Virtual Consoles work only on the host not the VMs

  18. The X Graphical Environment When running on modern personal computers, Linux uses a low level program known as the "X server" to provide the graphics environment. As a user of the system, you don't interact with the X server directly, but it provides the canvas for all of the graphical programs that you run. When the X server starts, usually as part of the system's startup sequence, it looks for the "first available" virtual console. If you are on a virtual console, and think that an X server is running on the machine, you can usually switch to it using the CTRL+ALT+F1 key sequence. Using the Login Manager: (How to login and out of the graphical environment)

  19. Terminals in the Graphical environment In Red Hat Enterprise Linux, the most commonly used terminal application is called gnome-terminal. A new gnome-terminal window can be opened by right-clicking on the desktop background, and choosing the top menu item in the pop-up menu, "Open in Terminal". Alternately, you may select the Applications : System Tools : Terminal menu item.

  20. Using the who command to determine who's on the system. Users can use the who command to determine who is on the system, and how they logged on. From any terminal, users can type who and hit the RETURN key. They should see output similar to the following. The first column lists the users who have logged on, and the last few columns the time that they logged on. With a little experience, the second column tells where the user logged on. For the first two users, elvis, and root, tty2 and tty3 refers to virtual consoles number 2 and 3, respectively. The first entry for blondie on tty1 with the :0, refers to the X server itself running on the first virtual console, and pts/0 refers to the first terminal opened within the X server. Without getting too bogged down in the details, we can see that elvis is logged on the second virtual console, root on the third, and blondie has logged in using the graphical environment.

  21. Logging into a machine over the network Using the ssh ("secure shell") utility, users can easily log in to remote machines, either in the same room, or halfway across the world. Assuming the remote machine is configured to allow remote logins, and the user has an account on the machine, logging in to a remote machine can be as easy as logging in on a virtual console. In the following example, elvis will login to a virtual console on the local machine, called station.redhat.com. He will then use ssh to login to the remote machine nimbus.example.com, potentially halfway around the world. Pay careful attention to the shell prompt in the following example. Because Linux users are often "hopping" from machine to machine using remote shells, the prompt has been designed to help the user keep straight what machine the shell is running on.

  22. Online Exercises Using multiple virtual consoles: • Press CRTL + ATL + F1 (Already shown a demo) • Power on VM RHEL6-030 • Click on “student” account Password = redhat Click on “Login” Applications > System Tools > Terminal • Lets change the password for users elvis: su - Password: redhat passwd elvis new password = redhat exit exit • System > Log Out student • Click on “elvis” account; password = redhat • Finished

  23. Chapter 2. The Kernel, Programs, and Processes The Linux Kernel The Linux kernel is an operating system, just as Windows, MacOS, and OS/2 are operating systems. The operating system is an environment in which programs run, providing mechanisms for programs to interact with the computer hardware. The kernel lets programs know when a keyboard key was struck, when the mouse moved, or when a packet destined for the program arrived over the network. The kernel allows programs to access the harddrive, perhaps to read a configuration files or store data. Just as it would be difficult to explain what a language is to people who have grown up only knowing about one language, it is often difficult to explain what an operating system is to people who are new to computers, or who have only used one operating system. The operating system operates at such a low level, that users don't interact with it directly, and often don't realize that the programs they are running are using it. Figure 2.1. The Kernel and Processes The Kernel and Processes

  24. Programs Programs are files that are stored on a computer's harddrive. A program is a series of very basic instructions, that tell the operating system what to do and when to do it in a very detailed and specific manner. The following might be the instructions written down in the file /usr/bin/gcalctool

  25. Processes When a user instructs the kernel to run a program, the kernel reads the instructions found in the program file, and loads them into memory. It then begins performing the instructions. The copy of the program running in memory is called a process. Note that the same program can be loaded into memory and run more than once, so that at any point the kernel might be running several processes which are instances of the same program. Linux, like most modern operating systems, is a multitasking operating system. This means that the kernel gives the appearance of running multiple processes simultaneously. In reality, the kernel is running a single process for a brief amount of time, usually on the order of 50 milliseconds. It then swaps that process out, and swaps in another one for its 50 milliseconds of action. Eventually, the kernel works its way through all of the processes and starts over again. The rapid switching from process to process gives the users of the machine the impression that all of the processes are running simultaneously.

  26. Shells Linux users often use a special type of program, called a shell, to interact with the kernel. The shell runs within a terminal, issuing a prompt and waiting to be told what to do. A user then asks the shell to run a program by typing in the name of the program. In the following example, the user elvis asks the shell to run a simple calendar program called cal. The shell dutifully executes the program, and reports the program's output back to the terminal:

  27. The ps command The ps command is commonly used to list processes running on a system. The ps command, without arguments, shows all of the processes that were started from a single terminal (or terminal window in a graphical environment). In the following example, elvis discovers that his terminal currently has two processes running: his bash shell, and the ps command itself. The first column shows the process's PID, or Process ID. Every process running on the system is identified by a unique PID. The second column identifies elvis's terminal, and the third column reports how much CPU time the process has consumed. The ps aux command shows a detailed list of all processes that are currently running on the system.

  28. Chapter 3. Examining the Filesystem Key Concepts • The base of the Linux directory tree is a directory named / and referred to as "the root directory". • Absolute file references, such as /home/elvis/lsout.txt, refer to files relative to the root directory. • Relative file references, such as lsout.txt, refer to files relative to a process's current working directory. • The ls command is used to list a directory's contents • The cat command is used to examine the contents of a file. • Using the > character from the shell's command line, the output of a command can be redirected from the terminal into a file. • A user's home directory is one of the few places where users are able to create new files.

  29. The Naming of Files and Directories In Linux, information and programs are stored on disks as files. Files are grouped into directories, which can contain files and other directories. (Other operating systems often refer to directories as "folders"). This hierarchy of directories containing directories is often referred to as the "directory tree". The base of the directory tree is a directory named simply /, and referred to as "the root directory". Files within the root directory can be referred to as /filename. In summary, there are always two ways to refer to a file. File references relative to the root directory always start with a leading /, and are called absolute references. File references relative to the current working directory start with something other than a /, and are referred to as relative references.

  30. Listing directory contents with ls From a shell, users use the ls command to list the contents of a directory. (Think of the ls as a shortening of the verb "list".) In the following example, the user elvis wants to list the contents of the /etc/sysconfig/rhn directory. The ls command, when called without arguments (i.e., without specifying a directory), lists the contents of the shell's current working directory. If using a color terminal, the ls command also colorizes the filenames to help distinguish which of the directory contents are regular files (white), and which are directories (blue). The ls command is a very flexible command that can provide a lot of different information. It will be discussed in more detail in later lessons.

  31. Viewing the contents of a file with cat While the ls command lists the files contained in a given directory, it does not reveal the contents of the files. While several commands are available for viewing files, the simplest command is cat. The cat command, when given a list of files, concatenates the files to the terminal output. If given one filename, the contents of that single file is displayed as output. In the following example, the user elvis wants to view the contents of the /etc/hosts configuration file. Note that if you ask cat to display a very long file, or a binary (non text) file, cat will happily comply. There are more sophisticated commands for browsing large files, a screen full at a time, which will be introduced later.

  32. Redirecting command output to files When the previous ls and cat commands were performed, their output was displayed on the terminal. In Linux, most commands which generate text output use a common Unix concept called the "standard out" stream. By default, this stream is connected to the terminal. The bash shell allows users to "redirect" the standard out stream to other locations. For now, we will only learn the simplest case: using the > character to redirect standard out into a file. In the following example, the user elvis is again going to list the contents of the /etc/sysconfig/rhn directory, but redirect the output into a newly created file. The output of the ls /etc/sysconfig/rhn command was not displayed on the terminal, but instead placed into the newly created file lsout.txt. elvis next takes a ls of his current working directory, and sees the newly created file. He then uses the cat command to observe the contents of the file. In "Unix speak", elvis "redirected the output from the ls command to the file lsout.txt".

  33. Permissions, and a user's home directory. Notice what happens when elvis tries to redirect output to a file somewhere other than his shell's current working directory. The user elvis has encountered another common Unix concept, that of file ownerships and permissions. elvis tried to create the new file /etc/lsout.txt, but elvis does not have permissions to create files in the /etc directory. By default, in Red Hat Enterprise Linux, users are not able to create files just anywhere. In fact, there are only a few places where files can be created. Every user has a home directory, where they can create new files (and new subdirectories). Fortunately, when user's log in to a Linux session, their shell uses their home directory as its current working directory. By default in Red Hat Enterprise Linux, a user's home directory is named /home/username, where username is replaced with the user's username.

  34. Online Exercises Chapter 3.  Examining the Filesystem The ls Command Lab Exercise Objective: Redirect command output into a newly created file. Estimated Time: 5 mins. Specification Use the ls command to list the contents of the /etc directory, redirecting the output of the command into a file called lsetc.txt in your home directory. Deliverables The file lsetc.txt in your home directory, which contains the output of the command ls /etc. Possible Solution The following command provides a possible solution to this exercise. [student@station student]$ ls /etc > lsetc.txt

  35. Chapter 4. Running Commands Key Concepts • Like any language, the bash shell uses a specific grammar. • The first word on any command-line is the name of the program to be run. • The behavior of commands can be modified with (usually optional) command line switches, which always start with one or two hyphens (- or --). • Any words that follow the command and any command line switches are called the arguments to the command. • Some command line switches also take arguments. • Commands usually support the --help, -h, or -? command line switch, which dumps a summary of how to use the command.

  36. Command Line Grammar If commands entered on the command line were compared to English sentences, the commands could be thought of as having verbs, adverbs, and direct objects. The verb is the command to run, the adverbs are the various command line switches that can be used to modify the behavior of the command (“quietly”, or “verbosely”), and any remaining words are the direct objects (what the command is supposed to act on). Again, as in languages, there are irregularities, and for almost every rule mentioned, there will be exceptions.

  37. Commands The first word on any command is generally the name of a program that lives as a file somewhere in the filesystem. [1] For example, the previous lessons used the ps and who commands. If we want to know which file contains these programs, there is a program called which which can help us. The which command, followed by the name of another command, will tell you "which" file is being run.

  38. Command Line Switches Many commands can have their behavior modified by specifying different command line switches. An easy example is the ls command, which is used to list the contents of a directory. Consider the following three uses of the ls command, each time listing the files in the /usr directory: The first ls command simply lists the contents of the directory. The second ls -s command, which includes the -s command line switch, gives the sizes of the contents as well. The third ls -l command gives a "long" listing

  39. Short Command Line Switches Notice that both switches used above, -s and -l, are single letter switches. These are referred to as "short" command line switches. Sometimes, short command line switches can also take an argument. For example, the ls command has a -w command line switch, which specifies how "wide" the output should be, in characters. Consider the following example. In this case, the word 40 is not considered an argument to the ls command, but instead it is an argument to the -w command line switch. (How wide should the output be? 40 characters.) Command line switch arguments simply follow the command line switch. How do you know which command line switches take arguments and which don't? The short answer is through experience, but we will soon mention ways to find help as well.

  40. Multiple Short Command Line Switches More than one command line switch can be used at a time. The multiple command line switches are simply bunched together, squeezed between the command and any command arguments. The following example introduces a new -r switch for the ls command, which reverses the sorting order. Note how it is used along with the -s and -w switches.

  41. Multiple Short Command Line Switches Often, when using multiple command line switches, users will take advantage of a shortcut that lets all of the switches be "piled together" onto one hyphen (-), as in the following example. All of the single letter switches that don't take an argument, in this case -s and -r, can be piled together, sharing a single -. If a switch does take an argument, such as -w 40, it can only share a hyphen if it comes last. That way, its argument can be specified next on the command line.

  42. Long Command Line Switches In the early days of Unix, all command line switches shared the syntax above. As Unix evolved, people came to see a need for what are called "long" command line switches. Rather than single letter switches, long switches are composed of words. And rather than starting with a leading hyphen, long switches are proceeded by double hyphens (--). Some commands use only short switches, some commands use long. Many commands, including ls, handle some of both.

  43. Arguments Compared to command line switches, arguments are easy. Whatever words are left over on the command line, after the command name and after any command line switches, are called arguments to the command. What a command expects as arguments, or if it expects any at all, depend on the command. For example, the ls command, if given arguments, will treat the arguments as the files or directories to be listed. The ps command expects no arguments. The cal command takes from zero to two, a possible month and a possible year to generate the calendar for. Learning what arguments a program expects, and what it does with its arguments, is part of learning how to use that command.

  44. Getting Help: Usage How does anyone remember all of these command line switches? They don't. But experienced Linux users learn how to easily refresh their memories. Most commands support either the --help long command line switch, or the -h or -? short command line switches. These switches usually make the command dump a "usage" message, rather than performing it's normal operation. The usage message contains a summary of what arguments are expected, what command line switches are supported and what they do. Note that the usage message generated by the ls command is rather long, and has been abbreviated in the output below.

  45. Chapter 5.  Managing Terminals Key Concepts • Various control sequences, such as CTRL+C, CTRL+D, and CTRL+Z, can be helpful for managing processes from the terminal. • A terminal's settings can usually be reset to a sane behavior with the reset command. • The bash shell provides tab completion, which can be save a lot of typing when specifying command or files. • Various types of terminals can be distinguished by knowing how Linux refers to devices.

  46. Controlling Terminals The bash shell, and the terminal it runs on, are the primary tools used by experienced Linux users. Later in this course, an entire Workbook will be devoted to using the bash shell's powerful features. This lesson introduces some features shared by terminals in general, and one feature of the bash shell that is too useful to delay until later, tab completion.

  47. Resetting Terminals When terminals display information, they usually display one byte at a time. When computers are handling human readable text, the characters are usually encoded as an integer byte value using the ASCII format. While a byte can encode up to 256 different values, only a small number of these (about 100) are used for text characters and punctuation. The others are used to encode control sequences (see below) and other special conditions. Sometimes, users accidentally (or intentionally) ask a terminal to display data that is not encoded as ASCII text, such as an image or an executable. The terminal does the best job it can, displaying characters for ASCII text, but what often appears to be random garbage for bytes that refer to control characters. Even worse, the terminal can end up in an alternate graphics mode, so that even what should be normal ASCII text looks unreadable. In these situations, the reset command can restore the terminal to sane behavior. Usually, when you'd like to use this command, you won't even be able to see yourself type it. However, if at an unreadable bash prompt, blindly typing reset and followed by the RETURN key will usually restore the terminal to sane behavior.

  48. Terminal control sequences Linux terminals share a lot in common with their primitive ancestors, teletypes and "dumb" or vt100-like consoles. These early devices had mechanisms for sending "out of band" signals, or sequences that signaled some event outside of the normal flow of typed characters, such as a backspace, a linefeed, an audible bell, or an end of transmission. Linux terminals, like their predecessors, use the CTRL key to send these "out of band" signals.

  49. Terminal control sequences The following table summarizes many of the commonly used control sequences that are shared by all Linux terminals, and their common usage, in alphabetical order. Following the table, the various control sequences are discussed in order of general usefulness.

  50. Terminal control sequences CTRL+C = MAKE IT STOP! CTRL+D = This control sequence is used to send an "End of Transmission" (usually interpreted as "End of File") to the listening process CTRL+Z is used to suspend a program, which can later be restored with the fg ("foreground") command. CTRL+U is commonly used to "wipe" the current line. If you have so mangled a bash command line that you just want to start over, type CTRL+U. Also, CTRL+U is very helpful when you mess up while entering a password.

More Related