sun certified system administrator examination for solaris\u2026 - Part I Sun Certified System Administrator Examination for Solaris 9 Study Guide Exam

Sun certified system administrator examination for solaris…

This preview shows page 1 out of 857 pages.

Unformatted text preview: Part I Sun Certified System Administrator Examination for Solaris 9 Study Guide, Exam 310-011 CHAPTERS 1 Understanding System Concepts 9 Working with Files and Directories 2 Administering the Boot PROM 10 Understanding the Boot Process 3 Installing the Solaris 9 Operating Environment 11 Configuring Disks 4 Initialization and Shutdown 12 Working with the format Command 5 User Administration 13 Performing Backup and Recovery 6 Solaris File Security 14 Utilizing Basic Command Syntax 7 Understanding Process Control 15 Working with the vi Editor 8 Working with File Systems 16 Working with a Remote Connection 1 Understanding System Concepts CERTIFICATION OBJECTIVES 1.01 Defining System Administration Terms 1.02 Defining the Effects of Various man Command Options in Viewing Online Manual Pages ✓ Q&A Two-Minute Drill Self Test 4 Chapter 1: Understanding System Concepts T o truly understand any machine, you must first understand its function and parts. Then you must understand how those parts work together to perform the machine’s function. This chapter touches on all three topics—function, parts, and how the parts work together—in very general terms. The rest of the book goes into specific detail, but first you need to understand some common terms. This chapter covers the basic terminology in system administration and the use of the man command. This command is a starting point designed to give you the foundation on which the rest of the book builds. CERTIFICATION OBJECTIVE 1.01 Defining System Administration Terms This section introduces you to the basic terminology that you’ll need to understand in your role as system administrator. Daemons Many sysadmins are quick to point out that a daemon is not a demon. Even though it might sometimes seem like it, your server is not possessed by a devil. (Some of your users might be, but not your server.) A daemon is defined as a program that runs in the background, disconnected from a terminal or a particular login session. It is often used to manage system functions. The term “daemon” is derived from Greek mythology. The ancient Greeks called a supernatural being that acted as an intermediary between the gods and man a daemon. This is an accurate description of what a UNIX daemon does for you. Basically, a daemon is always there, waiting to be called on to perform some action or service. Daemons are running on a system for every service the system provides. However, don’t confuse the terms “daemon” and “process.” A process is an instance of a running program. So although a daemon is a process, a process isn’t necessarily a daemon. You can see all the processes that are running on your system by using the ps command, which displays all the processes at once. These processes can comprise one big list, even on a little-used system. Naturally, Defining System Administration Terms 5 with the use of command options, you can use the ps command to display only the information you’re looking for. The ps command is covered in more detail in Chapter 7, but for now, let’s take a look at some of the daemons that are running on your system. EXERCISE 1-1 Viewing the Processes on a System Let’s first take a look at what is going on behind the scenes on your Solaris system. For this exercise, your system’s hostname is enterprise.timgibbs.net. 1. Log in to the system: Trying 192.168.0.2... Connected to enterprise. Escape character is '^]'. SunOS 5.9 login:gibbst password: ********** Last login: Tue Apr 3 19:12:13 from :0 Sun Microsystems Inc. SunOS 5.9 Welcome to enterprise.timgibbs.net [enterprise: gibbst] $ 2. List the processes. Now you’ve logged in to enterprise as the user gibbst and seen a message from the very conscientious system administrator regarding a planned outage. 3. Now look at the processes, including the daemons, that are currently running on enterprise by using the following ps command: [enterprise: gibbst] $ ps -ef | more UID PID PPID C STIME TTY TIME CMD root 0 0 0 Mar 20 ? 0:03 sched root 196 1 0 Mar 20 ? 0:16 /usr/sbin/nscd root 206 1 0 Mar 20 ? 0:00 /usr/lib/lpsched root 177 1 0 Mar 20 ? 0:01 /usr/sbin/syslogd root 268 1 0 Mar 20 console 0:00 /usr/lib/saf/ttymon -g -h -p cc9972-b console login: -T sun-color -d /dev/cons root 158 1 0 Mar 20 ? 0:01 /usr/sbin/inetd -s root 157 1 0 Mar 20 ? 0:00 /usr/lib/nfs/lockd daemon 160 1 0 Mar 20 ? 0:00 /usr/lib/nfs/statd root 186 1 0 Mar 20 ? 0:01 /usr/sbin/cron --More-- 6 Chapter 1: Understanding System Concepts The ps command is used here with the e and f options. This command displayed every process in a full listing. Because the list would easily cover more than one screen, we piped ( | ) the display into the more command. This way, you can see one screen at a time, and by pressing the SPACEBAR, you see more of the display. The ps command is covered in more detail in Chapter 7. For now, let’s go daemon hunting! 4. Examine the following line, which is bolded in the preceding ps command output: root 206 1 0 Mar 20 ? 0:00 /usr/lib/lpsched This is one of the daemons running on the system named enterprise. It’s the printer spooling daemon, lpsched. This daemon waits for print requests, and then sends the print job to the requested printer. The lpsched daemon is always running, waiting for a print job to come in. Remember that most daemons end with the letter d. Most are started by initialization scripts at boot time, but this is configurable. Daemons can be stopped or restarted as needed. You often have to restart a daemon after making a configuration change to its service, or, to fix a stuck print queue, you might have to stop and start the print spooler daemon. Shells A shell is the interface between the user and the kernel. It’s the means by which you communicate commands. There are many kinds of shells. This section focuses on three of the most popular: Bourne, C, and Korn. The Bourne shell was written by S. R. Bourne and can be found on nearly all UNIX systems. It lacks some of the bells and whistles of others, but it remains one of the most prevalent shells in UNIX. The shell is located in /bin/sh and uses a dollar sign ($) at the user prompt. Shell scripts are most often written to be run by the Bourne shell because of its excellent input/output control and expression-matching features. However, many people feel it lacks strong interactivity features. To answer this need, pioneers at the University of California at Berkeley developed the C shell. This shell, located in /bin/csh and using a percentage symbol (%) at the user prompt, provides features not found in Bourne, such as job control, command history, and aliasing. The C shell is designed to use command syntax that resembles C, the programming language used to write UNIX. However, many people feel that it lacks strong control of input and output. Defining System Administration Terms 7 In an effort to combine the best of both the Bourne and C shells, David Korn developed the Korn shell, which can be found in /bin/ksh and uses a dollar sign ($) at the command prompt. The Korn shell is a superset of the Bourne shell, but it adds features such as aliasing, history, and the popular command-line editing. These three shells are provided as part of the Solaris operating environment. They are covered in more detail later in Chapter 14, but for now, let’s take a look at how to try a new shell. EXERCISE 1-2 Changing the Shell When you create a user, the default shell assigned to that user is the Bourne shell. Let’s walk through the steps you as the sysadmin can use to change a user’s shell. Once again, we’ll use a Solaris 9 system named enterprise as our example. 1. Log in to the system and find out which shell you are using: Trying 192.168.0.2... Connected to enterprise. Escape character is '^]'. SunOS 5.9 login:gibbst password: ********** Last login: Tue Apr 4 17:22:10 from :0 Sun Microsystems Inc. SunOS 5.9 Welcome to enterprise.timgibbs.net [enterprise: gibbst] $ echo $SHELL /bin/sh Here we have logged in as the user named gibbst. Using the echo command, you can see that the SHELL variable is set to /bin/sh. This tells you that you are currently using the Bourne shell. Now, let’s change the shell. 2. Switch to the root account: Su password: ********** Sun Microsystems Inc. SunOS 5.9 BUGGER – Not Happy Jan! [enterprise: root] # Now you are the superuser, or root, of enterprise. Notice how the command prompt has changed from the user prompt dollar sign ($) to the root prompt pound sign (#). 8 Chapter 1: Understanding System Concepts 3. Execute the command passwd -e to change the shell from the user named gibbst: [enterprise: root] # passwd -e gibbst The current shell will be displayed and you will be prompted for the new shell: old shell/bin/sh New shell:/bin/csh [enterprise: root] # Now, the next time you log in as the user gibbst, you will use the C shell to do so. By default, users can’t use the passwd -e command to change their shells; only the root user can do so. A user can, however, use another shell by changing the SHELL variable. This can be done by editing the user’s .profile file in his or her home directory or from the command line. File Systems A file system is a collection of directories and files organized in a hierarchical structure. A file system has a one-to-one correspondence with physical storage, such as a disk partition, or a virtual device presented by Solstice DiskSuite or Veritas Volume Manager (either of which may contain one or more physical devices). The root directory or root (/) file system is the absolute parent of all other directories and file systems. Under the slash (/), other file systems are connected to the root file system. Before a disk partition or virtual disk can be accessed, it must first have a file system written on it. The newfs command does this for you. Once the partition contains a file system, the mount command attaches the new file system to the mount point: the location (directory) on the parent file system where a separate file system may be attached. File systems can be identified by the special lost+found directory that exists under the SCENARIO & SOLUTION How can you tell which shell you’re using? Use the command echo $SHELL to see what your shell variable is set to. How can you find out more about your shell’s capabilities? Use the man command. For example, man csh will give you a good overview of using the C shell. Defining System Administration Terms 9 mount point for every file system. One benefit of creating separate file systems is that data written to one cannot overflow into another. Having /export/home as a separate file system prevents users from filling up the root file system and crashing the server. The UNIX file system is hierarchical; therefore, files are identified by their full path. Executing a command against the hosts file may produce unpredictable results. However, using the hosts file full path of /etc/inet/hosts guarantees that the operation is applied to the correct file. If you want to use the cp command to copy a file named foobar.tim to your home directory, you have to tell the cp command exactly where the file is located, and exactly where you want it to go: [enterprise: root] # cp /export/home/gibbst/foobar.tim /export/home/tim This is an actual conversation I had with a coworker recently: Me: Hey, find /1st_floor -name “Scott.” Coworker: cd /1st_floor/breakroom; ls | grep coffee. For this reason, it often seems like UNIX sysadmins are speaking another language. Kernels A kernel is the very heart of an operating system. It communicates instructions to the hardware and schedules and executes all the system commands. It manages all the daemons, devices, and system resources such as memory, swap space, and file systems. When you are running a shell program, such as the Bourne shell, you are using that program to communicate with the kernel. The kernel is loaded during the boot process and must be running for the system to operate. The kernel-specific files can be found in the following directories: ■ /kernel This directory contains all the common kernel components that are needed for booting the system. ■ /platform/<platform-name>/kernel This directory contains the components that are needed for a specific type of platform. For example, on an Intel system, this directory is /platform/i86pc/kernel. ■ /platform/<hardware-class-name>/kernel This directory contains the kernel components specific to this hardware class. ■ /usr/kernel This directory contains kernel components common to all platforms within a particular instruction set. 10 Chapter 1: Understanding System Concepts On occasion, you might have to reconfigure the parameters of a Solaris kernel to tweak it for optimal performance—the installation of a database application, for example. Make sure that you have read the instructions carefully and tested the changes on a test system before you do it on a missioncritical system! Without a bootable kernel, you don’t have a bootable system, which could get you booted out the door. Operating Systems An operating system is a set of programs that manage all system operations and provide a means of communication between the user and the resources available to that user. An operating system consists of the kernel and the shell. This chapter already defined the kernel and the shell. To fully understand operating systems, it is also essential that you understand hardware, which is discussed in later chapters. The definitions of a shell and an operating system are similar. Both are used to communicate instructions, but remember that a shell is a component of an operating system. Sun Microsystems refers to Solaris 9 as an operating environment. What’s the difference between an operating environment and an operating system? Consider the analogy that both are like a shelter in which you live. An operating system provides you with the bare essentials. It’s like a tent that contains food, a sleeping bag, and a T-1 connection to the Internet. If you’re talking bare essentials, you could probably get by without the sleeping bag. In contrast, an operating environment is like a house with running water, electricity, home entertainment system, walk-in meat locker, hot tub, and so on. An operating environment includes all the bells and whistles that make running the system easier and more fun. Solaris 9 is designed from the ground up as a server operating environment. You won’t find games, cute sound effects, or 3-D wallpapers included with the installation. However, it does have some very handy administrative applications and features, such as these: ■ IPv6 compatibility The latest version of Internet Protocol allows for better security and increased available addresses. ■ Solaris smart card This allows a sysadmin to add more security by requiring users to be validated with a personal ID card. Defining the Effects of Various man Command Options in Viewing Online Manual Pages 11 ■ PDA synchronization Using this feature, users can transfer contact, calendar, and mail data between their Solaris 9 system and their personal digital assistants (PDAs). ■ GNU tools Perl, Apache, bash, and a few other GNU free popular utilities are now included with Solaris 9. ■ X Server This feature has been upgraded to allow for better mobility and ease of use, compatibility with EnergyStar, better power management, and web-based access. These are just some of the features of the Solaris 9 operating environment that make it an industry standout. Sun Microsystems announced it would drop the CDE and OpenWindows GUIs in favor of GNOME 2 in Solaris 9, but it may not be ready in time for the Solaris 9 release. Although these changes might affect how users access their workstations, you shouldn’t get bogged down trying to learn how to use one kind of GUI over another. Your worth as a sysadmin will be measured at the command line, not among icons. CERTIFICATION OBJECTIVE 1.02 Defining the Effects of Various man Command Options in Viewing Online Manual Pages Without a doubt, no matter how far your journey into Solaris takes you, the beacon that you can depend on is the man command. Short for manual, the man command is the way you access information about the commands and configuration files on your system. It’s not a difficult command to learn or use. The syntax of the man command is man < command_name> Let’s look at how to use the command to get information on another helpful command, the ls command. 12 Chapter 1: Understanding System Concepts EXERCISE 1-3 Using the man Command 1. Log in to the system: [voyager: gibbst]$ telnet enterprise Trying 192.168.0.2... Connected to enterprise. Escape character is '^]'. SunOS 5.9 login:gibbst password: ********** Last login: Tue Apr 8 11:44:12 from :0 Sun Microsystems Inc. SunOS 5.9 Welcome to enterprise.timgibbs.net [enterprise: gibbst] % 2. Use the man command to get information about the ls command: [enterprise: gibbst] % man 1s Reformatting page. Please Wait... done User Commands ls(1) NAME ls - list contents of directory SYNOPSIS /usr/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [ file ... ] /usr/xpg4/bin/ls [ -aAbcCdfFgilLmnopqrRstux1 ] [ file ... ] DESCRIPTION For each file that is a directory, ls lists the contents of the directory; for each file that is an ordinary file, ls repeats its name and any other information requested. The output is sorted alphabetically by default. When no argument is given, the current directory is listed. When several arguments are given, the arguments are first sorted appropriately, but file arguments appear before directories and their contents. --More--(10%) The output of the man command is shown one screen at a time; the preceding excerpt shows the contents of the first screen. As you can see, the man command shows you a brief description of the command, its syntax, and more detailed Defining the Effects of Various man Command Options in Viewing Online Manual Pages 13 information on its use. The man command also displays the revision history of the command and, in most cases, its author. Man pages are marked with either nroff tags or Standard Generalized Markup Language (SGML). Both of these methods are used to mark a document with tags to describe how to read the text. For now, let’s just say that they are similar to HTML, used to tell a web browser how to display a web page. That’s why when you start the man command, it says, “Reformatting page. Please Wait…done” before displaying the page. The command reads the document’s tags to display it on your screen correctly. The man pages are usually kept in /usr/share/man. The man pages using SGML tags are found in /usr/share/man/sman*; the man pages using nroff tags are kept in /usr/share/man/man*. The directories are searched in the order specified in the /usr/share/man/man.cf file. The man command also includes some handy options you can use: -k - The keyword switch You use the -k switch to find information using a keyword search. The syntax for using this option is man -k <keyword> For example, say you wanted to find information on viewing documents in the PDF format. You would type man -k PDF Then the man command displays all the commands that deal with PDF documents. Actually, it displays all the commands that have PDF in their man pages. Here’s another example: -M - The path command Use this option if you want the man command to search for a command in a directory not specified in the /usr/share/man/man.cf file. The syntax for using this option is man -M <path_name> For example, let’s say you’ve loaded an application that has installed its man pages into a directory not specified by the MANPATH variable or in the /usr/share/man/man.cf 14 Chapter 1: Understanding System Concepts file, but into the /opt/app/man directory. To view information on a command from the man pages in that directory, type the following: man -M /opt/app/man <command_name> This command forces the man command to look only in the named path for the man page on...
View Full Document

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture