Solaris™ Operating Environment System Administrator's Guide
Solaris™ Operating Environment System Administrator's Guide
Table of Contents
Solaris Operating Environment System Administrator's Guide, Fourth Edition By Janice Winsor
Publisher: Prentice Hall PTR Pub Date: May 23, 2003 ISBN: 0-13-101401-3 Pages: 528
The definitive, quick-answer resource for every Solaris 9 sysadmin. Fully updated! Covers Solaris 9 new Flash Install and Live Upgrade installation features, Secure Shell network commands, and much more Administering users, devices, systems,networks, and printing Maximizing efficiency, productivity, and system availability Fast solutionsfor every Solaris 9 system administration challengedirectfrom Sun! Solaris Operating Environment System Administrator's Guide, Fourth Edition is the definitive quickstart tutorial for every new Solaris system administratorand the ideal fast-access reference for every Solaris administrator, regardless of experience. Fully updated to reflect Solaris 9's newest features and management tools, it covers day-to-day administration tools and demonstrates how to maximize efficiency, reliability, and availability in any Solaris environment. Coverage includes all this, and much more NEW! Secure Shell network commands NEW! Flash Install and Live Upgrade installation features
NEW! Allocate/deallocate/list devices commands; cdrw, rmformat, ssh commands; and more Basic administration: superuser status, boot processes, monitoring, and communicating with users Solaris commands: user and environment information, working with files and disks, redirecting output, reading manual pages, and more Solaris shells: Bourne, C, Korn, Bourne-Again, TC, and Z User administration: User accounts, file systems, and roles-including Role Based Access Control (RBAC) Device/system administration: Service Access Facility, configuring additional swap space, creating local e-mail aliases, and more Network services: remote administration, NIS+, IPv6, and more From startup to backup, security to printing, this book delivers clearly written, accessible information you'll use todayand every day. [ Team LiB ]
[ Team LiB ]
Table of Contents
Solaris Operating Environment System Administrator's Guide, Fourth Edition By Janice Winsor
Publisher: Prentice Hall PTR Pub Date: May 23, 2003 ISBN: 0-13-101401-3 Pages: 528
Copyright Acknowledgments Preface A Quick Tour of the Contents Important: Read This Before You Begin Conventions Used in This Book Solaris Management Console Tools SPARC and IA Information Solaris System Software Evolution Freeware Chapter 1. Introducing Solaris System Administration Defining the System Administrator's Job Understanding Superuser Status Communicating with Users Starting Up Systems Monitoring Processes Reviewing Essential Administration Tools Chapter 2. Using Basic OS Commands Finding User Information Creating and Editing Files (cat, touch, cp, mv, vi)
Using Manual Pages Finding Disk Information Chapter 3. Understanding the Flash Install and Live Upgrade Features Flash Installation Solaris Live Upgrade Chapter 4. Understanding Shells Tasks Common to All Shells The Bourne Shell The C Shell The Korn Shell The Bourne-Again Shell The TC Shell The Z Shell Chapter 5. Administering User Accounts and Groups Tools for Adding and Administering User Accounts Adding User Accounts Setting Up and Administering Groups Using Solaris User Registration Chapter 6. Administering Rights and Roles Using SMC to Grant Access Rights to Users Using SMC to Administer Role Accounts The RBAC Databases Commands for Managing Role-Based Access Control Chapter 7. Administering File Systems What's New in File Systems in the Solaris 9 Release What's New in File Systems in the Solaris 8 Release Types of File Systems The Default Solaris File System The Virtual File System Table (/etc/vfstab) File System Administrative Commands Making File Systems Available Checking the Data Consistency of a File System (fsck) Backing Up and Restoring File Systems Cache File Systems Chapter 8. Administering Devices What's New in Device Management in the Solaris 9 Release Automatically Configuring Devices Allocating Devices Using SCSI and PCI Hot-Plugging Specifying Device Names Using Tapes
Accessing Removable Media Devices Using DVD-ROM Devices Using Jaz or Zip Drives Writing CD Discs Volume Management Using Diskettes Without Volume Management Administering Disks Understanding the Service Access Facility Setting Up a Bidirectional Modem Using a Modem Chapter 9. Administering Systems Displaying System-Specific Information Configuring Additional Swap Space (mkfile, swap) Creating a Local Mail Alias (/etc/mail/aliases) Chapter 10. Administering Network Services Configuring Systems for a Network Checking on Remote System Status Logging In to a Remote System (rlogin) Logging Out from a Remote System Transferring Files Between Systems (rcp, ftp) Administering NIS+ Databases Using SMC Computers and Networks Tool Introducing the IPv6 Internet Protocol Showing Network Status (netstat) Displaying Network Interface Parameters (ifconfig) Displaying Packet Contents Secure Shell Commands Chapter 11. Administering Printing What's New in Printing in the Solaris 9 Release What's New in Printing in the Solaris 8 Release Solaris Print Package Redesign Print Administration Tools in the Solaris Environment Choosing a Method to Manage Printers Introducing the LP Print Service Understanding the Structure of the LP Print Service Using the SunSoft Print Client Setting Up Printing Services Using Printing Commands Chapter 12. Recognizing File Access Problems Recognizing Problems with Search Paths Recognizing Problems with Permissions and Ownership Glossary
[ Team LiB ]
[ Team LiB ]
Copyright
2003 Sun Microsystems, Inc. Printed in the United States of America. 901 San Antonio Road, Palo Alto, California 94303 U.S.A. All rights reserved. This product and related documentation are protected by copyright and distributed under licenses restricting its use, copying, distribution and decompilation. No part of this product or related documentation may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the United States Government is subject to the restrictions as set forth in DFARS 252.227-7013 (c)(1)(ii) and FAR 52.227-19. The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications. TRADEMARKSSun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook2, NFS, SunOS, WebNFS, Solaris, DeskSet, Java, JavaStation, JumpStart, OpenWindows, Solstice, Solstice AdminSuite, Solstice DiskSuite, SunSoft, iPlanet, OpenBoot, Solstice Backup, Solstice Enterprise Agents, Sun Blade, Sun Fire, Sun Ray, Solaris Web Start are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based on an architecture developed by Sun Microsystems, Inc. UltraSPARC is licensed exclusively to Sun Microsystems, Inc. All other products or services mentioned in this book are the trademarks or service marks of their respective companies or organizations. DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. 10 9 8 7 6 5 4 3 2 1 Printed in the United States of America Editorial/production supervisor: Wil Mara
Cover design director: Jerry Votta Cover designer: Kavish & Kavish Digital Publishing and Design Manufacturing manager: Alexis R. Heydt Marketing manager: Debby van Dijk Executive editor: Gregory G. Doench Sun Microsystems Press Publisher: Myrna Rivera Sun Microsystems Press A Prentice Hall Title [ Team LiB ]
[ Team LiB ]
Acknowledgments
Many people contributed to the design, writing, and production of the fourth edition of this book. Sun Microsystems Press and the author would like to thank the following people for their contributions. Gordon Marler for his excellent technical input and many examples. Gordon unpacked his first Sun workstation in 1987 and has been fascinated by UNIX ever since. He has worked as a UNIX System Administrator and Architect in Texas, Washington state, and New York City for various firms in the pharmaceutical, telecommunications, and financial fields, as well as a government contract here and there. He is currently a UNIX System Engineer for a global financial service institution and lives in New Jersey. Peter H. Gregory, author of Solaris Security and Sun Certified System Administrator for Solaris 8 Study Guide, for organizing Gordon's help as a technical reviewer. Bill Lane, Sun Microsystems, Inc., for enabling the author to participate in the Solaris 9 Beta program and to Larissa Brown, Miguel Ulloa, and Beauty Shields, for help with administrative details. James Litchfield, Senior Staff Engineer, Solaris System Resource Services, Sun Microsystems, Inc., for information about new functionality in the Solaris 9 release. Gary M. Gere, Sun Microsystems, Inc., for answering questions about Live Install functionality. Matthew Williamson, Engineering Manager, Solaris Installation Infrastructure, Sun Microsystems, Inc., for answering questions about Live Install functionality and for reviewing Chapter 3, "Understanding the Flash Install and Live Upgrade Features." The following members of the Solaris 9 Beta team, listed in alphabetical order, who were instrumental in answering questions and responding to my Solaris 9 Beta problem reports: Sally Beach, Tom Hardesty, and Beauty Shields. Linda Gallops, Sun Microsystems, Inc., for technical help. Those writers from Sun Technical Publications who contributed to the Solaris System Administration Guides Volumes I, II, and III, which were used as a technical reference resource. The author would especially like to thank Mike Alread and Myrna Rivera of Sun Microsystems Press and Greg Doench, Senior Editor, Prentice Hall, for their unfailing enthusiasm, support, and friendship, Mary Lou Nohr for editing this manuscript with her usual skill and tact, and Wil Mara of Prentice Hall for production. Thanks to the following people who contributed to the third edition of this book. Peter Gregory, HartGregory Group, for reviewing the technical information in this book and for useful suggestions about adding new information. Linda Gallops, Sun Microsystems, Inc., for technical help. Mary Lautner, Sun Microsystems, Inc., for providing useful information about the Solaris 8 release.
John Stearns, Technical Publications Manager, SSE Group, Sun Federal, Sun Microsystems, Inc., for providing answers to questions about Role-Based Access Control (RBAC) features. Mary Lautman, Sun Microsystems, Inc., for providing answers to questions about Role-Based Access Control (RBAC) features and providing valuable input to Chapter 5. Larissa Brown, Sun Microsystems, Inc., for helping put me in contact with the right people to help with new Solaris 8 functionality. Those writers from Sun Technical Publications who contributed to the Solaris System Administration Guides Volumes I, II, and III, which were used as a technical reference resource. The author would especially like to thank Rachel Borden of Sun Microsystems Press and Greg Doench, Senior Editor, Prentice Hall, for their unfailing enthusiasm, support, and friendship, Mary Lou Nohr for editing this manuscript with her usual skill and tact, and Wil Mara of Prentice Hall for production. Thanks to the following people, who contributed to the second edition of this book. Brett Bartow, Acquisitions Editor, Macmillan Technical Publishing, for his enthusiasm and support on this project. Mary Lautner, Program Manager, Sun Microsystems, Inc., for her invaluable help and assistance in providing the author with documentation and answers to numerous questions. Without Mary's help and the information she provided, the author would have been unable to complete this project. Those writers from SunSoft Technical Publications who contributed to the Solaris System Administration Guide, which was used as a technical reference resource. Lisa Gebken of Macmillan Technical Publishing for editing this manuscript. Tobin Crockett, for networking the author's SPARCstation 10 and Macintosh PowerPC and setting up a network printer. Rob Johnston, System Support Specialist, Sun Microsystems Computer Company, for installing Solaris 2.6 and troubleshooting hardware and software problems. Tien Nguyen, System Support Specialist, SunSoft, Inc., for help in troubleshooting hardware and software problems. Linda Gallops, SunSoft SQA, for help in tracking down information about modems. Ken Erickson of SunSoft, for allowing the author to pester him with occasional technical questions. The author would especially like to thank Rachel Borden and John Bortner of Sun Microsystems Press for their unfailing enthusiasm, support, and friendship. Thanks to the following people, who contributed to the first edition of this book. Connie Howard and Bridget Burke, SunSoft Publications managers, for their support and encouragement. Randy Enger, SunSoft Engineering Manager, for help in gaining early access to the Solaris 2.1 administration tools. Special thanks are also due to Gordon Kass, Solaris 2.1 Product Manager, and Steve Hanlon, SunSoft Marketing.
Patrick Moffitt, SunOS Ambassador, for providing background information about the Service Access Facility. Patrick Moffitt and Cindy Swearingen, Technical Education Services, for providing a modem procedure that worked. Rick Ramsey, SunSoft Technical Writer, for source information about NIS+, and for many discussions about good technical writing. Keith Palmby, SunSoft Technical Writer, for source information about user environments. Charla Mustard-Foote, SunSoft Technical Writer, for providing source information and the conversion table for Appendix A, and for calmly helping make software available for screen shots. Bruce Sesnovich, SunSoft Technical Writer, for providing background information about the Service Access Facility and modem procedures. Tom Amiro, SunSoft Technical Writer, for providing background information about administering user accounts and printers, and for early access to information about the Solaris 2.1 administration tools. Tom also deserves thanks for help in making software available for screen shots. John Pew, Writing Consultant, for providing information and filters for converting raster files to GIF format. Bill Edwards, Dave Miner, Jeff Parker, Chuck Kollars, Ken Kane, and Paul SawyerSunSoft Engineers in Billerica, MAdeserve thanks for reviewing information about NIS+ security, Administration Tool security, Database Manager, and User Manager. Sam Cramer, SunSoft Engineer, for help with file system information. Bill Shannon, SunSoft Distinguished Engineer, for help with backup and restore information. Pat Shriver, SunSoft Engineer, Robin Greynolds, SunSoft System Administrator, and Craig Mohrman, SunSoft Engineer, for technical review. Karin Ellison, SunSoft Press, for parenting this book and for extraordinary assistance, including providing a Solaris 2.0 system for use on this project. Thanks are also due to Melinda Levine, our editor at Ziff-Davis Press, and to Cheryl Holzaepfel, Managing Editor, for being so easy to work with. And lastly, thanks to the engineers, writers, and marketing folks at SunSoft who helped with the SunSoft version of this book. [ Team LiB ]
[ Team LiB ]
Preface
This book is for beginning system administrators, system administrators new to the Solaris Operating Environment, or any user who wants a task-oriented quick-reference guide to basic administrative commands. [ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
CAUTION. If /usr/ucb is included in a search path, it should always be at the end. Commands like ps or df are duplicated in /usr/ucb with different formats and options from those of Solaris commands.
This book does not contain all the information you need to administer systems. Refer to the complete system administration documentation for comprehensive information. Because the Solaris Operating Environment provides the Bourne (default), Korn, and C shells, examples in this book show prompts for each of the shells. The default C shell prompt is system-name%. The default Bourne and Korn shell prompt is $. The default root prompt for all shells is a pound sign (#). In examples that affect more than one system, the C shell prompt (which shows the system name) is used to make it clear when you change from one system to another. [ Team LiB ]
[ Team LiB ]
Variables
Variables are in an italic typeface. When following steps, replace the variable with the appropriate information. For example, the step to print a file instructs you to "type lp filename and press Return." To substitute the file named quest for the filename variable, type lp quest and press Return.
Mouse-Button Terminology
This book describes mouse buttons by function. The default mouse button mapping is shown below. SELECT is Left. ADJUST is Middle. MENU is Right. Use the SELECT mouse button to select unselected objects and activate controls. Use the ADJUST mouse button to adjust a selected group of objects, either adding to the group or deselecting part of the group. Use the MENU mouse button to display and choose from menus.
Platform Terminology
In this document, the term IA (Intel Architecture) is used instead of x86 to refer to the Intel 32-bit processor architecture, which includes the Pentium, Pentium Pro, Pentium II, Pentium II Xeon, Celeron, Pentium III Xeon processors, and comparable microprocessor chips made by AMD and Cyrix.
Storage-Medium Terminology
In this book, we distinguish between three different types of media storage terminology in the
following way. Disc is used for an optical disc, CD-ROM, or DVD disc. Disk is used for a hard-disk storage device. Diskette is used for a floppy diskette storage device. (Note: Sometimes, screen messages and mount points use the term floppy.)
Icons
Marginal icons mark information that is new in this edition. The new information is new with the Solaris 9 Operating Environment. Other new information may have been available in previous releases but was not included in the third edition. Where possible, the text indicates the release number when the command or functionality was added. [ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
Administration Tool adds a graphical user interface Serial Port Manager with templates that provide default settings, which makes adding character terminals and modems much easier. The automounter subsystem is split into two programs: an automounted daemon and a separate automount program. Both are run when the system is booted. The loadable autofs kernel module enables automounted file systems to be part of a virtual file system (VFS). Mount points under the automounter's control are real mount points instead of symbolic links, and the /tmp_mnt mount point is no longer needed. Additional predefined automount map variables are provided. (Refer to the Solaris Advanced System Administrator's Guide.) Online: Backup 2.1 is included with the release. (Not documented in this book.)
Release
New Features Pluggable Authentication Model (PAM) is included with the release. PAM provides a consistent framework to enable access control applications, such as login, to be able to choose any authentication scheme available on a system, without changing the login program itself. (Refer to the Solaris Advanced System Administrator's Guide.) C2 Security is included in this release. (Not documented in this book.) The format(1) command changes for SCSI disks. (Not documented in this book.) PPP network protocol product that provides IP network connectivity over a variety of point-to-point connections is included in this release. (Not documented in this book.) Cache File System (CacheFS) for NFS is included in this release. CacheFS is a generic, nonvolatile caching mechanism to improve performance of certain file systems by using a small, fast, local disk. New NIS+ setup scripts are included in this release. The nisserver(1M), nispopulate(1M), and nisclient(1M) scripts enable you to set up an NIS+ domain much more quickly and easily than if you used the individual NIS+ commands to do so. With these scripts, you can avoid a lengthy manual setup process.
New Motif GUI for Solaris software installation is added. (Not documented in this book.) New pax(1M) portable archive interchange command for copying files and file systems to portable media is added. Admintool is used to administer only local systems. The Solstice AdminSuite product is available for managing systems in a network for SPARC and IA systems. New process tools are available in /usr/proc/bin to display highly detailed information about the active processes stored in the process file system in the /proc directory. Telnet client is upgraded to the 4.4 BSD version. rlogind and telnetd remote login capacity are improved. (Not documented in this book.)
The limit on user ID and group ID values is raised to 2147483647, or the maximum value of a signed integer. The nobody user and group (60001) and the no access user and group (60002) retain the same UID and GID as in previous Solaris releases. Changes to the Solaris 2.6 printing software provide a better solution than the LP print software in previous Solaris releases. You can easily set up and manage print clients by using the NIS or NIS+ nameservices to enable centralization of print administration for a network of systems and printers. New features include redesign of print packages, print protocol adapter, bundled SunSoft Print Client software, and network printer support. New nisbackup and nisrestore commands provide a quick and efficient method of backing up and restoring NIS+ namespaces.
Release
New Features New patch tools, including patchadd and patchrm commands, add and remove patches. These commands replace the installpatch and backoutpatch commands that were previously shipped with each individual patch. (Refer to the Solaris Advanced System Administrator's Guide.) New filesync command ensures that data is moved automatically between a portable computer and a server. (Not documented in this book.) The previous flat /proc file system is restructured into a directory hierarchy that contains additional subdirectories for state information and control functions. This release also provides a watchpoint facility to monitor access to and modifications of data in the process address space. The adb(1) command uses this facility to provide watchpoints. Large files are supported on UFS, NFS, and CacheFS file systems. Applications can create and access files up to one Tbyte on UFS-mounted file systems and up to the limit of the NFS server for NFS- and CacheFS-mounted file systems. A new -o largefiles option disables the large-file support on UFS file systems. Using the -o largefiles option enables system administrators to ensure that older applications that are not able to safely handle large files do not accidentally operate on large files. NFS Kerberos authentication now uses DES encryption to improve security over the network. The kernel implementations of NFS and RPC network services now support a new RPC authentication flavor that is based on the Generalized Security Services API (GSS-API). This support contains the hooks for future stronger security of the NFS environment. (Refer to the Solaris Advanced System Administrator's Guide.) Font Admin enables easy installation and use of fonts for the X Window System. It supports TrueType, Type0, Type1, and CID fonts for multibyte languages and provides comparative font preview capability. It is fully integrated into the CDE desktop. (Not documented in this book.) The Solaris 2.6 operating environment is year 2000 ready. It uses unambiguous dates and follows the X/Open guidelines where appropriate. (Not documented in this book.) WebNFS software enables file systems to be accessed through the Web with the NFS protocol. This protocol is very reliable and provides greater throughput under a heavy load. (Not documented in this book.) The Java Virtual Machine 1.1 integrates the Java platform for the Solaris Operating Environment. It includes the Java runtime environment and the basic tools needed to develop Java applets and applications. (Not documented in this book.) For IA systems, the Configuration Assistant interface is part of the new booting system for the Solaris (Intel Platform Edition) software. It determines which hardware devices are in the system, accounts for the resources each device uses, and enables users to choose which device to boot from. For IA systems, the kdmconfig program configures the mouse, graphics adapter, and monitor. If an owconfig file already exists, kdmconfig extracts any usable information from it. In addition, kdmconfig retrieves information left in the devinfo tree by the defconf program and uses that information to automatically identify devices. (Not documented in this book.)
Release
New Features Release is fully compliant with X/Open UNIX 95and POSIX standards. (Not documented in this book.)
Solaris 64-bit operating environment is added (SPARC Platform Edition only). (Not documented in this book.) UFS logging improves file system support. Lightweight Directory Access Protocol (LDAP) protocol improves management of nameservice databases. (Not documented in this book.) Java Development Kit for Solaris significantly improves scalability and performance for Java applications. (Not documented in this book.) Dynamic reconfiguration significantly decreases system downtime. AnswerBook2 server runs on a Web server. (Not documented in this book.) Unicode locales enhanced with multiscript capabilities and six new Unicode locales are added. RPC security is tightened with data integrity and confidentiality enhancements. (Not documented in this book.) The Solaris Common Desktop Environment (CDE) contains new tools to make it easy to find, manipulate, and manage address cards, applications, e-mail addresses, files, folders, hosts, processes, and Web addresses. (Not documented in this book.)
IPv6 adds increased address space and improves Internet functionality by using a simplified header format, support for authentication and privacy, autoconfiguration of address assignments, and new quality-of-service capabilities. The Solaris Operating Environment provides the Naming Service switch back-end support for directory service based on Lightweight Directory Access Protocol (LDAP). (Not documented in this book.) The Java2 Software Development Kit (SDK) for Solaris significantly improves scalability and performance of Java applications. (Not documented in this book.) The Solaris 8 Installation CD provides a graphical, wizard-based, Java-powered application to install the Solaris Operating Environment and other software. (Not documented in this book.) The Solaris 8 Operating Environment supports the Universal Disk Format (UDF) file system, enabling users to exchange data stored on CD-ROMs, disks, diskettes, DVDs, and other optical media. The Solaris Smart Card feature enables security administrators to protect a computer desktop or an individual application by requiring users to authenticate themselves by means of a smart card. (Not documented in this book.)
Release
New Features The PDA Synchronization (PDA Sync) application synchronizes the data from applications such as Desktop Calendar, Desktop Mail, Memo, and Address, with data in similar applications on a user's Personal Digital Assistant (PDA). (Not documented in this book.) The Solaris 8 Software CDs and Languages CD include support for more than 90 locales, covering 37 languages. (Not documented in this book.) The Solaris Common Desktop Environment (CDE) contains new and enhanced features that incorporate easy-to-use desktop productivity tools, PC interoperability, and desktop management tools. (Not documented in this book.) The X Server is upgraded to the X11R6.4 industry standard that includes features to increase user productivity and mobility, including remote execution of X applications through a Web browser on any Web-based desktop, Xinerama, Color Utilization Policy, EnergyStar support, and new APIs and documentation for the developer tool kits. (Not documented in this book.) Role-Based Access Control (RBAC) enables system administrators to create specific roles by which they can assign superuser privileges for specific tasks to one or more individual users. Mobile Internet Protocol (IP) enables the transfer of information to and from mobile computers such as laptop and wireless communications.
Removable Media management fully supports removable media such as DVD-ROMs, Zip drives, Jaz drives, CD-ROMs, and diskettes. IP network multipathing provides recovery from single-point failures with network adapters and increased traffic throughput.
Web-Based Enterprise Management (WBEM) includes a description of the system properties that the CIM Object Manager uses and descriptions of the new Solaris_Printer and other printing definition classes. You can use Solaris Print Manager to set up a Universal Serial Bus (USB) printer attached to a SPARC system with USB ports. Lightweight Directory Access Protocol (LDAP) is supported in the iPlanet Web Server directory server.
Solaris Management Console 2.0 software provides an integrated, GUI-based, network-aware suite of system administration tools. You can manage role-based access control (RBAC) with the Solaris Management Console graphical interfaces.
Release
New Features Web-Based Enterprise Management (WBEM) adds an updated init.wbem command, updated security, Solaris Management Console Log Viewer, added descriptions of new Solaris_Network 1.0.mof file and Solaris_Users1.0.mof file. Support for USB devices for Sun Blade 100, Sun Blade 1000, and SunRay systems. New Berkeley Internet Name Domain (BIND) functionality.
Solaris 8 (SunOS 5.8) 4/01 sendmail version 8.10 includes new command-line options, new and revised configuration file options, new defined macros, new and revised m4 configuration macros, new and modified compile flags, new delivery flag agents, new equates for delivery agents, new queue features, new uses for LDAP, new rule set features, new file locations, and a new built-in mailer feature. Web-Based Enterprise Management (WBEM) includes the Sun WBEM SDK 2.4, new providers, and an MOF Compiler (mofcomp) description of the system properties that the CIM Object Manager uses, and descriptions of the new Solaris_Printer and other printing definition classes. IP network multipathing adds dynamic reconfiguration (DR), which uses IP network multipathing to decommission a specific network device with no impact on existing IP users. Mobile Internet Protocol IP enables system administrators to set up reverse tunnels. Solaris PPP 4.0 supports both asynchronous and synchronous communications and offers Password Authentication Protocol (PAP) and Challenge-Handshake Authentication Protocol (CHAP) authentication. Solaris PPP 4.0 is highly configurable.
Solaris Network Cache and Accelerator (NCA) provides a sockets interface through which any Web server can communicate with NCA with minimal modifications. IP network multipathing introduces the cPCI Network Interface (IPMP) Reboot Safe feature. Dynamic Reconfiguration (DR) 3.0 replaces DR 3.0. DR 3.0 controls DR operations on the domain with the domain configuration server dcs(1M) command. You use the automated dynamic reconfiguration (ADR) commands to perform DR operations.
USB support for keyboards, mouse devices, printers, and audio devices. Sun RPC library extensions provide the Sun ONC+ RPC library with an asynchronous protocol.
Release
New Features Solaris 9 Resource Manager enables system administrators to allocate computing resources, monitor resource use, and generate extended accounting information about resource use. Full functionality is administered with a command-line interface. Solaris Management Console enables performance monitoring and the setting of resource controls. Fixed-priority (FX) scheduling class provides a scheduling policy for processes that require user or application control of scheduling priorities. Web Start Flash Install feature that enables you to create a master system and then clone that configuration to other systems of the same architecture. Live Upgrade feature that enables you to create a duplicate boot environment and install a Web Start Flash archive while the system is still running. When you are ready, you activate the duplicate environment and reboot the system. New display options for the df, du, and ls commands that enable you to display disk usage and file or file system sizes in powers of 1024. pargs and preap commands to improve process debugging. Integrated version of the iPlanet Lightweight Directory Access Protocol (LDAP) directory. Nameservice support for LDAP. NIS+ to LDAP migration tools. Solaris PPP 4.0. Sun Internet FTP server. Sun RPC library extension. sendmail version 8.12. Improved Solaris Network Cache and Accelerator (NCA). IP network multipathing link-up and link-down notification support. Mobile IP agent advertisements over dynamic interfaces. Bind version 8.2.4. Solaris volume manager. Solaris Management Console 2.1 with six new tools. smpatch(1M) command you can use to install patches on single or multiple systems, analyze patch requirements, and download required patches. Solaris Secure Shell commands that enable you to securely access a remote host over an unsecured network. Write CD file systems with the cdrw(1) command.
[ Team LiB ]
[ Team LiB ]
Freeware
The following freeware tools and libraries are included in the Solaris Operating Environment. bashsh-compatible command language interpreter. bzip2 Block-sorting file compressor. gpatch A tool that applies patch files to originals. gzip GNU zip compression command. less A pager similar to more. libz Also known as zlib. A library that performs compression, specifically, RFCs 19501952. mkisofs A tool that builds a CD image, using an iso9660 file system. rpm2cpio Transforms a package in RPM format (Red Hat Package Manager) to a cpio archive. tcsh C shell with file-name completion and command-line editing. zip Compression and file packaging command. zsh Command interpreter (shell) usable as an interactive login shell and as a shell script command processor. [ Team LiB ]
[ Team LiB ]
[ Team LiB ]
Installing systems. Understanding Flash Install. Understanding Live Upgrade. Understanding shells. Using generic shell commands. Using Bourne shell commands. Using C shell commands. Using Korn shell commands. Administering user and group accounts. Adding user accounts. Removing user accounts. Changing user account information. Creating new group accounts. Using Solaris User Registration. Administering roles. Granting users superuser permissions for specific tasks.
Creating, modifying, and deleting roles. Administering file systems. Understanding the types of file systems. Mounting and unmounting file systems. Checking file system consistency. Backing up and restoring files and file systems. Creating cache file systems. Administering devices. Understanding device autoconfiguration. Allocating devices. Understanding SCSI and PCI hot-plugging. Using DVD-ROM devices. Using tape cartridges. Using Jaz or Zip drives. Writing CD discs. Understanding Volume Management. Formatting diskettes. Monitoring disk use. Administering disks. Understanding the Service Access Facility. Setting up and using a bidirectional modem. Administering systems. Finding system information. Creating local mail aliases. Configuring additional swap space.
Configuring systems for a network. Finding network information. Transferring files between systems. Administering NIS+ databases. Displaying network statistics. Displaying network configuration information. Understanding the IPv6 Internet protocol. Displaying packet contents. Using the Secure Shell. Administering printing. Setting up a print client and print server. Using printing commands. Recognizing file access problems. Identifying problems with search paths. Solving problems with permission and ownership. Locating problems with network access. The organization of this book matches the tasks listed above. To accomplish these tasks, you need to know when and how to perform the following tasks. Gain full access to all file systems and resources. Communicate with users. Shut down and start up systems. Monitor processes. However, information about the following system administration tasks is beyond the scope of this book.
Installing system software. Installing third-party software. Setting up and administering network services. Setting up and administering mail services. Adding and removing hardware. Administering security and accounting. Monitoring system and network performance. The rest of the sections in this chapter, which describe how to accomplish the system administrator's tasks, introduce some basic commands and administrative tools. [ Team LiB ]
[ Team LiB ]
NOTE. The default shell for root is the Bourne shell. See Chapter 4, "Understanding Shells," for more information on shells.
1. At the shell prompt ($ or %), type su and press Return. You are prompted for the superuser (root) password if one has been set up. 2. Type the superuser password and press Return. If you enter the password correctly, you have
1.
2. superuser (root) access to the system and the root shell prompt (#) is displayed in this terminal window.
oak% su Password: #
NOTE. If you want to use root's environment variables, type su and press Return.
# exit oak%
Logging In as Root
For you to log in as root, ensure that the system is at a login prompt.
1. At a login prompt, type root and press Return. You are prompted for the root password. 2. Type the root password and press Return. If you enter the password correctly, you have superuser (root) access to the system, and the root prompt (#) is displayed in all open terminal windows.
With the Role-Based Access Control (RBAC) security feature, starting with the Solaris 8 Operating Environment, you can assign a subset of superuser privileges to a role and assign one or more users to that role. See Chapter 6, "Administering Rights and Roles," for more information. If you are a member of a role that assigns a subset of superuser privileges, you log in by using the su command with the role name and the password assigned to that role. [ Team LiB ]
[ Team LiB ]
sys
49 Jan
1970
/etc/motd
NOTE. When the system software is installed, several files, including /etc/motd, have a time stamp of "Jan 1 1970." This date is the beginning of UNIX time. When you edit these files, the time stamp is updated.
The default /etc/motd file contains information about the Solaris release level. The following example shows the default /etc/motd file for Solaris 8.
Generic
February 2000
1. Become superuser. 2. Use an editor such as vi to edit the /etc/motd file. 3. Delete any existing messages and type the new one. 4. Save the changes. The message is changed and is displayed the next time a user logs in to the system.
NOTE. In the CDE environment, users may or may not use a console window. If the console window is not open, the user never sees the message because it is not displayed if the user opens a console window after the write message has been received.
1. Type write username and press Return. username is the login name of the user. 2. Type the message you want to send. 3. When the message is complete, press Control-D. The message is displayed in the user's console window. The following example shows a message a system administrator might type.
# write winsor winsor is logged on more than one place. You are connected to "console". Other locations are: pts/3 pts/4 pts/5 pts/6 pts/7 I'll come by at 12:00 to look at your problem. #
As you can see, winsor is logged in to more than one place and write tells you that it is sending the message to the console window. The message is displayed in the user's console window, as shown in the following example.
paperbark% Message from winsor on paperbark (pts/6) [ Tue Mar 7 16:40:09 ] ... I'll come by at 12:00 to look at your problem. <EOT>
However, if you are concerned that the user is not using the console window, you can use the write username terminal command to send the write message to any of the other terminals listed.
1. Create a file containing the text of the message you want to send. 2. Type write username < filename and press Return. In the following example, the system administrator uses the cat command to create a file named message that contains a short message and then uses the write command to send the message.
oak% cat > message I'll come by at 12:00 to look at your problem. oak% write ignatz@elm < message write: ignatz logged in more than once ... writing to console oak%
If the user is logged in to more than one window, the message is displayed in the user's console window, as shown below.
Message from fred@oak on ttyp1 at 11:20 ... I'll come by at 12:00 to look at your problem. EOF
As you can see, the user doesn't see any difference in the output created from a typed message and the message included from a file. The user can initiate a dialogue by using the write command to respond, but the dialogue is not truly interactive. Two write paths are open, one in each direction. See the write(1) manual page for more information. For more information about manual pages, see "Using Manual Pages" on page 94.
NOTE. In the CDE environment, users may not use a console or a terminal window. If no console or terminal windows are opened, the user never sees the message because it is not displayed if the user opens a window after the wall message has been received.
1. Type wall and press Return. 2. Type the message you want to send. 3. When the message is complete, press Control-D. The message is displayed in the console window of each user on the system. The following example shows a message a system administrator might type.
Broadcast message from root on console ... System will be rebooted at 12:00. EOF
NOTE. Use the rwall command carefully because it consumes extensive system and network resources.
1. Type rwall -n group and press Return. 2. Type the message you want to send. 3. When the message is complete, press Control-D. The message is displayed in the console window of each user on the system. The following example shows a message the system administrator might type to send to all members of the netgroup Eng.
Broadcast message from root on console ... System will be rebooted at 12:00.
You can also use the rwall command to send a message to all users on a system by typing rwall hostname.
NOTE. At many security-conscious sites, system administrators disable the rwall command by commenting out the walld daemon line in the /etc/inetd.conf file.
[ Team LiB ]
[ Team LiB ]
Starting Up Systems
Starting up systems is an integral part of performing system administration tasks. This section describes procedures for routinely starting up systems. If a system does not start up gracefully, see your system documentation for information on how to diagnose booting problems.
Function
The /sbin/init command is responsible for keeping the system running correctly and is the command you use to change init states. You can also use the init states (with the -i option) as arguments to the shutdown command. The four types of system states are described below. Power-down (run level 5). Single-user (run levels 1 and s or S).
Multiuser (run levels 2 and 3). Reboot (run level 6). When preparing to do a system administration task, you need to determine which init state is appropriate for the system and the task at hand.
respawn
Field wait
Description When init enters the run level that matches the rstate for the entry, start the process and wait for its termination. Ignore all subsequent reads of the inittab file while init is at the same run level. When init enters a run level that matches the rstate for the entry, start the process and do not wait for its termination. When the process dies, do not restart it. If init enters a new run level and the process is still running from a previous run-level change, do not restart the program. Process the entry only at init's boot-time read of the inittab file. init starts the process and does not wait for its termination. When the process dies, init does not restart it. For this instruction to be meaningful, the rstate should either be the default or match init's run level at boot time. This action is useful for an initialization function following a hardware reboot. Process the entry the first time init goes from single-user to multiuser state after the system is booted. If initdefault is set to 2, run the process right after the boot. init starts the process, waits for its termination, and when it dies, does not restart it. Execute the process associated with this entry only when init receives a power fail signal, SIGPWR. (See signal(3C).) Execute the process associated with this entry only when init receives a power fail signal, SIGPWR, and wait until it terminates before continuing any processing of inittab. When the process associated with this entry is currently running, send the warning signal SIGTERM and wait five seconds before forcibly terminating the process with the kill signal, SIGKILL. If the process is nonexistent, ignore the entry. A synonym for the respawn action. The functionality is identical to respawn but it has a different keyword to divorce its association from run levels. Use this instruction only with a, b, or c values in the rstate field. Scan an entry with this action only when init is initially invoked. init uses this entry to determine the initial run level. It takes the highest run level specified in the rstate field and uses that as its initial state. If the rstate field is empty, the value is interpreted as 0123456 and init enters run level 6. This interpretation loops the system (it goes to firmware and reboot continuously). In addition, if init does not find an initdefault entry in inittab, it requests an initial run level from the user at reboot. Execute entry before init accesses the console (before the Console Login: prompt). Use this entry only to initialize devices that init might try to ask the run-level question. These entries are executed, and init waits for them to complete before continuing.
once
boot
bootwait
powerfail
powerwait
off
ondemand
initdefault
sysinit
ap::sysinit:/sbin/autopush -f /etc/iu.ap ap::sysinit:/sbin/soconfig -f /etc/sock2path fs::sysinit:/sbin/rcS sysinit >/dev/msglog 2<>/dev/msglog </dev/console is:3:initdefault: p3:s1234:powerfail:/usr/sbin/shutdown -y -i5 -g0 >/dev/msglog 2<>/dev/msglog sS:s:wait:/sbin/rcS >/dev/msglog 2<>/dev/msglog </dev/console s0:0:wait:/sbin/rc0 >/dev/msglog 2<>/dev/msglog </dev/console s1:1:respawn:/sbin/rc1 >/dev/msglog 2<>/dev/msglog </dev/console s2:23:wait:/sbin/rc2 >/dev/msglog 2<>/dev/msglog </dev/console s3:3:wait:/sbin/rc3 >/dev/msglog 2<>/dev/msglog </dev/console s5:5:wait:/sbin/rc5 >/dev/msglog 2<>/dev/msglog </dev/console s6:6:wait:/sbin/rc6 >/dev/msglog 2<>/dev/msglog </dev/console fw:0:wait:/sbin/uadmin 2 0 >/dev/msglog 2<>/dev/msglog </dev/console of:5:wait:/sbin/uadmin 2 6 >/dev/msglog 2<>/dev/msglog </dev/console rb:6:wait:/sbin/uadmin 2 1 >/dev/msglog 2<>/dev/msglog </dev/console sc:234:respawn:/usr/lib/saf/sac -t 300 co:234:respawn:/usr/lib/saf/ttymon -g -h -p "`uname -n` console login: " -T sun -d /dev/console -l console -m ldterm,ttcompat
mopoke% ls -l /sbin/rc* -rwxr--r-3 root -rwxr--r-1 root -rwxr--r-1 root -rwxr--r-1 root -rwxr--r-3 root -rwxr--r-3 root -rwxr--r-1 root mopoke%
8 8 8 8 8 8 8
Run control files are located in the /etc/init.d directory. These files are linked to corresponding run control files in the /etc/rc*.d directories. The files in the /etc directory define the sequence in which the scripts are performed within each run level. For example, the /etc/rc2.d directory contains files, listed below, that start and stop processes for run level 2.
mopoke% ls /etc/rc2.d K03samba S21perf K03sshd S30sysid.net K06mipagent S40llc2 K07dmi S42ncakmod K07snmpdx S47pppd K16apache S69inet K21dhcp S70sckm K27boot.server S70uucp K28kdc S71ldap.client K28kdc.master S71rpc K28nfs.server S71sysid.sys README S72autoinstall S01MOUNTFSYS S72directory S05RMTMPFILES S72inetsvc S10lu S72slpd S20sysetup S73cachefs.daemon mopoke%
S73nfs.client S74autofs S74syslog S74xntpd S75cron S75flashprom S75savecore S76nscd S77sf880dr S80lp S80spc S85power S88sendmail S88utmpd S89bdconfig S89PRESERVE
S90wbem S91afbinit S91gfbinit S91ifbinit S92volmgt S93cacheos.finish S94ncalogd S95IIim S95svm.sync S96ab2mgr S98efcode S99audit S99dtlogin
The scripts are always run in ASCII sort order. The names of the scripts have the form [K, S][0 - 9][A - Z][0 - 99]. Files beginning with K are run to terminate (kill) some system process. Files beginning with S are run to start a system process. The actions of each run-level control script are summarized in the following sections.
Configure serial device stream. Configure WBEM services. Synchronize volumes if required and start the mdmonitord daemon to monitor the physical components of the volumes. Start the CDE desktop login process, dtlogin, if appropriate. Network service and security-related tasks:
Configure the network interfaces, set ifconfig netmask, and configure network routing if appropriate. Start network service (inetd and rpcbind) daemons. Set the nameservice domain name, start various nameservice daemons, depending on whether the system is configured for a nameservice and whether the system is a client or a server. Start keyserv, statd, lockd, and xntpd daemons if appropriate. Start the logical link controller (llc2) if configured. Mount all NFS entries. Configure the Solaris Network Cache and Accelerator (NCA) and NCA logging if appropriate. Start the Solaris PPP server or client daemons (pppoed or pppd) if configured. Start LDAP cache manager (ldap_cachemgr) if configured. Start directory server (slapd) daemon if configured. Start DNS (in.named) daemon if configured. Start Service Location Protocol (slpd) daemon if configured. Configure system resource controls and system pools if the /etc/rctladm.conf and /etc/pooladm.conf files exist. Start the cachefsd, automount, and sendmail daemons if appropriate.
Configure the boot environment for the Live Upgrade software on system startup or system shutdown. Check for the presence of the /etc/.UNCONFIGURE file to determine whether to reconfigure the system. Reboot the system from the installation medium or a boot server if either /.PREINSTALL or /AUTOINSTALL exists. Hardware-related tasks:
Start the Sun Fire 150000 key management daemon (sckmd) if appropriate. Start the Sun Fire 880 Dynamic Reconfiguration daemon (sf880drd) if appropriate. Run the flash PROM update script. Configure any graphic frame buffers or graphic accelerators. Run the FCode interpreter daemon (efdaemon) if necessary. Transition the following services between run-level changes:
Apache (tomcat). Boot server (in.rarpd, rpc.bootparamd, or rpld). DHCP (in.dhcpd). Kerberos KDC (krb5dc) and Kerberos administration (kadmind). Mobile IP (mipagent). NFS server (nfsd, mountd, nfslogd). Samba (smdb and nmdb). Secure shell (sshd). Solstice Enterprise Agents (dmispd and snmpXdmid).
NOTE. Many of the system services and applications started at run level 2 depend on what software is installed on the system.
Start the Apache server daemon (tomcat) if configured. Start the DHCP daemon (in.dhcpd) if appropriate. Start Kerberos KDC (krb5dc) and Kerberos administration (kadmind) daemons if configured. Start Mobile IP daemon (mipagent) if configured. Start the Samba daemons (smdb and nmdb) if configured. Start the secure shell daemon (sshd) if appropriate. Start the Solstice Enterprise Agents (dmispd and snmpXdmid). Clean up the /etc/dfs/sharetab file. Start the NFS server daemons nfsd, mountd, and nfslogd if appropriate. If the system is a boot server, start rarpd, rpc.bootparamd, and rpld.
Mount /usr if necessary. Set the system name. Check the root and /usr file systems. Mount pseudofile systems (/proc and /dev/fd). Rebuild the device entries for reconfiguration boots. Check and mount other file systems to be mounted in single-user mode.
May
2 08:34
The next sections describe how you might use each init state.
NOTE. In the Solaris 7 release, Bug ID 1154696 was fixed so that you can cleanly bring a
system to run level S (or single-user mode) by using the shutdown -s or the init -s command. The inittab file and the rc scripts in the /etc/init.d directory and the /etc/rcn.d directories have been modified to ensure that system run-level transitions are made cleanly and efficiently.
NOTE. A daemon is a special type of program that, once activated, starts itself and carries out a specific task without any need for user input. Daemons typically are used to handle jobs, such as printing, mail, communication, UPS monitors (to shut down a system in case the UPS says that a power outage is imminent), and Web servers.
1. Become superuser. 2. Type telinit n and press Return. Replace the variable n with the number of the init state you want to use. The following example shuts down the system and places the focus at the OpenBoot PROM prompt (on SPARC systems only).
The following example changes to multiuser state, with no NFS server daemons running.
The following example changes to multiuser state, with NFS server daemons running.
NOTE. Some older systems may require PROM upgrades before they will work with the Solaris Operating Environment. Contact your local service provider for more information.
The boot process consists of the boot PROM, boot programs, kernel initialization, and system initialization phases. These phases are summarized in Table 3.
The OpenBoot firmware on the SPARC PROM not only initiates the boot process but also provides a command-line interface. OpenBoot provides two modes. The restricted monitor mode, which displays the > prompt, provides only three commands. These commands enable you to boot the operating system (b specifiers), resume the execution of a halted program (c), or enter the Forth Monitor (n). The Forth Monitor, also referred to as new command mode, is the default mode of the OpenBoot firmware. The Forth Monitor displays the ok prompt. This monitor enables you to access an extensive set of diagnostic commands for hardware and software. Anyone who has access to the system console can access these functions. To access the restricted monitor, at the ok PROM prompt, type old-mode and press Return.
ok banner Sun Blade 100 (UltraSPARC-IIe, Keyboard Present Copyright 1998-2002 Sun Microsystems, Inc. All rights reserved.
OpenBoot 4.5, 128 MB memory, installed, Serial #50640486. Ethernet address 0:23:ba:4:b6:66, Host ID 8304b666
NOTE. Not all OpenBoot systems support all parameters. Defaults can vary depending on the system and the PROM revision.
diag-switch? If true, run in diagnostic mode. Default is false. fcode-debug? If true, include name parameter for plug-in device FCodes. Default is false.
input-device Input device used at power-on (usually keyboard, ttya, or ttyb). Default is keyboard. keyboard-click? If true, enable keyboard click. Default is false. keymap Keymap for custom keyboard. There is no default. NVRAM startup script. Default is an empty string. nvramrc oem-banner oem-banner? If true, use custom OEM banner. Default is false. output-device Output device used at power-on (usually screen, ttya, or ttyb). Default is screen. sbus-probe-list Which SBus slots are probed and in what order. Default system-specific because different SBus systems have different numbers of SBus slots. Newer Sun systems have a PCI bus instead of an SBus. scsi-initiator-id SCSI bus address of host adapter, range 07. Default is 7. security-mode Firmware security level (options: none, command, or full). If set to command or full, system prompts for PROM security password. Default is none. security-password Firmware security password (never displayed). Can be set only when security mode is set to command or full. ttya-mode TTYA (baud rate, #bits, parity, #stop, handshake). Default is 9600, 8, n, 1, -. Fields, in left-to-right order, are described below. baud rate data bits parity stop bits handshake 110, 300, 1200, 4800, 9600... 5, 6, 7, 8 n (none), e (even), o (odd), m (mark), s (space) 1, 1.5, 2 - (none), h (hardware: rts/cts), s (software: xon/xoff) Custom OEM banner (enabled by setting oem-banner? to true). Default is an empty string.
ttyb-mode
TTYB (baud rate, #bits, parity, #stop, handshake). Default is 9600, 8, n, 1, -. Fields, in left-to-right order, are described below. baud rate data bits stop bits parity handshake 110, 300, 1200, 4800, 9600... 5, 6, 7, 8 1, 1.5, 2 n (none), e (even), o (odd), m (mark), s (space) - (none), h (hardware: rts/cts), s (software: xon/xoff)
ttya-ignore-cd If true, operating system ignores carrier-detect on TTYA. Default is true. ttyb-ignore-cd If true, operating system ignores carrier-detect on TTYB. Default is true. ttya-rts-dtr-off If true, operating system does not assert DTR and RTS on TTYA. Default is false. ttyb-rts-dtr-off If true, operating system does not assert DTR and RTS on TTYB. Default is false. use-nvramrc? If true, execute commands in nvramrc during system start-up. Default is false. version2? If true, hybrid (1.x/2.x) PROM comes up in version 2.x. Default is true.
watchdog-reboot? If true, reboot after watchdog reset. Default is false. You can display and set the list of OpenBoot commands from Solaris by using the eeprom command or display the list at the ok PROM prompt by typing printenv and pressing Return. The following example uses the eeprom command without arguments to display the current settings.
fcode-debug?=false ttyb-rts-dtr-off=false ttyb-ignore-cd=true ttya-rts-dtr-off=false ttya-ignore-cd=true silent-mode?=false scsi-initiator-id=7 oem-logo: data not available. oem-logo?=false oem-banner: data not available. oem-banner?=false ansi-terminal?=true screen-#columns=80 screen-#rows=34 ttyb-mode=9600,8,n,1,ttya-mode=9600,8,n,1,output-device=screen input-device=keyboard load-base=16384 auto-boot?=true boot-command=boot diag-file: data not available. diag-device=disk net boot-file: data not available. boot-device=disk:a disk net use-nvramrc?=false nvramrc: data not available. security-mode=none security-password: data not available. security-#badlogins=0 diag-script=none diag-level=max diag-switch?=false error-reset-recovery=boot mopoke%
The following example sets the method for setting the auto-boot? parameter to true. You may need to enclose the command in double quotation marks to prevent the shell from interpreting the question mark.
# eeprom "auto-boot?"=true #
Alternatively, you can precede the question mark with an escape character (\) to prevent the shell from interpreting the question mark.
1. Become superuser. 2.
1. 2. Type eeprom security-mode=level and press Return. The security level is set as specified by the level argument. In the following example, the security level is set to command.
To set the OpenBoot security level, at the ok PROM prompt, type security-mode=level and press Return. In the following example, the security level is set to full.
ok security-mode=full
For more information, refer to the eeprom(1M) manual page or to the OpenBoot documentation available from Sun Microsystems.
Boot Subsystems
You can make the choices about booting a system at three times during the Solaris IA boot process, as described below.
Primary Boot Subsystem (Partition Boot Menu) This first menu is displayed if multiple bootable fdisk partitions exist on the disk. The menu enables you to boot from one of the fdisk partitions. By default, the active partition is booted if you take no action. Note that if you boot a non-Solaris partition, the next two menus are never displayed. Interrupt the Autoboot Process If you interrupt the autoboot process, you can access the Configuration Assistant, which enables you to boot the Solaris Operating Environment from a different boot device, configure new or misconfigured hardware, or perform other device- or boot-related tasks. Current Boot Parameters Menu This menu has two forms, one for a normal Solaris boot and one for a Solaris installation boot. The normal Current Boot Parameters menu enables you to boot the Solaris system with options or to enter the boot interpreter. The install Current Boot Parameters menu enables you to choose the type of installation to be performed or to customize the boot. Table 6 describes the IA Platform boot subsystems.
Solaris Device You can access the Solaris Device Configuration Assistant menu by using Configuration the Solaris Device Configuration Assistant Boot Diskette to boot the Assistant/Boot Diskette system or by interrupting the autoboot process when booting the Solaris Operating Environment from an installed disk. Current Boot Parameters Menu This menu is displayed when you boot from a disk with the Solaris Operating Environment installed or if you want to install the Solaris release from the Solaris installation CD or the network. In either case, this menu presents a list of boot options.
When booting an IA platform, the Configuration Assistant performs the following tasks during the device identification phase. Scans for devices installed on the system. Displays the identified devices. Enables you to perform optional tasks such as choosing a keyboard type and editing devices and
their resources. During the boot phase, the system displays a list of devices from which to boot. The asterisk (*) marks the default boot device. You can perform optional tasks, such as editing autoboot and property settings. The boot process consists of the BIOS, boot programs, kernel initialization, and system initialization phases. These phases are summarized in Table 7.
Boot Phase
Description The kernel creates a user process and starts the /sbin/init process, which starts other processes by reading the /etc/inittab file.
init
The /sbin/init process starts the run control (/sbin/rc*) scripts, which execute a series of other scripts (/etc/rc*.d/S*). These scripts check and mount file systems, start various processes, and perform system maintenance tasks.
Booting a System
If a system is powered off, turning it on starts the multiuser boot sequence. The following procedures tell you how to boot in different states from the ok PROM prompt. If the PROM prompt is >, type n to display the ok prompt, and then follow the appropriate steps.
Table 8 describes commands for booting a system for different reboot reasons.
Reboot to run level 3 (multiuser mode with NFS resources shared) (boot). See "Booting in Multiuser State" on page 34 for more information. Use Control-D from run level S to bring the system back to run level 3.
Interactive boot (boot -a). See "Booting Interactively" on page 34 for more information. Reconfiguration boot (boot -r). See "Booting After Adding New Hardware" on page 36 for more information.
Reboot Reason Adding or removing hardware from the system. Booting the kernel debugger to track down a system problem. Repairing an important system file that is causing system boot failure. Recovering from a hung system and forcing a crash dump.
Boot Instructions Reconfiguration boot (boot -r) plus turning on system power after adding or removing hardware. See "Booting After Adding New Hardware" on page 36 for more information. Boot kadb. See "Booting the System with the Kernel Debugger" on page 38. Recovery boot (SPARC platform, sync; IA platform, kadb). See "Booting a System for Recovery Purposes (SPARC Platform) and "Booting a System for Recovery Purposes (IA Platform)" on page 39. Recovery boot (SPARC platform, sync; IA platform, kadb). See "Booting a System for Recovery Purposes (SPARC Platform)" on page 38 and "Booting a System for Recovery Purposes (IA Platform)" on page 39.
ok boot -s INIT: SINGLE USER MODE Type Ctrl-d to proceed with normal start-up, (or give root password for system maintenance) Type the root password and press Return.
NOTE. To continue the process and bring the system up in multiuser state, press Control-D.
Booting Interactively
You may boot interactively if you want to make a temporary change to the system file or the kernel. In this way, you can test your changes and recover easily if you have any problems.
1. At the ok PROM prompt, type boot -a and press Return. The boot program prompts you interactively. 2. Press Return to use the default kernel or type the name of the kernel to use for booting. 3. Press Return to use the default modules directory path, or type the default path for the modules and press Return. 4. Press Return to use the default /etc/system file, or type the name of the system file and press Return. 5. Press Return to use the default root file system. Type ufs for local disk booting or nfs for diskless clients. 6. Press Return to use the default physical name of the root device, or type the device name. In the following example, the user accepted the default choices (shown in square brackets []) by pressing Return.
ok boot -a (Hardware configuration messages) rebooting from -a Boot device: /sbus/esp@0,800000/sd@0,0 File and args: -a Enter filename [/kernel/unix]: Enter default directory for modules [/platform/SUNW,Ultra-2/kernel /platform/sun4u/kernel /kernel /usr/kernel]: Name of system file [/etc/system]: (Copyright notice) root filesystem type [ufs] Enter physical name of root device [/sbus@if,0/SUNW,fas@e,8800000/[email protected]:a]: Swap filesystem type [swapfs] Configuring IPv4 interfaces: le0 Hostname: paperbark The system is coming up. Please wait. (fsck messages) (Startup messages) paperbark login:
NOTE. You can now view /usr/sbin/dmesg text from a CDE terminal window, which was not possible in previous releases.
Because the /var/adm/messages file is maintained in chronological order, the most current boot messages are at the end of the file. The following example shows the last 30 lines of the /var/adm/messages file.
paperbark% tail -30 /var/adm/messages Mar 7 18:11:15 paperbark swapgeneric: [ID 308332 kern.info] root on /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0:a fstype ufs Mar 7 18:11:16 paperbark sbus: [ID 349649 kern.info] zs0 at sbus0: SBus0 slot 0xf offset 0x1100000 Onboard device sparc9 ipl 12 Mar 7 18:11:16 paperbark genunix: [ID 936769 kern.info] zs0 is /sbus@1f,0/zs@f,1100000 Mar 7 18:11:16 paperbark sbus: [ID 349649 kern.info] zs1 at sbus0: SBus0 slot 0xf offset 0x1000000 Onboard device sparc9 ipl 12 Mar 7 18:11:16 paperbark genunix: [ID 936769 kern.info] zs1 is /sbus@1f,0/zs@f,1000000 Mar 7 18:11:19 paperbark rootnex: [ID 349649 kern.info] ffb0 at root: UPA 0x1e 0x0 Mar 7 18:11:19 paperbark genunix: [ID 936769 kern.info] ffb0 is /SUNW,ffb@1e,0 Mar 7 18:11:19 paperbark unix: [ID 987524 kern.info] cpu0: SUNW,UltraSPARC (upaid 0 impl 0x10 ver 0x22 clock 168 MHz) Mar 7 18:11:22 paperbark hme: [ID 517527 kern.info] SUNW,hme0 : Sbus (Rev Id = 22) Found Mar 7 18:11:22 paperbark sbus: [ID 349649 kern.info] hme0 at sbus0: SBus0 slot 0xe offset 0x8c00000 and slot 0xe offset 0x8c02000 and slot 0xe offset 0x8c04000 and slot 0xe offset 0x8c06000 and slot 0xe offset 0x8c07000 Onboard device sparc9 ipl 6 Mar 7 18:11:22 paperbark genunix: [ID 936769 kern.info] hme0 is /sbus@1f,0/SUNW,hme@e,8c00000 Mar 7 18:11:24 paperbark genunix: [ID 454863 kern.info] dump on /dev/dsk/c0t0d0s1 size 512 MB Mar 7 18:11:26 paperbark hme: [ID 517527 kern.info] SUNW,hme0 : Internal Transceiver Selected. Mar 7 18:11:26 paperbark hme: [ID 517527 kern.info] SUNW,hme0 :
Auto-Negotiated 10 Mbps Half-Duplex Link Up Mar 7 18:12:01 paperbark pseudo: [ID 129642 kern.info] pseudo-device: pm0 Mar 7 18:12:01 paperbark genunix: [ID 936769 kern.info] pm0 is /pseudo/pm@0 Mar 7 18:12:01 paperbark pseudo: [ID 129642 kern.info] pseudo-device: tod0 Mar 7 18:12:01 paperbark genunix: [ID 936769 kern.info] tod0 is /pseudo/tod@0 Mar 7 18:12:02 paperbark sendmail[250]: [ID 702911 mail.crit] My unqualified host name (paperbark) unknown; sleeping for retry Mar 7 18:12:03 paperbark pseudo: [ID 129642 kern.info] pseudo-device: devinfo0 Mar 7 18:12:03 paperbark genunix: [ID 936769 kern.info] devinfo0 is /pseudo/devinfo@0 Mar 7 18:12:06 paperbark sws.smc[290]: [ID 987397 daemon.notice] [1 admin.195 0 (SW) NOTICE]: Running with SWS Configuration file "/etc/ehttp/server.conf". Mar 7 18:12:10 paperbark sws.smc[290]: [ID 409041 daemon.error] [1 servlet.353 0 (SW) ERR]: Servlet smc load error. Mar 7 18:12:10 paperbark sws.smc[290]: [ID 420037 daemon.notice] [1 servlet.919 0 (SW) NOTICE]: Servlet Engine (with JSDK2.0) started. Mar 7 18:12:10 paperbark sws.smc[290]: [ID 111395 daemon.notice] [1 httpd.105 0 (SW) NOTICE]: Sun_WebServer/2.1 server started. Mar 7 18:12:15 paperbark sws.smc[290]: [ID 329940 daemon.notice] [1 httpd.135 0 (SW) NOTICE]: Shutting down server. Mar 7 18:12:18 paperbark sws.smc[368]: [ID 987397 daemon.notice] [1 admin.195 0 (SW) NOTICE]: Running with SWS Configuration file "/etc/ehttp/server.conf". Mar 7 18:12:19 paperbark sws.smc[368]: [ID 420037 daemon.notice] [1 servlet.919 0 (SW) NOTICE]: Servlet Engine (with JSDK2.0) started. Mar 7 18:12:19 paperbark sws.smc[368]: [ID 111395 daemon.notice] [1 httpd.105 0 (SW) NOTICE]: Sun_WebServer/2.1 server started. Mar 7 18:13:02 paperbark sendmail[250]: [ID 702911 mail.alert] unable to qualify my own domain name (paperbark) -- using short name paperbark%
With the Solaris 8 release, the devfsadm command manages the special device files in the /dev and /devices directories. The new devfsadmd daemon handles both processing of reconfiguration boot and updating of the /dev and /devices directories and responds to dynamic reconfiguration events. Because devfsadmd automatically detects device configuration changes generated by any reconfiguration event, you no longer need to perform a reconfiguration boot (boot -r) when you add most new hardware to a system. Some device addition and removal scenarios may still require you to perform a reconfiguration boot. For example, adding a USB Zip Drive requires a boot -r before the system can recognize the device. See Chapter 8, "Administering Devices," for more information. With the OpenBoot PROM, you can use the -r option to the boot command so that the operating system knows to look for new device drivers and incorporate them as part of the boot process.
1. Load the new device driver, following the instructions included with the hardware. 2. Shut down your system and install the new hardware. 3. Type boot -r and press Return. A reconfiguration script is run to load all the device drivers listed in the modules directories and to create the corresponding hardware nodes. Alternatively, if you add another device with the driver already installed, you can use the following commands to tell the system to recognize the new device.
1. Become superuser. 2. Type halt -d and press Return. The disk is synchronized and a crash dump is written and the OpenBoot PROM ok prompt is displayed. A message like the following example is displayed:
dumping to /dev/dsk/c1t0d0s1 offset 107479040, content: kernel. 100% done: 11207 pages dumped, compression ratio 2.95, dump succeeded Program terminated
Dumps are compressed to improve performance and to fit more information into existing swap partitions. Typing the dumpadm command with no arguments shows the current settings, as shown in the following example.
mopoke% su Password: # dumpadm Dump content: Dump device: Savecore directory: Savecore enabled: #
Refer to the dumpadm(1M) manual page for more information. The savecore(1M) command works with alternative kernels. In the past, the symbol table was generated from the currently installed kernel. The symbol table is now part of the dump. Before this change, if you patched the Solaris kernel and then crashed before you rebooted the system, the crash dump was useless because the symbol table generated was from the patched kernel, not the running kernel. savecore supports large files because the file it writes can be greater than 2 Gbytes.
You can administer the crash dump facility with the dumpadm(1M) command, which provides the following capabilities.
Turn on or off saving crash dumps. Set up a dedicated dump device (raw partition) or swap entry. The default is the best swap partition. Change directory where savecore(1M) puts its files. The default is /var/crash/hostname. Dump all memory or only kernel pages. The default is kernel.
1. Type the stop key sequence for your system. The specific sequence depends on your keyboard type. For example, you can press Stop-A or L1-A. On terminals, press the Break key. 2. At the ok prompt, type sync and press Return. The disk is synchronized and a crash dump is written. 3. When you see the syncing file systems... message, press the abort key sequence again. 4. At the ok prompt, type boot kadb and press Return. 5. Review kadb booting messages (starting with Rebooting with command: kadb) to verify that the system is booting with the kernel debugger. Refer to the kadb(1M) manual page for information about how to use the kernel debugger.
1. Boot from the installation CD-ROM (boot cdrom -s) or from an installation server on the network (boot -net -- -s) and press Return. 2. Type mount /dev/dsk/ device-name /a and press Return. 3. Type cd /a/ directory and press Return. 4. Type TERM=sun;export TERM and press Return. 5. Remove the invalid entry from the file with an editor such as vi. 6. 7.
4. 5. 6. Type cd / and press Return. 7. Type umount /a and press Return. 8. Type init 6 and press Return. The system is rebooted. 9. Verify that the system boots to run level 3. The login prompt is displayed when the boot process has finished successfully. The following example shows how to repair the /etc/passwd file after booting from a local CD-ROM.
ok boot cdrom -s (Boot messages are displayed here) # mount /dev/dsk/c0t3d0s0 /a # cd /a/etc # TERM=sun;export TERM # vi passwd (Remove or edit invalid entry) # cd / # umount /a # init 6
1. Boot from the Solaris 2 installation CD or from the network. Use steps a through g. If you are booting from the network, skip step a. a. Insert the Solaris 2 installation CD into the CD-ROM drive. b. (Optional) If the disk you are booting from doesn't contain the Solaris 8 Intel Platform Edition or compatible version, insert the Configuration Assistant/Boot Diskette into the primary diskette drive (DOS drive A). c. If the system displays the Type any key to reboot prompt, press any key to reboot the system. At this prompt, you can also press the reset button. If the system is shut down, turn the system on with the power on/off switch. d.
c.
d. At the Solaris Device Configuration Assistant screen, press the F2 key (F2_Continue). Device identification is performed, and a screen identifying the devices is displayed. e. At the Identified Devices screen, press the F2 key (F2_Continue). Bootable drivers are loaded. f. From the Boot Solaris screen, select the CD-ROM drive or network as the boot device. Then, press the F2 key (F2_Continue). The Solaris boot option screen is displayed. g. At the Select the type of installation: prompt, type b -s and press Return. After a few minutes, the single-user mode # prompt is displayed. 2. Type mount /dev/dsk/ device-name /a and press Return. The root file system is mounted. 3. Type cd /a/ directory and press Return. 4. Type TERM=sun;export TERM and press Return. The terminal type is set and exported. 5. Remove the invalid entry from the file with an editor such as vi. 6. Type cd / and press Return. 7. Type umount /a and press Return. 8. Type init 6 and press Return. The system is rebooted. 9. Verify that the system boots to run level 3. The login prompt is displayed when the boot process has finished successfully. The following example shows how to repair the /etc/passwd file after you boot from a local CD-ROM.
Type any key to reboot SunOS Secondary Boot version 3.00 Solaris Intel Platform Edition Booting System Running Configuration Assistant... Autobooting from Boot path: /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:a If the system hardware has changed, or to boot from a different device, interrupt the autoboot process by pressing ESC.
Press ESCape to interrupt autoboot in 5 seconds. . . . Boot Solaris Select one of the identified devices to boot the Solaris kernel and choose Continue. To perform optional features, such as modifying the autoboot and property settings, choose Boot Tasks. An asterisk (*) indicates the current default boot device. > To make a selection use the arrow keys, and press Enter to mark it [X]. [ ] NET : DEC 21142/21143 Fast Ethernet on Board PCI at Dev 3 [ ] DISK: (*) Target 0, QUANTUM FIREBALL1280A on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1 [ ] DISK: Target 1:ST5660A on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1 [ ] DISK: Target 0:Maxtor 9 0680D4 on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1 [ ] CD : Target 1:TOSHIBA CD-ROM XM-5602B 1546 on Bus Mastering IDE controller on Board PCI at Dev 7, Func 1 F2_Continue F3_Back F4_Boot Tasks F6_Help . . . <<< Current Boot Parameters >>> Boot path: /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0:a Boot args: kernel/unix -r Select the type of installation you want to perform: 1 Solaris Interactive 2 Custom JumpStart 3 Solaris Web Start Enter the number of your choice followed by <ENTER> the key. If you enter anything else, or if you wait for 30 seconds, an interactive installation will be started. Select type of installation: b -s . . . # mount /dev/dsk/c0t0d0s0 /a . . . # cd /a/etc # vi passwd (Remove invalid entry) # cd / # umount /a # init 6
ok
Type boot and press Return to restart the boot process, or type help and press Return to display a list of help options. If your terminal shows the > monitor prompt, type n to get the ok prompt.
/etc/telinit and /sbin/init /usr/sbin/halt /usr/sbin/reboot /usr/sbin/uadmin These commands initiate shutdown procedures, kill all running processes, write out any new data to the disk, and shut down the Solaris Operating Environment to the appropriate run level.
shutdown
Use the shutdown command when shutting down a system with multiple users. The shutdown command sends a warning message to all users who are logged in, waits 60 seconds (the default), and then shuts down the system to single-user state. You can choose a different default wait time.
NOTE. Use telinit/init and shutdown as the preferred method of changing system state. These programs are the most reliable way to shut down a system because they use a number of rc scripts to kill running processes.
halt
Use the halt command when the system must be stopped immediately and it is acceptable not to warn any current users. The halt command shuts down the system without any delay and does not warn any other users on the system. The halt command does not run the rc shutdown scripts and is not the preferred method for shutting down a system.
reboot
Use the reboot command to shut down a system that does not have multiple users and to bring it back into multiuser state. The reboot command does not warn users on the system, does not run the rc scripts, and is not the preferred method for shutting down a system.
1. Type who and press Return. A list of all logged in users is displayed. 2. Type ps -ef and press Return. A list of system activities is displayed. If the activity is acceptable for running shutdown, go to the next step. 3. Become superuser. 4. Type /usr/sbin/shutdown and press Return. You are asked to confirm that you want to shut down the system. 5. Type y. A message is broadcast to all users. After a 60-second wait, the system is shut down to singleuser state, and you are prompted for the root password. 6. Type the root password. The system is in single-user state, and you can perform any maintenance task. 7. Press Control-D to return to the default run system level.
paperbark% su Password: # cd / # shutdown Shutdown started. Tue May 2 13:16:57 WST 2000
Broadcast Message from root (pts/7) on paperbark Tue May 2 13:16:59... The system paperbark will be shut down in 1 minute Broadcast Message from root (pts/7) on paperbark Tue May 2 13:17:29... The system paperbark will be shut down in 30 seconds Do you want to continue? (y or n): y Broadcast Message from root (pts/7) on paperbark Tue May 2 13:17:53... THE SYSTEM paperbark IS BEING SHUT DOWN NOW! ! !
LOG OFF NOW OR RISK YOUR FILES BEING DAMAGED (Shutdown messages) INIT: SINGLE USER MODE Type control-d to proceed with normal startup, (or give root password for system maintenance):
1. Become superuser. 2. Type /usr/sbin/shutdown -y and press Return. The shutdown proceeds without asking you to type y to confirm.
1. Become superuser. 2. Type cd / and press Return. 3. Type /usr/sbin/shutdown -g nnn and press Return. The grace period is changed to the number of seconds you specify. The following example changes the grace period to 120 seconds.
# cd / # shutdown -g120
1. Become superuser. 2. Type cd / and press Return. You must be in the root directory to run the shutdown command. 3. Type shutdown -i6 and press Return. A message is broadcast to all users and the rc scripts are executed; the system is shut down to power-down state and then brought back up to multiuser state.
[ Team LiB ]
Monitoring Processes
The programs that are running on a system at any one time are called processes . You can monitor the status of processes, control how much CPU time a process gets, find or signal processes, and suspend or halt the execution of a process.
Refer to the ps (1), dispadmin (1M), priocntl (1), nice (1), renice (1), pgrep (1), and pkill (1) manual pages for complete information about these commands. In addition, the /usr/proc/bin directory contains process tools that you can use to display highly detailed information about the processes listed in /proc . The /proc directory is also known as the process file system (procfs ). ProcFS maps process information into the file system, enabling you to manipulate process attributes with a file-access paradigm. For more information about the /proc file system, see "Types of File Systems" on page 182. The process tools are similar to some options of the ps command, except that the output provided by the tools is more detailed. In general, the process tools do the following. Display more details about processes, such as fstat and fcntl information, working directories, and trees of parent and child processes. Provide control over processes, enabling users to stop or resume them. Table 10 summarizes the /usr/proc/bin commands.
pcred pid Display credentials. pfiles pid Display fstat and fcntl information for open files. pargs Print the command arguments (argv[] ), environment variables, or auxiliary vector. New in the Solaris 9 release. pflags pid Show /proc tracing flags, pending and held signals, and other status information for each LWP. pldd pid Show dynamic libraries linked into each process. pmap pid Show address map space. prun pid Restart the process. psig pid Display signal actions.
pstack pid Display hex+symbolic stack trace for each LWP. pstop pid Stop the process. ptime pid Time the process, using microstate accounting. ptree pid Show process trees containing specified PIDs. pwait pid Wait for the specified processes to terminate. pwdx pid Display current working directory.
Starting with the Solaris 8 release, some of the proc tools can also be applied to corefiles. A corefile is a snapshot of a process's state and is produced by the kernel before terminating a process with a signal or with the gcore (1) command. Some of the proc tools may need to derive the name of the executable corresponding to the process that dumped core or the names of shared libraries associated with the process. These files are needed, for example, to provide symbol table information for pstack (1). If the proc tool in question is unable to locate the needed executable or shared library, some symbol information is unavailable for display. Similarly, if a corefile from one operating system release is examined on a different operating system release, the runtime link-editor debugging interface (librtld_db ) may not be able to initialize. In this case, symbol information for shared libraries is not available. For a complete description of the process tools, refer to the proc (1) manual page. For information about how to use the process tools commands to display details about processes and how to start and stop them, see "Using the /usr/proc/bin Commands" on page 55.
PID (process ID). UID (user ID). Priority. Control terminal. Memory use. CPU time. Current status. The ps command takes a snapshot of system activity at the time you type the command. If you are monitoring system activity by time, be aware that the results are already slightly out-of-date by the time you read them. Table 11 shows the most frequently used options for the ps command. See the ps (1) manual page for a complete list of options.
e Report on all processes. f Show the owner of the process, by name instead of by UID, in the first column. This option turns off 1 , t , s , and r and turns on a . l Generate a long report, which includes all fields except STIME .
mopoke% ps -e
PID 0 1 2 3 411 237 208 49 56 115 179 133 189 155 213 170 176 511 193 226 440 414 261 249 248 250 266 268 401 372 283 284 416 434 454 432 439 450 487 503 484 485 584 419 418 402 415 395 392 412 417
TIME 0:16 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:02 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:23 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:04 0:00 0:00 0:00 0:00
CMD sched init pageout fsflush sac utmpd nscd sysevent picld in.route automoun rpcbind syslogd inetd lpsched lockd statd dtfile cron powerd Xsession ttymon vold smcboot smcboot smcboot htt htt_serv dmispd auditd dwhttpd dwhttpd sshd sendmail speckeys sendmail dtlogin fbconsol csh dtsessio sdt_shel dsdm ftp mibiisa fbconsol snmpXdmi Xsun dtlogin snmpdx ttymon dtlogin
504 ? 502 pts/3 510 ? 537 ? 513 ?? 514 ? 515 pts/3 516 pts/3 548 ? 518 ? 535 pts/7 522 pts/4 525 pts/5 529 pts/6 638 pts/4 569 ? 568 ? 570 ? 571 ? mopoke%
0:00 0:00 0:01 0:00 0:01 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:04 0:00 0:00 0:00
rpc.ttdb ttsessio dtwm rpc.rsta dtterm sdtperfm sh dtpad cat sdtvolch csh csh csh csh ps .netscape netscape netscape .netscape
The columns are described in Table 12 . PID Process identification number. TTY The terminal from which the process (or its parent) started. If the process has no controlling terminal, this column contains a question mark (?). Processes with question marks usually are system processes. TIME The cumulative amount of CPU time used by the process. CMD The name of the command that generated the process. Note that for the ps -e command only the first eight characters of the file name are displayed.
When you type ps -el and press Return, you get a listing that looks like the following example.
mopoke% ps -el F S UID PID PPID C PRI NI ADDR 19 T 0 0 0 0 0 SY ? 8 S 0 1 0 0 40 20 ? 19 S 0 2 0 0 0 SY ? 19 S 0 3 0 0 0 SY ? 8 S 0 411 1 0 40 20 ? 8 S 0 237 1 0 40 20 ? 8 S 0 208 1 0 40 20 ? 8 S 0 49 1 0 40 20 ? 8 S 0 56 1 0 40 20 ? 8 S 0 115 1 0 40 20 ? 8 S 0 179 1 0 40 20 ? 8 S 0 133 1 0 40 20 ? 8 S 0 189 1 0 40 20 ? 8 S 0 155 1 0 40 20 ? 8 S 0 213 1 0 40 20 ? 8 S 0 170 1 0 40 20 ? 8 S 1 176 1 0 40 20 ? 8 S 1001 511 503 0 50 20 ? 8 S 0 193 1 0 40 20 ? 8 S 0 226 1 0 40 20 ? 8 S 1001 440 439 0 40 20 ? 8 S 0 414 411 0 40 20 ? 8 S 0 261 1 0 40 20 ? 8 S 0 249 248 0 40 20 ? (Additional lines deleted from this example)
SZ 0 150 0 0 216 130 349 268 367 207 475 272 414 297 391 266 306 1097 253 174 240 217 363 215
WCHAN ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
TTY ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
TIME 0:16 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:02 0:00
CMD sched init pageout fsflush sac utmpd nscd sysevent picld in.route automoun rpcbind syslogd inetd lpsched lockd statd dtfile cron powerd Xsession ttymon vold smcboot
NOTE. The ADDR field is obsolete and contains only question marks.
Hexadecimal flags, which, added together, indicate the process's current state. These flags are available for historical purposes. You should ascribe no meaning to them.
00 The process has terminated. Its place in the process table is free.
04 The process is being traced by its parent and has been stopped.
20 The process cannot be swapped. S The current state of the process, as shown by one of the following letters.
R Ready to run.
Z Zombie. The process has terminated and the parent is not waiting, but the dead process is still in the process table.
X Waiting for more memory. UID The user ID of the owner of the process. PID The process identification number. PPID The parent process's identification number. C The process's CPU use (that is, an estimate of the percentage of CPU time used by the process). PRI
The process's scheduling priority. Higher numbers mean lower priority. NI The process's nice number, which contributes to its scheduling priority. Making a process "nicer" means lowering its priority so it does not use up as much CPU time. ADDR The memory size of the process. Note that the ADDR field is obsolete and is not displayed with some options. SZ The amount of virtual memory required by the process. This is a good indication of the demand the process puts on system memory. WCHAN The address of an event for which the process is sleeping. When this field is blank, the process is running. TTY The terminal from which the process (or its parent) started, or a question mark to indicate there is no controlling terminal (which usually indicates a system process). TIME The total amount of CPU time used by the process since it began. COMD The command being run by the process.
running a script that starts a lot of background jobs without waiting for any of the jobs to terminate. Talk to the user to find out if that's the case. If necessary, use the kill command to terminate some of the processes. See "Killing Processes" on page 53 for more information on killing a process. Look at the TIME field for processes that have accumulated a large amount of CPU time. Such processes might be in an endless loop. Look at the C field to find unimportant processes that consume a large percentage of CPU time. If you do not think a process warrants so much attention, use the priocntl command to lower its priority. See the priocntl (1M) manual page for more information. Look at the SZ field for processes that consume too large a percentage of memory. If a process is a memory hog, you may need to kill the process. If many processes are using lots of memory, the system may need more memory. Watch for a runaway process that uses progressively more CPU time. You can check this by using the -f option to see the start time (STIME ) of the process and by watching the TIME field for the accumulation of CPU time.
Signalling a Process
The Solaris Operating Environment provides a way to signal processes. A signal is an asynchronous notification of an event. With signals, you can interrupt a process or a thread within a process as the result of a specific event. Asynchronous signals can result from the current instruction stream. Such signals originate as hardware trap conditions for conditions such as illegal address references (segmentation violation) and illegal math operations (floating-point exceptions). The system also implements asynchronous signals that result from an external event that may not be related to the current instruction stream. Examples of such signals are job control signals, one process or thread sending a signal to another, or a kill signal sent to terminate a process. For example, the SIGHUP signal hangs up a process, SIGINT interrupts a process, and SIGKILL kills a process. Refer to signal (3HEAD) for a complete list of signals. Most signals can be ignored, a signal can be caught and a process-specific signal handler invoked, or a process can permit the default action to be taken. Every signal has a predefined default action.
Killing Processes
You can use the kill command to deliver different signal types to programs. Many of those signals instruct a program to perform some predetermined and normal action. The following section describes how to use the kill command to terminate a process. You can use the kill command to eliminate a process entirely. The syntax of the kill command is kill -signal PID , where signal is a number or a name and PID is the process ID of the process to which you send the signal. The usual way to kill a process is to send it a certain signal. The TERM (-15 ) signal generally cleanly
shuts down a process. If TERM (or some other signal you know the process is prepared to accept and act on) doesn't work, then you can send the KILL (-9 ) signal as a last resort. The KILL (-9 ) signal may result in loss of data, so you should not use it indiscriminately. Sometimes processes do not die when you use the kill command. The three most common cases are listed below. The process is waiting for a device, such as a tape drive, to complete an operation before exiting. The process is waiting for resources that are unavailable because of NFS problems. To kill such a process, type kill -QUIT PID . The process is a zombie, as shown by the message defunct in the ps report. A zombie process is one that has had all its resources freed but has not received an acknowledgment from a parent process, receipt of which would ordinarily remove its entry from the process table. The next time a system is booted, zombie processes are cleared. The Solaris 9 Operating Environment provides the preap (1) command that you can use to force a defunct process to be reaped by its parent. Use the following steps to kill a process. 1. Become superuser. You must be superuser to kill a process that you do not own. 2. Type ps -e and press Return. A list of the processes is displayed. Use the PID (process ID) number in the first column as input to the next step. If you know which process is causing the problem, you can type ps -e | grep process-name and press Return to focus your search. 3. Type kill PID and press Return. When you type kill with no signal argument, signal 15 is sent. 4. Type ps -e and press Return. Check to see if the process has terminated. If it's still there, go to step 5. 5. Type kill -9 PID and press Return. The process should be terminated. To see a description of the signals used by kill , type man s5 signal and press Return. In the following example, OpenWindows is frozen on the system oak . You must log in remotely from another system and kill the process.
elm% rlogin oak Password: oak% ps -e | grep openwin PID TTY TIME COMD 2212 pts/0 0:00 openwin 2213 pts/1 0:00 grep openwin oak% su Password: oak# kill 2212 oak# exit oak% logout elm%
Display fstat and fcntl information for open files. pflags pid
[*]
Show /proc tracing flags, pending and held signals, and other status information for each LWP. pldd pid
[*]
Show address map space. prun pid Restart the process. psig pid
[*]
pstop pid Stop the process. ptime pid Time the process, using microstate accounting. ptree pid Show process trees containing specified PIDs. pwait pid Wait for specified processes to terminate. pwdx pid
[*]
Description
NOTE. If you use the /usr/proc/bin commands frequently, add the process tool directory to your PATH variable to make the commands more easily accessible .
All of the /usr/bin/proc commands use the process ID (PID) as the argument to the command. You can obtain the PID by using the ps -e and the grep commands to search for the name of the process you want more information about. The following example displays the PID for the openwin process in the first column.
oak% ps -e | grep openwin PID TTY TIME COMD 2212 pts/0 0:00 openwin 2213 pts/1 0:00 grep openwin oak%
castle% ps -e | grep dtlogin 283 ? 0:00 dtlogin 270 ? 0:01 dtlogin castle% # /usr/proc/bin/pcred 283 283: e/r/suid=0 e/r/sgid=0 groups: 1 0 2 3 4 5 6 7 8 9 12 # exit castle% /usr/proc/bin/ptime 283 real 0.016 user 0.000 sys 0.016 castle% # /usr/proc/bin/pfiles 283 283: /usr/dt/bin/dtlogin -daemon Current rlimit: 64 file descriptors 0: S_IFDIR mode:0755 dev:32,24 ino:2 uid:0 gid:0 size:1024 O_RDONLY|O_LARGEFILE 1: S_IFDIR mode:0755 dev:32,24 ino:2 uid:0 gid:0 size:1024 O_RDONLY|O_LARGEFILE 2: S_IFREG mode:0644 dev:32,24 ino:326220 uid:0 gid:0 size:49 O_WRONLY|O_APPEND|O_LARGEFILE 3: S_IFCHR mode:0666 dev:32,24 ino:406038 uid:0 gid:3 rdev:13,12 O_RDWR 4: S_IFIFO mode:0666 dev:171,0 ino:4124779288 uid:0 gid:0 size:0 O_RDWR|O_NONBLOCK 5: S_IFREG mode:0644 dev:32,24 ino:326221 uid:0 gid:0 size:4 O_WRONLY|O_LARGEFILE advisory write lock set by process 270
7: S_IFSOCK mode:0666 dev:166,0 ino:32032 uid:0 gid:0 size:0 O_RDWR 8: S_IFDOOR mode:0444 dev:171,0 ino:4124780632 uid:0 gid:0 size:0 O_RDONLY|O_LARGEFILE FD_CLOEXEC door to nscd[174] # # /usr/proc/bin/pflags 283 283: /usr/dt/bin/dtlogin -daemon /1: flags = PR_PCINVAL|PR_ORPHAN|PR_ASLEEP [ wait() ] # # /usr/proc/bin/pldd 283 283: /usr/dt/bin/dtlogin -daemon /usr/openwin/lib/libXmu.so.4 /usr/openwin/lib/libX11.so.4 /usr/dt/lib/libDtSvc.so.1 /usr/lib/libresolv.so.2 /usr/lib/libdl.so.1 /usr/lib/libbsm.so.1 /usr/lib/libauth.so.1 /usr/lib/libsocket.so.1 /usr/lib/libnsl.so.1 /usr/dt/lib/libSDtFwa.so.1 /usr/lib/libc.so.1 /usr/openwin/lib/libXt.so.4 /usr/openwin/lib/libSM.so.6 /usr/openwin/lib/libICE.so.6 /usr/openwin/lib/libXext.so.0 /usr/lib/libm.so.1 /usr/openwin/lib/libtt.so.2 /usr/dt/lib/libXm.so.3 /usr/lib/libmp.so.2 /usr/lib/nss_files.so.1 /usr/lib/libpam.so.1 # # /usr/proc/bin/pmap 283 283: /usr/dt/bin/dtlogin -daemon 00010000 108K read/exec /usr/dt/bin/dtlogin 0003A000 32K read/write/exec /usr/dt/bin/dtlogin 00042000 80K read/write/exec [ heap ] EEE90000 12K read/shared dev:32,24 ino:196384 EEEA0000 12K read/shared dev:32,24 ino:196384 EEEB0000 12K read/shared dev:32,24 ino:196384 EEEC0000 8K read/write [ anon ] EEF11000 4K read/write [ anon ] EEF89000 4K read/write [ anon ] EF001000 4K read/write [ anon ] EF060000 24K read/exec /usr/lib/libpam.so.1 EF075000 4K read/write/exec /usr/lib/libpam.so.1 (More information, not shown here) EF7C0000 4K read/exec/shared /usr/lib/libdl.so.1 EF7D0000 112K read/exec /usr/lib/ld.so.1 EF7FB000 8K read/write/exec /usr/lib/ld.so.1 EF7FD000 4K read/write/exec [ anon ]
EFFF9000 28K read/write/exec total 5480K # # /usr/proc/bin/psig 283 283: /usr/dt/bin/dtlogin -daemon HUP ignored INT caught RESETHAND,NODEFER QUIT ignored ILL default TRAP default ABRT default EMT default FPE default KILL default BUS default SEGV default SYS default PIPE ignored ALRM default TERM caught RESETHAND,NODEFER USR1 caught RESETHAND,NODEFER USR2 default CLD default NOCLDSTOP PWR WINCH URG POLL STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ WAITING LWP FREEZE THAW CANCEL LOST RTMIN RTMIN+1 RTMIN+2 RTMIN+3 RTMAX-3 RTMAX-2 RTMAX-1 RTMAX # default default default default default default default ignored default default default ignored ignored default default default default default default default default default default default default default default
[ stack ]
# /usr/proc/bin/pstack 283 283: /usr/dt/bin/dtlogin -daemon ef479154 wait () ef479154 _libc_wait (0, 3ec4c, 3b000, 12d, ef4e227c, 1e340) + 8 0001e340 ManageSession (43000, 43000, 482f8, ef001230, 81010100, c) + 454 00019348 StartDisplay (482f8, 3c954, 43000, 3b224, ef001240, ff00) + 7bc 0001a324 ForEachDisplay (189a8, 0, 2400, 41800, 42e48, 17ca8) + 1c 00017d54 main (0, effffefc, efffff08, 3b000, 0, 0) + 228 0001541c _start (0, 0, 0, 0, 0, 0) + dc # # /usr/proc/bin/pwdx 283 283: / # castle% /usr/proc/ptime 283 real 0.066 user 0.000 sys 0.032 castle% castle% ptree 283 270 /usr/dt/bin/dtlogin -daemon 283 /usr/dt/bin/dtlogin -daemon 301 /bin/ksh /usr/dt/bin/Xsession 311 /usr/openwin/bin/fbconsole 346 /usr/dt/bin/sdt_shell -c unsetenv _ PWD; unsetenv DT; 349 -csh -c unsetenv _ PWD; unsetenv DT; setenv DISP 366 /usr/dt/bin/dtsession 373 dtwm 374 dtterm -session dt0vPI0t -sdtserver 387 /bin/csh 407 ./textedit 528 sh 390 /bin/csh 393 /bin/csh 417 /usr/openwin/bin/cmdtool 420 /bin/csh 531 /bin/csh 553 ptree 283 375 dtfile -session dtbfiQD_ 405 dtfile -session dtbfiQD_ 376 snapshot -Wp 781 588 -Ws 326 201 -WP 6 6 +Wi -f snapshot.rs castle%
system or to execute a command with specified scheduling parameters. Solaris provides several scheduling classes, each with its own scheduling policy. A process can be assigned to one of these classes; the process priority can then be adjusted within the boundaries allowed by that particular scheduling class. System (SYS ). Use the system scheduling class to schedule the execution of certain special system processes such as the swapper process. Interactive (IA ). Use the interactive class to provide good response time to interactive processes and good throughput to CPU-bound jobs. This class gives snappier performance than does SYS for GUI programs such as X11, CDE, and OpenWindows that the user interacts with. You can change the processes of the interactive class in the same way as those in the timesharing class, although the modified priorities continue to be adjusted to provide good responsiveness for user interaction. Real-time (RT ). Use the real-time class to provide a fixed-priority, preemptive scheduling policy for those processes that need fast responses and absolute user and application control of scheduling priorities. Timesharing (TS ). Use the timesharing class to provide fair and effective allocation of CPU resources among processes that have varying CPU consumption requirements. Fair-share (FS ), new in the Solaris 9 release. Use the fair-share class to provide a fair allocation of system CPU resources among projects independently of the number of processes they own. Processes are given "shares" to control their entitlement to CPU resources. Fixed-priority (FX ), new in the Solaris 9 release. Use the fixed-priority class to provide a fixed-priority, preemptive-scheduling policy for those processes that cannot handle dynamic adjustments and require that the user or application have control of the scheduling priorities. The fixed-priority class values range from 060. For the timesharing class, the user-supplied priority ranges from 20 to +20. The priority of a timeshare process, referred to as the user-mode priority, is inherited from the parent process. The system looks up the user-mode priority in its timesharing dispatch parameter table, adds in any nice or priocntl (user-supplied) priority, and ensures a 059 range to create a global priority. In the default configuration, a runnable real-time process runs before any other process. Inappropriate use of real-time processes can have a dramatic, negative impact on system performance.
Starting with the Solaris 9 release, you can create permanent processor sets, called resource pools, and associate a scheduling class with that set. You can then assign projects to that resource pool. Use the poolcfg (1M) command to create XML-based pool configuration files. The systemwide configuration is stored in /etc/pooladm.conf . Once you have created a pool configuration file, activate it with the pooladm (1M) command, which is also automatically run at boot time if the /etc/pooladm.conf file is present. You can bind processes, tasks, or projects to a pool with the poolbind (1M) command or query the binding for a process, if you have the appropriate authorizations. You can also specify the binding of a project to a pool with an attribute in the project (4) database. This binding is used when you are logging in or when you use the newtask (1) command. Solaris 9 also introduces the concept of a task, which is a collection of processes. Tasks remove the limitations of current process aggregates such as process groups and sessions. Tasks are bound to projects whose membership and attributes are described in the project (4) database. The SMC Projects tool is a GUI front end that you can use to administer projects and tasks in addition to the commands. Refer to Sun's System Administration Guide: Resource Management and Network Services and the relevant manual pages for more information about creating and administering resource management pools.
paperbark% priocntl -l CONFIGURED CLASSES ================== SYS (System Class) TS (Time Sharing) Configured TS User Priority Range: -60 through 60 IA (Interactive) Configured IA User Priority Range: -60 through 60 paperbark%
With the -c option to ps , higher numbers in the PRI column mean higher priority. Without the -c option, higher numbers mean lower priority.
The following example shows the output from the ps -ecl command. Data in the PRI column shows that pageout has the highest priority at 98 , and the dtfile , dtpad , and dtsession commands have the lowest at 49 .
mopoke% ps -ecl F S UID PID 19 T 0 0 8 S 0 1 19 S 0 2 19 S 0 3 8 S 0 411 8 S 0 237 8 S 0 208 8 S 0 49 8 S 0 56 8 S 0 115 8 S 0 179 8 S 0 133 8 S 0 170 8 S 0 155 8 S 0 189 8 S 0 213 8 S 1 176 8 S 0 193 8 S 0 226 8 S 0 414 8 S 0 261 8 S 0 249
ADDR ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
SZ 0 150 0 0 216 130 347 268 367 207 475 272 266 297 414 391 306 253 174 217 363 215
WCHAN TTY ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
TIME 0:13 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:02 0:00
CMD sched init pageout fsflush sac utmpd nscd sysevent picld in.route automoun rpcbind lockd inetd syslogd lpsched statd cron powerd ttymon vold smcboot
8 S 0 8 S 0 8 S 0 8 S 0 8 S 1001 8 S 0 8 S 1 8 S 1 8 S 0 8 S 1001 8 S 1001 8 S 1001 8 S 0 8 S 1001 8 S 1001 8 S 1001 8 S 1001 8 S 1001 8 O 1001 8 S 0 8 S 0 8 S 0 8 S 0 8 S 0 8 S 0 8 S 0 8 S 0 8 S 1001 8 S 0 8 S 1001 8 S 1001 8 R 1001 8 S 1001 8 S 1001 8 S 1001 8 S 1001 8 S 1001 8 S 0 8 S 1001 8 S 1001 8 S 1001 8 S 1001 8 S 0 8 S 25 mopoke%
248 250 266 268 416 372 283 284 417 483 446 436 435 450 499 507 480 481 555 419 401 415 402 395 418 391 412 498 500 506 528 509 510 518 512 519 545 520 522 525 531 544 546 547
1 248 1 266 395 1 1 283 395 480 436 435 417 1 483 499 436 1 522 391 1 1 1 1 395 1 1 1 155 499 509 499 499 498 1 518 507 155 509 509 509 512 1 1
TS TS TS TS IA TS TS TS IA IA IA IA IA IA IA IA IA IA IA TS TS TS TS TS IA TS TS IA TS IA IA IA IA IA IA IA IA TS IA IA IA IA TS TS
59 59 59 59 59 59 59 59 59 59 59 59 59 59 49 49 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 49 49 59 59 59 59 59 59 59
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
215 215 121 378 3568 227 1178 1277 662 184 292 240 662 639 999 1097 496 295 138 288 384 331 439 621 292 268 217 574 427 1158 180 1004 921 137 239 907 1097 230 180 180 180 122 565 561
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? pts/3 ? ? ? ? pts/3 ? pts/3 ? pts/4 ? ? ? ? ? ?? ? console pts/3 ? ? pts/6 ? ? pts/3 ? pts/3 ? ? pts/4 pts/5 pts/7 ? ? ?
0:00 0:00 0:00 0:00 0:07 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:02 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00
smcboot smcboot htt htt_serv Xsun auditd dwhttpd dwhttpd dtlogin csh fbconsol Xsession dtlogin speckeys dtsessio dtfile sdt_shel dsdm ps mibiisa dmispd sshd snmpXdmi dtlogin fbconsol snmpdx ttymon ttsessio rpc.ttdb dtwm csh dtterm sdtperfm sh sdtvolch dtpad dtfile rpc.rsta csh csh csh cat sendmail sendmail
You can also use the /usr/sbin/dispadmin -l command to display process scheduler information. The following example shows the output from the dispadmin -l command.
castle% /usr/sbin/dispadmin -l CONFIGURED CLASSES ================== SYS (System Class) TS (Time Sharing) IA (Interactive) castle%
# priocntl -e-c TS -m 60 -p 60 find . -name core -print mopoke% mopoke% ps -ecl | grep find
8 S mopoke%
686
682
TS
60
133
? pts/7
0:00 find
NOTE. You must be superuser or working in a real-time shell to change the class of a process from or to realtime .
1. Become superuser. 2. Type priocntl -s -c class -i id-type id-list and press Return. The -s option enables you to set the upper limit on the user priority range and change the current priority. The -c class option specifies the class, TS or RT , to which you are changing the process. The - i id-type and id-list options use a combination of id-type and id-list to identify the process. The id-type specifies the type of ID, such as PID or UID. 3. While the process is running, in another terminal window, type ps -ecl | grep command-name and press Return. 4. Review the output of the PRI column to verify that you have changed the process status successfully.
The following example changes all the processes belonging to user 1001 to timeshare processes.
# priocntl -s -c # ps -ecl | grep 8 S 1001 496 8 S 1001 497 8 S 1001 329 8 S 1001 350 8 S 1001 408 8 S 1001 360 8 S 1001 417 8 S 1001 364 8 S 1001 394
TS -i uid 1001 1001 481 TS 59 496 TS 59 308 TS 59 332 TS 59 1 TS 59 350 TS 59 409 TS 59 1 TS 59 391 TS 59
? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ?
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 #
S S S S S S S S S S S S S S S S S S S S S S
1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001
391 392 409 416 418 430 420 450 422 423 424 455 435 439 442 481 545 690 610 607 609 608
350 1 394 409 409 418 409 417 408 422 1 424 418 418 418 430 442 439 608 1 607 607
TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS TS
59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59 59
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
501 300 1015 1176 977 180 929 1105 137 913 240 122 180 180 182 131 517 235 2574 630 653 3165
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
pts/3 ? pts/3 ? ?? pts/4 ? ? pts/3 pts/3 ? ? pts/5 pts/6 pts/7 pts/4 pts/7 pts/6 ? ? ? ?
0:00 0:00 0:00 0:03 0:01 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:03 0:00 0:00 0:00 0:00 0:20
sdt_shel dsdm dtsessio dtwm dtterm csh sdtperfm dtfile sh dtpad sdtvolch cat csh csh csh man spider.e ftp .netscap netscape netscape .netscap
The valid class-specific options for setting fair-share parametersnew in the Solaris 9 releaseare shown in Table 15 .
-m fssuprilim Set the user-priority limit of the specified process(es) to fssuprilim . -p fssupri Set the user priority of the specified process(es) to fssupri .
The valid class-specific options for setting fixed-priority parametersnew in the Solaris 9 releaseare shown in Table 16 .
-m fxuprilim Set the user-priority limit of the specified process(es) to fxuprilim . -p fxupri Set the user priority of the specified process(es) to fxupri . -t tqntm [-r res] Set the time quantum of the specified process(es) to tqntm . You can optionally specify a resolution.
mopoke% su Password: # priocntl -e -c FX -m 20 -p 10 -t 250 ps -ef | grep priocntl root 701 674 0 01:01:52 pts/4 0:00 grep priocntl #
NOTE. The nice command is supported only for backward compatibility with previous Solaris releases. Use the priocntl command to manage process priorities .
The priority of a process is determined by the policies of its scheduling class and by its nice number. The global priority of each timesharing process is calculated by adding the user-supplied priority and the system-calculated priority. You can modify only the user-supplied priority. You can view the nice number of a process in the NI column of the output of the ps -l command.
The range of nice numbers is between 0 and +40, with 0 the highest priority. The default value is 20. You can use the priocntl command (preferred) or the nice command to raise or lower the priority of a command or a process. When you use the nice command without an argument, the default is to increase the nice number by four units, thus lowering the priority of the process.
NOTE. You must be superuser to raise the priority of a process with the nice command. Users can lower their own process priorities.
Use the following command to lower the priority of a command by four units (the default).
/usr/bin/nice command-name
Use the following command to lower the priority of a command by increasing the nice number by ten units.
NOTE. The plus sign (+) is optional for positive numbers. The minus sign () is required for negative numbers.
Use the following command to raise the priority of a command by lowering the nice number by ten units.
Use the following command to raise the priority of a command by lowering the nice number by ten units. The minus sign indicates a negative number.
The -n option specifies the system scheduling priority, and the -p option specifies the process ID numbers to adjust.
pgrep process-name
Refer to the pgrep (1) manual page for a complete listing of options and arguments. The following example uses pgrep to find the process ID of the sendmail command.
The pkill command works in the same way as pgrep except that it signals each matching process as would kill (1) instead of displaying the process ID. You can specify a signal name or number as the first command-line option to pkill . Refer to the pgrep (1) manual page for a complete listing of options and arguments for pkill . The following example terminates the most recently created xterm .
[ Team LiB ]
[ Team LiB ]
Changing Directories
To change directories, type cd pathname and press Return. The change directory command moves the focus to the directory whose name you type.
If you type cd and press Return without typing a path name, focus is returned to the login home directory.
Table 17.
Option -@
The same as -l except that extended attribute information supersedes ACL information. An at sign (@) is displayed after the file permission bits for files that have extended attributes. New in the Solaris 9 release. List all entries, including those that begin with a dot (.), which are normally not listed. List all entries, including those that begin with a dot (.) with the exception of the working directory (.) and the parent directory (..). Force printing of nonprintable characters to be in the octal \ ddd notation. Use time of last modification of the inode (file created, mode changed, and so forth) for sorting (-t) or printing (-l or -n). Display multicolumn output, and sort entries down the columns. This format is the default. If an argument is a directory, list only its name (not its contents); often used with -l to get the status of a directory.
-a -A -b -c -C -d
Option -f
Description Force each argument to be interpreted as a directory, and list the name found in each slot. This option turns off -l, -t, -s, and -r, and turns on -a; the order is the order in which entries appear in the directory. Mark directories with a trailing slash (/), doors with a trailing greater-than sign (>), executable files with a trailing asterisk (*), FIFOs with a trailing vertical bar (|), symbolic links with a trailing at-sign (@), and AF_UNIX address family sockets with a trailing equal sign (=). The same as -l, except do not print the owner. For each file, print the inode number in the first column of the report. List in long format, giving mode, ACL indication, number of links, owner, group, size in bytes, and time of last modification for each file. If the file is a special file, the size field contains the major and minor device numbers. If the time of last modification is greater than six months ago, it is shown in the format month date year for the POSIX locale. When the LC_TIME locale category is not set to the POSIX locale, a different format of the time field can be used. Files modified within six months show month date time. If the file is a symbolic link, the file name is printed, followed by -> and the path name of the referenced file. If an argument is a symbolic link, list the file or directory the link references instead of the link itself. Stream output format; list files across the page, separated by commas and spaces. The same as -l, except print the owner UID and group GID numbers instead of the associated character strings. The same as -l, except do not print the group. Put a slash (/) after each file name if the file is a directory. Force printing of nonprintable characters in file names as the character question mark (?). Reverse the order of sort to get reverse alphabetic or oldest first as appropriate. Recursively list subdirectories. Give size in blocks, including indirect blocks, for each entry. Sort by time stamp (latest first) instead of by name. The default is the last modification time. (See -u and -c.) Use time of last access instead of last modification for sorting (with the -t option) or printing (with the -l option). Display multicolumn output, and sort entries across instead of down the page. Print one entry per line of output.
-F
-g -i -l
-L -m -n -o -p -q -r -R -s -t -u -x -1
links, owner, group, file size in bytes, modification date and time, and the file name are displayed.
sys
The mode printed with the -l option consists of ten characters. The first character is one of the following. - The entry is an ordinary file. b The entry is a block special file. c The entry is a character special file. d The entry is a directory. D The entry is a door. l The entry is a symbolic link. p The entry is a FIFO (or named pipe) special file. s The entry is an AF_UNIX address family socket. The next nine characters are interpreted as three sets of three bits each. The first set refers to the owner's permissions; the next, to permissions of others in the user-group of the file; and the last, to all others. Within each set, the three characters indicate permission to read, to write, and to execute the file as a program. For a directory, execute permission is interpreted as permission to search the directory for a specified file. For user and group permissions, the third position can be occupied by x (execute) or - (deny access). For user permissions, s denotes the set-user-ID bit. For group permissions, it denotes the set-groupID bit. For example, the ability to assume the same user ID as the program owner during execution is used during login when you begin the process as root but then assume the identity of your user login. For group permissions, l can occupy the third position. l refers to mandatory file and record locking. This permission describes a file's ability to allow other files to lock its reading or writing permissions during access. For others permissions, the third position can be occupied by t or T. These refer to the state of the sticky bit and execution permissions. The permissions are described below.
r The file is readable. w The file is writable. x The file is executable. - The indicated permission is not granted. s The setuid or setgid bit is on, and the corresponding user or group execution bit is also on. S Undefined bit state (the setuid or setgid bit is on, and the user or group execution bit is off). t The 1000 (octal) bit, or sticky bit, is on (see chmod(1)), and execution is on. T The 1000 bit is on, and execution is off (undefined bit state). l Mandatory locking occurs during access (the setgid bit is on, and the group execution bit is off) (/usr/bin/ls). L Mandatory locking occurs during access (the setgid bit is on and the group execution bit is off) (/usr/xpg4/bin/ls). When you use the ls -l command, any file that has an access control list (ACL) displays a plus (+) sign to the right of the mode field. See the getfacl(1) and setfacl(1) manual pages or the Solaris Advanced System Administrator's Guide, published by Sun Microsystems Press and Prentice Hall, for more information about ACLs.
NOTE. If you specify the -@ optionnew in the Solaris 9 release to display extended attributes of a filethe presence of extended attributes supersedes the presence of an ACL and the + sign is replaced with an at sign (@).
To see a complete list of all files in the directory, type ls -l and press Return. See the ls(1) manual page for a complete list of options.
Table 18 shows some of the options to the find command that you can use to focus your searches.
anastasia%
In the following example, the file is a text file with executable permissions, so the file command reports that the file contains commands and is text.
anastasia% chmod 777 junk3 anastasia% file junk3 junk: commands text anastasia%
NOTE. You can, of course, determine if the command has execute permissions with the ls -l command.
To show the file type for all files in a directory, type file * and press Return. The files are listed in alphabetical order followed by the file type.
oak% grep csh /etc/passwd ignatz::6693:10:Iggy Ignatz 64607:/home/ignatz:/bin/csh fred::14072:10:Fred Lux:/home/fred:/bin/csh oak%
You can search more than one file by specifying a series of file names separated by spaces or by using metacharacters such as the asterisk (*) or question mark (?) together with (or in place of) the file name. To print lines that do not contain the specified string, type grep -v search-string filename and press Return. Lines in the file that do not contain the string are displayed.
oak% ps -e | grep openwin PID TTY TIME COMD 2212 pts/0 0:00 openwin oak%
Looking at Files
You undoubtedly will spend lots of time looking at the content of files. When you need to look at the entire file, use the more command. When the information you need is at the end of the file (for example, in a log file), use the tail command to display the last lines (10 by default) of the file. When important information is at the beginning of the file, use the head command to display the first lines (10 by default) of the file.
NOTE. You must use exact capitalization in the search string for the more command. If you type /local aliases in the previous example, the pattern is not found.
To search for the next occurrence of the search string, type n. To quit more, type q. The shell prompt is redisplayed. Another way to quit more, if Control-C is set as your shell kill character, is to press Control-C. The shell prompt is redisplayed. To display the shell intr (interrupt) character, type stty -a and press Return. A list of the stty settings is displayed. In the following example, ^c is the shell intr character.
castle% stty -a ispeed 88840 baud; ospeed 88824 baud; rows = 36; columns = 113; ypixels = 478; xpixels = 801; eucw 1:0:0:0, scrw 1:0:0:0 intr = ^c; quit = <undef>; erase = ^h; kill = ^u; eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^q; stop = ^s; susp = ^z; dsusp = ^y; rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v; -parenb parodd cs8 cstopb hupcl cread -clocal loblk crtscts crtsxoff parext -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc ixon -ixany ixoff -imaxbel isig icanon -xcase echo echoe echok -echonl -noflsh -tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel castle%
/* SVr4.0 1.2
*/
# This file previously contained an LP private interface. It's # contents are no longer used by the printing system and therefore # obsolete. Expect the file to be removed in a subsequent release # of Solaris, along with the lpsystem(1M) command. +:x:-:bsd:-:n:10:-:-:Allow all connections castle%
By default, the head and tail commands display 10 lines. You can change the number of lines displayed by using the -n option. Substitute the number of lines you want to display for the letter n. For example, to display the last 20 lines of a file, type tail -20 filename and press Return.
paperbark% head /etc/passwd root:x:0:1:Super-User:/:/sbin/sh daemon:x:1:1::/: bin:x:2:2::/usr/bin: sys:x:3:3::/: adm:x:4:4:Admin:/var/adm: lp:x:71:8:Line Printer Admin:/usr/spool/lp: uucp:x:5:5:uucp Admin:/usr/lib/uucp: nuucp:x:9:9:uucp Admin:/var/spool/uucppublic:/usr/lib/uucp/uucico listen:x:37:4:Network Admin:/usr/net/nls: nobody:x:60001:60001:Nobody:/: paperbark%
set rstchown = 1
set rstchown = 0
{_POSIX_CHOWN_RESTRICTED} is enabled by default. See system(4) and fpathconf(2). Use the following steps to change the ownership of a file.
1. Type ls -l filename and press Return. The owner of the file is displayed in the third column. 2. Become superuser if necessary. 3. Type chown new-owner filename and press Return. Ownership is assigned to the new owner you specify.
oak% su Password: # chown ignatz quest # ls -l quest -rw-r--r-- 1 ignatz staff 6023 Aug 5 12:06 quest #
See Chapter 12, "Recognizing File Access Problems," for more information.
1. Type ls -l filename and press Return. The long listing shows the current permissions for the file. 2. Type chmod nnn filename and press Return. Permissions are changed according to the numbers you specify.
NOTE. You can change permissions on groups of files or on all files in a directory by using metacharacters such as * and ? in place of file names or in combination with them.
The following example changes the permissions of a file from 666 (read/write, read/write, read/write) to 644 (read/write, read-only, read-only).
quest 1 ignatz staff 6023 Aug 5 12:06 quest 644 quest 1 ignatz staff 6023 Aug 5 12:06 quest
$ ls -lg junk -rw-r--r-- 1 other 0 Oct 31 14:49 junk $ chgrp 10 junk $ ls -lg junk -rw-r--r-- 1 staff 0 Oct 31 14:49 junk $
Group IDs are defined in the nameservice group database or the local /etc/group file. See Chapter 5, "Administering User Accounts and Groups," for more information about groups.
Search Path Applications Database: actions, data types, and front panel definitions Icons Help data
DTSPSYSICON DTSPSYSHELP
DTSPUSERICON DTSPUSERHELP
CDE components use the values of the output variables. For example, Application Manager uses the value of the application search path (DTAPPSEARCHPATH) to locate application groups. For more information about CDE, refer to Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide.
The Solaris Management Console (SMC)introduced in the Solaris 8 Update 3 (1/01) releaseis your access point for system administration tools. SMC software provides a consistent, easy-to-use interface for managing and administering a Solaris server, the clients of the server, and the applications running on the server. With SMC, you can manage a Solaris server from almost anywherefrom a browser, from any Solaris workstation or server, from an NT server, or as a stand-alone system. You can also plug SMC into other systems' consoles.
By default, SMC manages accounts on the local system. You can create a nameservice domain toolbox to manage accounts in the LDAP, DNS, NIS+, or NIS nameservices. Refer to the Solaris Management Console Tools book available from Sun Microsystems Press and Prentice Hall for instructions on how to create a nameservice domain toolbox. Refer to the Solaris Management Console Tools book, published by Sun Microsystems Press and Prentice Hall, for complete information about SMC 2.0, including how to create or edit an SMC toolbox, create a toolbox that is shared by other toolboxes, or create a toolbox that includes all tools on a number of servers for a particular functionality.
NOTE. This book focuses on basic system administration tasks and refers to the Solaris Management Console Tools book for detailed instructions on the tools available in SMC 2.0. The upcoming second edition of the Solaris Management Console Tools book will include information about the new tools available in the Solaris 9 SMC 2.1 release.
Category Storage
Tool
Description
View and manage mounts, shares, and usage information in the current management domain (single server only). Display disk information, display partition information, partition disks, copy disk layouts from one disk to a disk of the same size and manufacture, create fdisk partitions, and change the active fdisk partition on an IA computer. Create and manage RAID0 volumes, including stripes and concatenation; RAID! volumes, including mirrors; RAID5 volumes; soft partitions; hot spare pools; disksets; and the state configuration database (metab). New in SMC 2.1.
Enhanced Storage
Devices and Hardware Serial Ports Performance Configure and manage serial ports for modems and alphanumeric terminals. Monitor system performance on the local system. New in SMC 2.1.
Starting SMC
You can start SMC in any one of the following ways. By choosing Solaris Management Console from the Tools menu of the CDE front panel. By double-clicking on the SMC icon in CDE Applications Manager or File Manager. From a command line by typing /usr/sadm/bin/smc& and pressing Return.
NOTE. You can start SMC as a normal user, but some tools or applications may not load unless you log in as root, have Primary Administrator rights, or assume a role during SMC server login.
Refer to the Solaris Management Console Tools book by Janice Winsor, published by Sun Microsystems Press and Prentice Hall, for complete information about SMC, including how to create or edit an SMC toolbox, create a toolbox that is shared by other toolboxes, or create a toolbox that includes all tools on a number of servers for a particular functionality. [ Team LiB ]
[ Team LiB ]
[ Team LiB ]
Determining Who Is Logged In to a System (w, who, finger, rusers -l, whodo)
You can use any one of the following commands (w, who, finger, rusers -l, or whodo) to find out who is logged in to a system. Each command gives you different information.
paperbark% w 3:29pm up 1:45, User tty winsor console unseten winsor pts/4 winsor pts/5 winsor pts/6 winsor pts/7 paperbark%
1 user, load average: 0.00, 0.00, 0.01 login@ idle JCPU PCPU what 1:46pm 1:43 /usr/dt/bin/sdt_shell -c 1:46pm 1:46pm 1:46pm 1:46pm 1:42 1:42 1:42 1:22 /bin/csh /bin/csh /bin/csh w
displayed. To use the who command, type who and press Return. In the following example, irving is logged in remotely (as shown by the system name in parentheses), and ignatz is logged in locally to the system oak.
oak% who irving pts/1 Oct 31 14:33 (elm) ignatz console Oct 31 12:22 oak%
oak% rlogin drusilla drusilla% finger Login Name TTY Idle When Where winsor Janice Winsor pts/0 11 Thu 09:59 castle drusilla%
cinderella% rusers -l Sending broadcast for rusersd protocol version 3... Sending broadcast for rusersd protocol version 2... jah caps:console Mar 3 13:03 22:03 amber facehole:console Mar 2 07:40 sebree ondine:console Mar 2 10:35 14 tut cairo:console Mar 2 10:48 jrt cairo:ttyp5 Mar 2 16:20 47:54 (gap) ramseyis mowthelawn:console Mar 2 16:33 28 ramseyis mowthelawn:ttyp6 Mar 3 14:20 25:14 (:0.0) (More logins not shown) cinderella%
paperbark% Wed May 3 console ? pts/3 pts/3 pts/3 pts/3 pts/3 pts/3 pts/3 pts/3 ? ? ? pts/6 pts/5 pts/4
whodo 15:34:41 WST 2000paperbark winsor 13:46 376 0:00 422 0:00 488 0:00 485 0:00 484 0:00 462 0:00 460 0:00 440 0:00 441 0:00 448 0:02 452 0:00 451 0:00 472 0:00 469 0:00 466 0:00
Xsession sdt_shell dtfile dtfile sh dtpad sh ttsession dtsession dtwm sdtperfmeter dtterm csh csh csh
pts/4 ? ? ? ? pts/3 ? ? pts/4 pts/5 pts/6 pts/7 pts/7 pts/7 paperbark% winsor winsor winsor winsor
13:46 13:46 13:46 13:46 475 0:00 csh 539 0:00 whodo
You can use the id -a option to display the user name, user ID, and all of the groups to which the user belongs, as shown in the following example.
[ Team LiB ]
[ Team LiB ]
1. Type cat > filename and press Return. 2. Type one or more lines of text into the new file. 3. When you've completed the text, press Return to start a new line. 4. Press Control-D on a line that contains no text. The text is saved and the shell prompt is redisplayed. Use the following steps to append text to an existing file.
1. Type cat >> filename and press Return. 2. Type one or more lines of text into the new file. 3. When you've completed the text, press Return to start a new line. 4. Press Control-D on a line that contains no text. The text is saved and the shell prompt is redisplayed. To view the contents of the file, type cat filename and press Return. The contents of the file are displayed. If the file is too long to fit in the terminal window, it flies by and shows you the lines at the end of the file that fit in the window or on the screen. The following example creates a file named kookaburra with the first verse of the kookaburra song, displays the contents of the file, appends the second verse to the file, and displays the contents again.
castle% cat > kookaburra Kookaburra sits in the old gum tree Merry merry king of the bush is he Laugh kookaburra, laugh kookaburra Gay your life must be. ^D castle% cat kookaburra Kookaburra sits in the old gum tree Merry merry king of the bush is he Laugh kookaburra, laugh kookaburra Gay your life must be. castle% cat >> kookaburra Kookaburra sits in the old gum tree Eating all the gumdrops he can see Stop kookaburra, stop kookaburra Leave some there for me. ^D castle% cat kookaburra Kookaburra sits in the old gum tree Merry merry king of the bush is he Laugh kookaburra, laugh kookaburra Gay your life must be. Kookaburra sits in the old gum tree Eating all the gumdrops he can see Stop kookaburra, stop kookaburra Leave some there for me. castle%
Make copies of individual files and assign new names to them. Copy one or more files into a different existing directory, keeping the existing file names. Recursively copy an entire directory structure to another directory. Copy extended file attributes. In the Solaris 9 Operating Environment, the UFS, NFS, and TMPFS file systems are enhanced to include extended file attributes. These file attributes enable application developers to associate specific attributes with a file. For example, a developer of a file management application for a windowing system might choose to associate a display icon with a file. The options for both /usr/bin/cp and /usr/xpg4/bin/cp are listed in Table 22.
-f -i
-p
Option
Description To preserve the owner and group ID, permission modes, and modification and access times, users must have the appropriate file access permissions; this includes being superuser or the same owner ID as the destination file.
-p
/usr/xpg4/bin/cp only. Same as -p, above, except the command fails if unable to duplicate the modification and access time or the permission modes. Print a diagnostic message to standard error and return a non-zero exit status. Recursively copy the directory and all its files, including any subdirectories and their files, to target. Same as -r, except replicate pipes. To copy an existing file, type cp old-filename new-filename and press Return. You have made a copy of the file, retaining the original one. Suppose you need to modify the /etc/group file and you want to keep the original copy around in case you make a mistake. Just copy /etc/group to /etc/group.orig, as shown in the following example.
-r -R
# cp /etc/group /etc/group.orig #
To move (and rename) an existing file, type mv old-filename new-filename and press Return. You have changed the name of the file. Suppose you've downloaded the myapp.tar.gz file and think that it may be corrupt, although you're not completely certain. So, you move it out of the way so that you can download a fresh copy and still retain the original copy with a descriptive name, just in case.
Using vi
The visual editor, vi, is commonly used by system administrators to edit text files. Whole books have been written about using vi. This section provides only a quick-reference table with some of the most commonly used editing commands. To start vi, type vi filename and press Return. If the file does not exist, a new file is opened. The new file is created when you save changes made to it. If the file exists, the beginning of the file is displayed. The three vi modes are described in Table 23.
Command Normal and initial mode. Other modes return to command mode on completion. Use the ESC key to cancel a partial command. Input Enter input mode by setting any of the following options: a A i I o O c C s S R. You can then type arbitrary text. You usually exit input mode with an ESC character or, abnormally, with an interrupt. Read input for : / ? or !. Terminate by pressing Return. An interrupt cancels termination.
Last line
Task Move cursor up one line. Move cursor down one line. Go to end of the file. How to add text. Insert text (insert mode). Append text at cursor location. Append text at end of the line. How to exit to command mode. How to make changes to a file. Delete line. Delete character. Delete word. Open new line above. Open new line below. Yank/copy line. Put before. Put after. [ Team LiB ]
Command k j G
[ Team LiB ]
NAME grep - search a file for a pattern SYNOPSIS grep [ -bchilnsvw ] limited-regular-expression (Additional lines deleted from this example)
The Solaris Operating Environment organizes commands by different sections. A section name consists of a major section name, typically a single digit, optionally followed by a subsection name, typically one or more letters. For example, the command lpr(1B) is in Section (1), User Commands, and belongs to the BSD Compatibility Package section. The major sections are listed in Table 25.
Description
Descriptions of publicly available files and miscellaneous information pages. Computer demonstrations.
Some commands are listed in more than one section. If you type the name of a command that is available in multiple sections, man displays the first manual page the system encounters in the first man section searched. You can find the section number(s) for a manual page with the whatis command. Then you can specify the section number as an argument to the man command so that you display the command from that specified section.
You can use the catman n command to create formatted manual pages, where n is the manual page section you want to format. Because catman makes the directories of preformatted manual pages self-contained and independent of the unformatted entries, you can easily distribute these preformatted manual pages among a group of associated systems. Running catman with no arguments reformats every manual page, which can be a lengthy procedure. You can also use the catman -w option to create just the windex database file that is used by the whatis and apropos commands and the man -f and -k options. Use the following steps to create or update the windex database file.
1. Become superuser. 2. Type catman -w and press Return. The windex database is created or updated.
NOTE. The whatis command works only if you have first used the catman command to set up your manual pages. To use the catman command to set up manual pages, refer to "Creating Preformatted Manual Pages (catman)" on page 95.
Use the following steps to find the section number for a manual page.
1. Type whatis command-name and press Return. The first line of the manual page for the command is displayed. Use the section number to display the manual page in the next step. 2. Type man -s section-number command-name and press Return. The manual page is displayed. The following example shows the four different chown manual pages and displays the manual page for the chown(2) command.
oak% whatis chown chown chown (1) chown chown (1b) chown chown (1m) chown chown (2) oak% man -s2 chown chown(2) NAME chown, lchown, fchown
SYSTEM CALLS
SYNOPSIS #include <unistd.h> #include <sys/types.h> int chown(const char *path, uid_t owner, gid_t group); int lchown(const char *path, uid_t owner, gid_t group); int fchown(int fildes, uid_towner, gid_t group);
DESCRIPTION chown() sets the owner ID and group ID of the file specified by path or referenced by the open file descriptor fields to owner and group respectively. If owner or group is specified as -1, chown() does not change the corresponding ID of the file. (Additional lines deleted from this example)
When the windex database is available, you can also use the man -k option to display the section number of a command. The following example shows the output of the man -k chown command.
mopoke% man -k chown chown chown (1) chown chown (1b) chown chown (1m) chown chown (2) fchown chown (2) fchownat chown (2) lchown chown (2) nischown nischown (1) mopoke%
file ownership owner owner owner and group of a file owner and group of a file owner and group of a file owner and group of a file the owner of a NIS+ object
The apropos command also searches the windex database and does the same thing as the man -k command, as shown in the following example.
mopoke% apropos chown chown chown chown fchown fchownat lchown nischown mopoke%
chown chown (1) chown (1b) chown (1m) chown (2) chown (2) chown (2) chown (2) nischown (1)
file ownership owner owner owner and group of a file owner and group of a file owner and group of a file owner and group of a file the owner of a NIS+ object
[ Team LiB ]
[ Team LiB ]
Use the -h option of the df commandnew in the Solaris 9 Operating Environmentto display disk information in a format that is easier to read, for example, 14K, 234M, 2.7G, or 3.0T. Scaling is done by repetitively dividing by 1024. The following example shows the disk use for the mopoke system.
mopoke% df -h Filesystem size used /dev/dsk/c1t0d0s0 9.6G 2.0G /proc 0K 0K mnttab 0K 0K fd 0K 0K swap 533M 40K swap 534M 344K /dev/dsk/c1t0d0s7 3.9G 11M /vol/dev/dsk/c1t1d0/sol_9_doc_1of2 356M 356M /export/home/winsor 3.9G 11M mopoke%
Displaying Used Disk Space in Kilobytes and Percentage of Capacity (df -k)
Use the -k option of the df command to display disk information in the table format used with SunOS 4.x system software. Type df -k and press Return. The file system, total kilobytes, used kilobytes, available kilobytes, percentage of capacity used, and mount point for local disk partitions
paperbark% df -k Filesystem /dev/dsk/c0t0d0s0 /proc fd mnttab swap swap /dev/dsk/c0t0d0s7 /dev/dsk/c0t1d0s7 paperbark%
used avail 920657 412030 0 0 0 0 0 0 0 529832 304 529832 25289 76216 9 1952010
/home/ignatz
# df / /dev/dsk/c0t0d0s0 #
30383
11885
15468
43%
cinderella% df -F nfs /net (cinderella:(pid153)): /usr/dist cinderella:(pid153)): /home (cinderella:(pid153)): /usr/man (oak:/export/man): cinderella%
-1 -1 -1 -1
In the following example, the mounted UFS (local) file systems are displayed.
cinderella% df -F ufs (/dev/dsk/c0t0d0s0): 36992 blocks 13558 /usr (/dev/dsk/c0t0d0s6): 274346 blocks /export/home/cinderella (/dev/dsk/c0t3d0s7): cinderella% files 94403 files 379670 blocks
96046 files
In the following example, information about the mounted temporary file system is displayed.
):
88528 blocks
3156 files
NOTE. You cannot use the df command to display SWAPFS file systems because they are never mounted.
[ Team LiB ]
[ Team LiB ]
NOTE. Refer to Sun's Solaris 9 Installation Guide for instructions on performing installations with suninstall, JumpStart, and WebStart.
[ Team LiB ]
[ Team LiB ]
Flash Installation
With Flash installation, you can create a single reference installation of the Solaris Operating Environment on one system, called the master system. You then can replicate that installation as a new installation on any number of systems, called clone systems, that have the same architecture as the master system. The process of installing clone systems with Flash installation has three parts.
1. Install the master system. Select a system and use any of the Solaris installation methods to install the Solaris Operating Environment and any additional software packages. 2. Create the Flash archive. This archive contains a copy of all of the files on the master system. 3. Install the Flash archive on clone systems. All the files in the archive are copied to that system to create a system that has the same installation configuration as the original master system. You can use Flash archives with either WebStart or JumpStart to perform initial installations. The Flash archive snapshot contains the Solaris Operating Environment as well as all software, including third-party software, that you want to install on the new systems. You stream the entire archive to the boot disk. Flash installation would make reinstalling a machine much faster.
NOTE. You cannot use the Flash installation to upgrade a system that is running the Solaris Operating Environment. You can use Flash installation only for initial installation.
NOTE. The master system and the clone systems must have the same kernel architecture. If you have a site with systems that have multiple architectures, you can create a Flash installation archive for each architecture and use that archive for installation on clone systems with the same architecture. However, under Solaris 7, 8, and 9, all models of the UltraSPARC chip have the same sun4u kernel architecture.
Decide what configuration you want to make available to the clone systems. Consider the following elements. The software you want to install on the clone systems. Peripheral devices that are connected to the master system and the clone systems. The architecture of the master system and the clone systems. After you install the Solaris Operating Environment on the master system, you can delete software that is not needed on the clone systems. You can install Solaris packages or third-party software. Any software you install on the master system is included in the Flash archive and is installed on the clone systems. You can modify configuration files on the master system. For example, you can modify the /etc/inet/inetd.conf file to restrict the daemons that the system runs. After you install the Flash archive on a clone system, the installation program uses the sysunconfig(1M) command and the sysidtool(1M) programs to delete and re-create the host-specific network configuration files. These files include /etc/hosts, /etc/defaultrouter, and /etc/defaultdomain. Be sure to consider what peripheral devices on the clone systems might need drivers that are not needed on the master system. For example, if you install the Entire Software Group on a master system with a cg6 frame buffer, the installation contains support for only the cg6 frame buffer. You can use this archive file to install on clone systems that have either the cg6 frame buffer or no frame buffer. If you use this archive to install a clone system with an Elite 3D frame buffer, the Elite 3D is unusable because the required drivers were not installed. You can install support for different peripherals in one of the following ways. Install the Entire Plus OEM Software Group. This software group contains every package found in the Solaris Operating Environment and thus contains all of the drivers installed with the Solaris release. A Flash archive that is created from a master system with this installation works on any clone system that has peripheral devices that are supported by the installed release of the Solaris Operating Environment. Install selected packages that install support only for the peripherals that you know exist on the master system or clone systems. Refer to the Solaris 9 Installation Guide for complete information on designing a master system for use with Flash Installation.
Solaris 9 Software 1 of 2 CD. An image of the Solaris 9 Software and the Solaris 9 Language CDs. Create the archive when the system is in as static a state as possible. You run the flarcreate(1M) command to create the archive. The flarcreate command requires the -n name option and a file name for the archive. The command also has options for the following actions. Compressing (-c). Listing directories and sizes (-R root, -S, -H). Excluding files and directories (-x exclude). Enabling user-defined sections (-u section, -d dir). Using with tape archives (-t, -p posn). Specifying block size (-b blocksize). Specifying files (-f file_list, -F). Identifying archive (-U key-val, -i date, -m master, -e descr, -E descr_file, -a author, -T type). Refer to the flarcreate(1M) manual page for a more detailed description of these options. You can create layered Flash archives by creating partial Flash archives that you install in a variety of combinations. For example, you can create one archive that contains the Solaris Operating Environment files, a second archive that contains the files for a Web server, and a third archive that contains the files for an NFS server. You would then install the first and second archives to create a Web server and install the first and third archives on another system to create an NFS server. You can save the archive on the hard disk of the master system or on a tape. After you save the archive, you copy it to any file system or medium. You can use the flar(1M) command to administer archives. You can use the flar command to extract information from an archive, split archives into sections, and combine archives from individual sections. Use the following steps to create a Flash archive.
1. Boot the master system and run it either in single-user mode or in multiuser mode in as inactive a state as possible. 2. If in multiuser mode, become superuser. 3. Type flarcreate -n name options path/archivename and press Return.
2. 3. When the archive creation is successful, flarcreate returns an exit code of 0. If archive creation fails, the command returns a non-zero exit code. The following example creates an archive for the master system named mopoke, running in multiuser mode, with a name of mopokearchive and an archive name of mopokearchive in the current directory, specifies the name of the master system, and compresses the archive.
# flarcreate -n mopokearchive -c -m mopoke mopokearchive Determining which filesystems will be included in the archive... Determining the size of the archive... The archive will be approximately 1.05GB. Creating the archive... 3979899 blocks Archive creation complete. #
Local tape. Local file. With the custom JumpStart installation program, you can install Flash archives that are stored on any of the following media. Local device, including DVD or CD. NFS server. HTTP server. FTP server. Local tape. Local file. With Solaris Live Upgrade, you can install Flash archives that are stored on any of the following media. Local device, including DVD or CD. NFS server. HTTP server. FTP server. Local tape. Local file. See "Solaris Live Upgrade" on page 108 for more information about Solaris Live Upgrade.
1. At the OpenBoot PROM, insert the Solaris 9 Installation CD or DVD in the drive and boot from the disc. 2. Specify the language and locale. 3. Specify the configuration information for this system. 4. On the Specify Media panel, select the location of the Flash archive.
3. 4. The Solaris WebStart program prompts you to proceed, depending on the media you selected. 5. Type the information required. For DVD or CD, insert the disc containing the Flash archive(s). For Network File System, specify the path to the network file system where the Flash Archive is located. You can also specify the archive file name. For HTTP, specify the URL and proxy information that is needed to access the Flash archive. For FTP, specify the FTP server and the path to the Flash archive. Specify the user and password information that enables you to access the FTP server. Specify any proxy information that is needed to access the FTP server. For local tape, specify the local tape device and the position on the tape where the Flash archive is located. 6. For archives stored on a disc or an NFS server, on the Select Flash Archives pane, select one or more Flash archives to install. 7. On the Flash Archives Summary panel, confirm the selected archives and click Next. 8. On the additional Flash Archives panel, you can select to install layered Flash archives by specifying the medium where another archive is located. If you do not want to install additional archives, select None and click Next to continue the installation.
1. Insert the Solaris 9 Software 1 of 2 CD or DVD in the drive. 2. Specify the language and install the miniroot. 3. Specify the configuration information for this system. 4. Press F4 to choose Initial Install for a Flash archive installation. Press F4 to choose Flash installation. 5. On the Flash Archive Retrieval Method screen, select the type of medium that contains the Flash archive. The suninstall program prompts you to proceed, depending on the medium you selected. 6. Type the information required.
6. For DVD or CD, insert the disc containing the Flash archive(s). For Network file system, specify the path to the network file system where the Flash archive is located. You can also specify the archive file name. For HTTP, specify the URL and proxy information that is needed to access the Flash archive. For FTP, specify the FTP server and the path to the Flash archive. Specify the user and password information that enables you to access the FTP server. Specify any proxy information that is needed to access the FTP server. For local tape, specify the local tape device and the position on the tape where the Flash archive is located. 7. For archives stored on a disc or an NFS server, on the Select Flash Archives pane, select one or more Flash archives to install. 8. On the Flash Archives Summary panel, confirm the selected archives and click Next. 9. On the additional Flash Archives panel, you can select to install layered Flash archives by specifying the medium where another archive is located. If you do not want to install additional archives, select None and click Next to continue the installation. Refer to the Solaris 9 Installation Guide for instructions on custom JumpStart installation. [ Team LiB ]
[ Team LiB ]
Command lu(1M) luactivate(1M) lucancel(1M) lucompare(1M) lucreate(1M) lucurr(1M) ludelete(1M) ludesc(1M) lufslist(1M) lumake(1M) lumount(1M) lurename(1M) lustatus(1M) lutab(4) luumount(1M) luupgrade(1M)
Description FLMI-based interface to Live Upgrade functions. Activate a boot environment. Cancel a scheduled Live Upgrade copy or create procedure. Compare boot environments. Create a new boot environment. Display the name of the current active boot environment. Delete a boot environment. Display or set boot environment description. List configuration of a boot environment. Populate a boot environment. Mount all file systems in a boot environment. Rename a boot environment. Display status of boot environments. List boot environments. Unmount all file systems in a boot environment. Install, upgrade, and perform other functions on software on a boot environment.
user files such as those in the /export directory. Thus, when you create a boot environment, the /etc/vfstab file in the new boot environment does not update such shared file systems. Instead, it points to the same file system as the original boot environment. The sharing of swap is a special circumstance. All swap slices are shared by default, but you can specify a destination directory for swap and copy the swap slice. A swap slice is not required. Part of creating a new BE involves copying critical file systems to another slice. You may need to prepare the disk before you create the new BE. Check the disk to make sure it is formatted properly. Identify slices large enough to hold the file systems to be copied. If these slices do not exist on the disk on which you intend to create the new boot environment, you must create them manually with either the format(1M) or fmthard(1M) command. Identify file systems that contain directories that you want to share among boot environments.
NOTE. The slice must not be mounted or listed in the /etc/vfstab file.
You can use the (undocumented) /usr/lib/lu/ludevices command to list available spare partitions. In the following example, partition c1t0d0s4 is available for use as a BE.
You can use the /usr/lib/lu/ludevices -x 9 option to display complete debugging information for all devices on a system. Use the following steps to create a boot environment on a free slice on an existing disk.
1. Become superuser. 2. Type lu and press Return. The Live Upgrade character screen is displayed. 3. Use the arrow keys to highlight the Create menu option and press F3. The Live Upgrade Create screen is displayed. 4.
3.
4. Press the F2 function key (CHOICE) to choose an available slice for the BE. The slice you chose is displayed in the root (/) Device field. 5. Press F3 to save the changes. The slice you specified for the BE you specified is activated and formatting begins. Formatting takes some time. When the process is complete, the Live Upgrade character screen is displayed and shows the message Live Upgrade Create operation completed successfully. The following example shows the progress message for successfully creating a BE named s9beta on slice c1d0t0s4 on the same disk as the active BE.
Updating system configuration files. Creating configuration for boot environment <s9beta>. ********************************************************************** Beginning process of creating Boot Environment <s9beta>. No more user interaction is required until this process is complete. ********************************************************************** Creating file systems on BE <s9beta>. Creating <ufs> file system on </dev/dsk/c1t0d0s4>. Mounting file systems for BE <s9beta>. Calculating required sizes of file systems for BE <s9beta>. Populating file systems on BE <s9beta>. Copying file system contents to BE <s9beta>. Copying of file system / directory </> is in progress...
1. Become superuser. 2. Type lu and press Return. The Live Upgrade character screen is displayed. 3. Choose the Activate menu item and press F3. The Activate a Boot Environment window is displayed. 4. Type the name of the boot environment you want to activate and press F3. The BE you specified is activated. 5. Press F6 to exit the screens, then use the arrow keys to scroll down to the Exit menu item and press Return. The Live Upgrade program is terminated. 6. Type init 6 and press Return. The system is rebooted, using the newly activated BE. Alternatively, you can use the luactivate command to activate a BE.
[ Team LiB ]
[ Team LiB ]
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No No
Yes Yes No
Yes No
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No No
[ Team LiB ]
Changing Shells from a Command Line (csh, ksh, sh, bash, tcsh)
If you want to use another shell without modifying the Passwd database, you can change shells at a command-line prompt by simply typing the name of the shell you want to use. To change to the C shell, type csh and press Return. The default C shell prompt is the system name followed by a percent sign (%).
$ csh paperbark%
To change to the Korn shell, type ksh and press Return. The default Korn shell prompt is a dollar sign ($).
paperbark% ksh $
To change to the Bourne shell, type sh and press Return. The default Bourne shell prompt also is a dollar sign ($).
$ sh $
To change to the Bourne-Again shell, type bash and press Return. The default Bourne-Again shell prompt is bash- version$, where version is the particular bash shell you are using.
NOTE. The default prompt can change if you apply subsequent Solaris patches to the shell.
To change to tcsh, type tcsh and press Return. The default tcsh prompt is >.
To change to the Z shell, type zsh and press Return. With no startup files, the prompt does not change.
$ exit oak%
Environment variables in a shell are inherited by all subsequent shells and any programs you start from them. For shells that have two login filesall but the Bourne shellyou should set all environment variables in the .login file. Aliases and functions are not inherited by subsequent shells. They are redefined for each shell separately. Set aliases and functions in the .cshrc file for the C shell, in the . ksh_env file for the Korn shell, and in the relevant files for tcsh, bash, and zsh shells. The following example shows what can go wrong if you don't follow the guidelines about where to set environment variables. Using the C shell as an example, suppose you know your login C shell sources $HOME/.cshrc whenever you start a shellcall this Shell1. Now, you add the following command to the PATH variable in $HOME/.cshrc.
If you now start another shell from Shell1, that shell inherits the PATH setting from Shell1 (because it's an environment setting), but your $HOME/.cshrc file gets sourced again, thus adding : ...:/my/dir:/my/dir .to the end of your PATH. Not good. This construct can, over time, overflow your PATH environment variable, resulting in an administrative nightmare. However, when you use $HOME/.login as the place to set the PATH environment variable, your login shell gets the definition of PATH and all subsequent shells inherit it.
NOTE. You must export environment variables for the Bourne, Korn, Bourne-Again, and Z shells so that their children can inherit them.
PS1 defines the shell prompt for the Bourne and Korn shells. The default prompt for the Bourne and Korn shells is $. The default prompt for root in either shell is #. HOME defines the absolute path to the user's home directory. The default value for HOME is automatically defined and set to the login directory specified in the /etc/passwd file as part of the login process. The shell subsequently uses this information to determine the directory to change to when you type the cd command without an argument. LOGNAME defines the user's login name. The default value for LOGNAME is automatically defined and set to the login name specified in the /etc/passwd file as part of the login process. PATH lists, in order, the directories that the shell searches to find the program to run. When the user executes a command and uses the full path name, the shell finds the command by using that path name. However, when the user specifies only a command name, the shell searches the directories for the command in the order specified by the PATH variable. If the command is found in one of the directories, the shell executes it. If the directory containing the command is not in the search path, the user must then type the complete path name of a command. The default PATH is automatically defined and set as specified in .profile (Bourne or Korn shell) or .login (C shell) as part of the login process (see "Setting the Path for Bourne and Korn Shells" and "Setting the Path for Bourne and Korn Shells" on page 119 for details). When identically named commands exist in different locations, the first command found with that name is used. For example, suppose that PATH is defined (in Bourne and Korn shell syntax) as PATH=/bin:/usr/bin:/usr/sbin:$HOME/bin; then suppose a file named sample resides in both /usr/bin and /home/jean/bin. If the user types the command sample without specifying its full path name, the version found in /usr/bin is used. A default su path (/sbin:/usr/sbin:/usr/bin:/etc) is set by the system, but most users modify it to add other command directories. Many user problems related to setting up the environment and accessing the right version of a command or a tool can be traced to incorrectly defined paths.
CAUTION. Including . in the path to search the current directory is a potential security problem. If security is an issue at your site, do not include . as part of a user's path. Never use . as part of the root path.
The LANG and LC environment variables specify the locale-specific conversions and conventions for the shell, such as time zones, collation order, and format of dates, time, currency, and numbers. In addition, you can use the stty command in a user-initialization file to set whether the system supports multibyte characters. LANG sets all possible conversions and conventions for the given locale. If you have special needs, you can set various aspects of localization separately by using the following LC variables.
LC_COLLATE
LC_CTYPE LC_MESSAGES LC_NUMERIC LC_MONETARY LC_TIME Table 28 lists the values for the LANG and LC environment variables.
LPDEST sets the user's default printer. MAIL tells the shell where to look for new mail. MANPATH sets the hierarchies of the available manual pages. MANSECTS sets the available sections of manual pages. OPENWINHOME sets the path to the OpenWindows executables. prompt defines the shell prompt for the C shell. SHELL sets the default shell used by make, vi, and other tools. TERM sets the terminal definition. This variable should be reset in /etc/profile or /etc/.login. When the user invokes an editor, the system looks for a file with the same name as the definition of this environment variable. The system searches the directory referenced by TERMINFO to determine the terminal characteristics. TERMINFO specifies the path name for an unsupported terminal that has been added to the terminfo file. Use the TERMINFO variable in /etc/profile or /etc/.login. TZ sets the time zone. Users and system administrators can define additional variables for their own use. When you define an environment variable from a shell command, the variable remains in effect while you are working in the shell. When you exit the shell, the environment variable is not retained. Store "permanent" environment variables that are likely to be used during each login session in the .profile or .login file. The syntax for defining environment variables depends on the shell and is described elsewhere in this chapter.
PATH=/usr/bin:/$HOME/bin:.
See the appropriate manual pages for an in-depth description of these commands, and also see Chapter 12, "Recognizing File Access Problems," for more information about troubleshooting problems with paths.
paperbark% env MANPATH=/usr/dt/man:/usr/man:/usr/openwin/share/man DTDATABASESEARCHPATH=/export/home/winsor/.dt/types,/etc/dt/appconfig/types/%L, /etc/dt/appconfig/types/C,/usr/dt/appconfig/types/%L,/usr/dt/appconfig/types /C DTXSERVERLOCATION=local LANG=C HELPPATH=/usr/openwin/lib/locale:/usr/openwin/lib/help DTSOURCEPROFILE=true PATH=/usr/openwin/bin:/usr/dt/bin:/export/home/opt/SUNWadm/bin:/bin:/usr/bin:/ usr/sbin:/usr/ucb:/etc:/usr/proc/bin:/usr/ccs/bin:/opt/hpnp/bin:/opt/NSCPcom :/usr/local/games:. AB_CARDCATALOG=/usr/dt/share/answerbooks/C/ab_cardcatalog DTUSERSESSION=winsor-paperbark-0 XMICONBMSEARCHPATH=/export/home/winsor/.dt/icons/%B%M.bm:/export/home/winsor/. dt/icons/%B%M.pm:/export/home/winsor/.dt/icons/%B:/etc/dt/appconfig/icons/%L /%B%M.bm:/etc/dt/appconfig/icons/%L/%B%M.pm:/etc/dt/appconfig/icons/%L/%B:/e tc/dt/appconfig/icons/C/%B%M.bm:/etc/dt/appconfig/icons/C/%B%M.pm:/etc/dt/ap pconfig/icons/C/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icon s/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm :/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B SESSION_SVR=paperbark OPENWINHOME=/usr/openwin EDITOR=/usr/dt/bin/dtpad
LOGNAME=winsor DTSCREENSAVERLIST=StartDtscreenSwarm StartDtscreenQix StartDtscreenFlame StartDtscreenHop StartDtscreenImage StartDtscreenLife StartDtscreenRotor StartDtscreenPyro StartDtscreenWorm StartDtscreenBlank MAIL=/var/mail/winsor USER=winsor DISPLAY=:0.0 SHELL=/bin/csh DTAPPSEARCHPATH=/export/home/winsor/.dt/appmanager:/etc/dt/appconfig/appmanage r/%L:/etc/dt/appconfig/appmanager/C:/usr/dt/appconfig/appmanager/%L:/usr/dt/ appconfig/appmanager/C HOME=/export/home/winsor XFILESEARCHPATH=/usr/openwin/lib/locale/%L/%T/%N%S:/usr/openwin/lib/%T/%N%S XMICONSEARCHPATH=/export/home/winsor/.dt/icons/%B%M.pm:/export/home/winsor/.dt /icons/%B%M.bm:/export/home/winsor/.dt/icons/%B:/etc/dt/appconfig/icons/%L/% B%M.pm:/etc/dt/appconfig/icons/%L/%B%M.bm:/etc/dt/appconfig/icons/%L/%B:/etc /dt/appconfig/icons/C/%B%M.pm:/etc/dt/appconfig/icons/C/%B%M.bm:/etc/dt/appc onfig/icons/C/%B:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/ %L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/ usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B TERM=dtterm dtstart_sessionlogfile=/dev/null TZ=Australia/West DTHELPSEARCHPATH=/export/home/winsor/.dt/help/winsor-paperbark-0/%H:/export/ho me/winsor/.dt/help/winsor-paperbark-0/%H.sdl:/export/home/winsor/.dt/help/wi nsor-paperbark-0/%H.hv:/export/home/winsor/.dt/help/%H:/export/home/winsor/. dt/help/%H.sdl:/export/home/winsor/.dt/help/%H.hv:/etc/dt/appconfig/help/%L/ %H:/etc/dt/appconfig/help/%L/%H.sdl:/etc/dt/appconfig/help/%L/%H.hv:/usr/dt/ appconfig/help/%L/%H:/usr/dt/appconfig/help/%L/%H.sdl:/usr/dt/appconfig/help /%L/%H.hv:/usr/dt/appconfig/help/C/%H:/usr/dt/appconfig/help/C/%H.sdl:/usr/d t/appconfig/help/C/%H.hv XMBINDDIR=/usr/dt/lib/bindings WINDOWID=96469001 TERMINAL_EMULATOR=dtterm PWD=/export/home/winsor paperbark%
oak% clear
$ PATH=/usr/bin:$HOME/bin:.;export PATH $
You can also redirect input in the other direction. For example, to mail the contents of a file to user ignatz@oak, type mail ignatz@oak < report.file and press Return. The file called report.file is sent by e-mail to ignatz@oak.
If you want to print the information, you can add an additional pipe command (| lp) to the end of the sequence and send it to the printer, as shown in the following example.
anastasia% ps -e | grep openwin | lp request id is castle-51 (request id is castle-51 (standard input) anastasia%
[ Team LiB ]
[ Team LiB ]
$ PS1=oak$;export PS1 $
alias-name() { command-sequence
For example, if you frequently use the ftp command to send batches of files and don't want to be prompted for each file, you can create an alias for the ftp -i command to turn off interactive prompting. When you add the following line to your .profile file, ftp is started with interactive prompting turned off.
ftp() { ftp -i }
After you have made changes to a .profile file, the changes are not recognized unless you source the .profile file by typing . .profile or you log out and log in again. When you source the .profile file in a shell, the changes are recognized only in the current shell or any other shells or programs invoked from that shell. [ Team LiB ]
[ Team LiB ]
The C Shell
The C shell, written by Bill Joy when he was at UC Berkeley, is popular with many users of Berkeley UNIX. The C shell is completely different from the Bourne and Korn shells and has its own syntax. The most important advantages of the C shell are command history, command editing, and aliases. Command history stores a record of the most recent commands that you have used. You can display these commands and reuse them as originally issued. Command editing enables you to change a command by editing it. Aliases let you type short names for frequently used commands. You can also combine sequences of frequently used commands and provide an alias for the sequence.
The following example shows aliases from a .cshrc file. Note that if the command contains spaces, you enclose the entire command in quotes. Both double and single quotes are used in the following examples.
NOTE. Double quotes enable variables to be interpolated and single quotes don't.
alias a alias a h history a c clear a lf ls -F a ll "ls -l | more" a la ls -a a s "source .cshrc" a f 'find ~ -name core -print' a copytotape "tar cvf /dev/rmt/0 *" a ftp "ftp -i"
After you have made changes to a .cshrc file, the changes are not recognized unless you source the .cshrc file by typing source .cshrc or until you log out and log in again. When you source the .cshrc file in a shell, the changes are recognized only in the current shell and any other shells and programs invoked from that shell.
You can set history temporarily for a shell window or set it "permanently" so that the same history setting is available at each login session. Enter the command as a line in your .cshrc file and type source .cshrc.
oak% history 26 pwd 27 kermit 28 cd Howto 29 tar xvf /dev/rmt/0 30 ls -l howto* 31 cd 32 cd Config/Art 33 ls -l 34 tar cvf /dev/rmt/0 35 history oak%
To repeat the previous command in a C shell, type !! and press Return. The previous command is executed again.
oak% history 26 pwd 27 kermit 28 cd Howto 29 tar xvf /dev/rmt/0 30 ls -l howto* 31 cd 32 cd Config/Art 33 ls -l
kermit cd Howto tar xvf /dev/rmt/0 ls -l howto* cd cd Config/Art ls -l tar xvf /dev/rmt/0 history history
To repeat the last word of the previous command in a C shell, type !$ and press Return. The last word from the previous command is used as part of the command-line argument. For example, you might list the complete path name of a file and then use the path name as the argument to edit the file with vi or to print it.
You can use the !$ command anywhere within the command line. In the following example, the file /home/ignatz/quest is copied to the /tmp directory.
oak% ls -l /home/ignatz/quest -rw-r--r-1 ignatz staff oak% cp !$ /tmp cp /home/ignatz/quest /tmp oak%
To repeat a numbered command in a C shell, type ! n and press Return. The number in the shell prompt is n. The command is executed again.
oak% history 29 tar xvf /dev/rmt/0 30 ls -l howto* 31 cd 32 cd Config/Art 33 ls -l 34 tar xvf /dev/rmt/0 35 ls -l 36 cd 37 lp howto* 38 history oak% !32 cd Config/Art oak%
oak% newcommand newcommand: Command not found oak% rehash oak% newcommand Command output oak%
You can edit commands retrieved from the history list by using the s/ oldstring/ newstring/ form to substitute the retrieved string in the command. In the following example, an incorrectly typed command from the history list is corrected.
oak% history 31 cd 32 ls 33 cd /home/frame3.1 34 ls 35 cd .. 36 tar cvf /dev/rmt/0 frame3.1 37 lp questionnaire 38 lpstat -t 39 echo $PaTH 40 history oak% !39:s/a/A/ echo $PATH .:/home/winsor:/usr/openwin/bin:/usr/deskset/bin:/home/ winsor/bin:/bin:/home/bin:/etc:/usr/etc:/usr/bin:/home/ frame3.1/bin oak%
An excellent C shell programming reference is Using csh and tcsh, by Paul DuBois, O'Reilly & Associates, 1995. [ Team LiB ]
[ Team LiB ]
$ ENV=$HOME/.kshrc;export ENV $
You must set this environment variable in the .profile file; otherwise, the .kshrc file is not found when you log in. The ENV variable has no default setting. Unless you set it, the feature is not used. The . ksh-env file is read each time you start the Korn shell from a command line.
$ set -o Current option settings allexport off bgnice on emacs off errexit off gmacs off ignoreeof off interactive on keyword off markdirs off monitor on noexec off noclobber off noglob off nolog off nounset off privileged off restricted off trackall off verbose off vi off viraw off xtrace off $
The default options are described in Table 29. Customarily, you set these options in the .ksh-env file.
Option emacs errexit gmacs ignoreeof interactive keyword markdirs monitor noclobber noexec noglob nolog nounset
Default off off off off on off off on off off off off off off
Description Set emacs/gmacs as the in-line editor. If a command returns the value False, the shell executes the ERR trap (if set) and immediately exits. Set gmacs as the in-line editor. When the interactive option is also set, the shell does not exit at end-offile. Type exit to quit the shell. The shell automatically turns the interactive option on so that shell prompts are displayed. The shell puts each word with the syntax of a variable assignment in the variable assignment list. Display a / following the names of all directories resulting from pathname expansion. Enable job control. Do not overwrite an existing file when the redirect operator (>) is used. Read commands but do not execute them. You can use this option to debug shell script syntax errors. Disable file-name expansion. Do not store function definitions in the history file. Display an error message when the shell tries to expand a variable that is not set. When this option is off, the effective UID and GID of the user are ignored and the real UID and GID are used. When this option is on, the shell uses the effective UID and GID of the user. Set a restricted shell. Make command-tracked aliases when they are first encountered. Display the input as it is read. Set vi as the in-line editor. Specify character-at-a-time input from vi. Display commands and arguments as they are executed.
privileged restricted trackall verbose vi viraw xtrace off off off off off off
To enable an option, type set -o option-name and press Return. To disable an option, type set +o option-name and press Return. For example, entering this line in the user's .ksh-env file sets the in-line editor to vi.
set -o vi
set +o vi
You can also set these options from a command line, using the same syntax.
$ alias a=alias $
The following example uses the a alias created in the last example to alias the history command to the letter h.
$ a h=history $
The Korn shell comes with a default set of predefined aliases. To display the list, type alias and press Return.
$ alias autoload=typeset -fu false=let 0 functions=typeset -f hash=alias -t history=fc -l integer=typeset -i nohup=nohup r=fc -e stop=kill -STOP suspend=kill -STOP $$ true=: type=whence -v $
command
Alias
Value
Inside the function printdate, the local variable x is defined and is assigned the output of the date command. The contents of x are then printed. Note that x is not defined once the printdate function returns. nohup nohup When used on a program invoked from the shell, this alias prevents the program from receiving the hang-up (HUP) signal. This action prevents the program from being terminated if you log out, as it normally would be. Reexecute the previous command. Send the STOP signal to the process with the PID you give as an argument. This alias stops the process until you use the bg or fg commands to allow the process to continue. Suspend the current shell by sending it the STOP signal. You do this only if you were running a shell, then invoked another shell from within it, and want to temporarily return to the original shell by suspending the second one.
r stop
suspend
kill -STOP $$
the command line. When you leave vi, the command is executed. Refer to Table 24 on page 93 for a quick-reference to common vi commands.
$ HISTSIZE=200;export HISTSIZE $
You can set the history temporarily for a shell window or set it "permanently" by entering the command as a line in the .profile file.
21 22 23 24 25 26 27 28 29 30 31 $
su lp /etc/passwd lpstat -t man ksh du maker & tip -2400 5551212 alias h=history find / -name ksh -print df -k history
An alternative way to display the same information is to type fc -l and press Return. The history and fc commands take additional arguments that let you specify a range, display the last n number of commands, and display the commands in reverse order. See the ksh(1) manual page for more information.
To repeat the last command in the history list, type r and press Return.
fc -e - [old=new] [command]
You use the -e option to specify an editor. If no editor is specified, the FCEDIT environment variable value is used. If no value is set, the default editor is /bin/ed. The -r option reverses the order of the commands, displaying the most recent commands at the top of the list. If you specify no range, the last command is edited. For example, to use vi to edit the last command in a history list, type fc -e vi and press Return. A vi file is created containing the last entry from the history list. When you edit the command and save the changes, the command is executed. An excellent Korn shell programming reference is The New Korn Shell Command and Programming Language, Second Edition, by Morris I. Bolsky and David G. Korn, Prentice Hall, 1995. [ Team LiB ]
[ Team LiB ]
Refer to the bash(1) manual page for complete information. An excellent bash shell programming reference is Learning the Bash Shell, by Cameron Newham and Bill Rosenblatt, O'Reilly & Associates, 1998. [ Team LiB ]
[ Team LiB ]
The TC Shell
The tcsh shell is an enhanced and completely compatible variation of the Berkeley UNIX C shell, csh(1). You can use tcsh as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control, and a C-like syntax.
NOTE. The Solaris Operating Environment does not provide default csh.cshrc or csh.login files.
An excellent tcsh shell programming reference is Using csh and tcsh, by Paul DuBois, O'Reilly & Associates, 1995. [ Team LiB ]
[ Team LiB ]
The Z Shell
The Z shell (zsh) is a UNIX command interpreter that you can use as an interactive login shell and as a shell script command processor. The Z shell most closely resembles the Korn shell with enhancements. The Z shell provides command-line editing, built-in spelling correction, programmable command completions, shell functions (with autoloading), a history mechanism, and a host of other features.
[ Team LiB ]
[ Team LiB ]
NOTE. The Solaris Operating Environment provides the following SVR4 useradd commands: useradd, userdel, usermod, groupadd, groupmod, and groupdel. Because these commands are only minimally network-aware, they are not described in this chapter. If you want to use these commands to administer user accounts on stand-alone systems, refer to the appropriate manual pages.
Role-based access control (RBAC) is provided starting with the Solaris 8 release. See Chapter 6, "Administering Rights and Roles," for information on how to grant users selected superuser permissions. The useradd, userdel, and usermod commands have been modified to enable you to create, modify, and delete role accounts on a local system. [ Team LiB ]
[ Team LiB ]
Provided with the Solaris Operating Environment. Documentation available in Solaris Management Console Tools, available from Sun Microsystems Press and Prentice Hall. Provided with the Solaris Operating Environment. See Table 32 for a list of available commands. Refer to the appropriate manual pages.
Command line.
Terminal window (CDE Environment) or shell tool or command tool (OpenWindows environment).
By default, SMC manages accounts on the local system. You can create a nameservice domain toolbox to manage accounts in the LDAP, DNS, NIS+, or NIS name services. Refer to the Solaris Management Console Tools book available from Sun Microsystems Press and Prentice Hall for instructions on how to create a nameservice domain toolbox. Chapter 2, "Working with the Solaris Management Console (Tasks)," in the Sun System Administration Guide: Basic Administration also contains information about how to create a nameservice domain toolbox. You can add and administer user accounts from the command line if you choose not to use the SMC System Configuration/Users tools. Table 32 lists the Solaris commands you can use to administer user accounts.
NIS None Modify a user account. NIS+ NIS None Delete a user account. NIS+
NIS None Set up user account defaults. NIS+ NIS None Disable a user account. NIS+ NIS
make userdel not available make useradd -D nistbladm passwd -r nis -l make
None Change a user's password. NIS+ NIS None Sort user accounts. NIS+
passwd -r files -l passwd -r nisplus passwd -r nis passwd -r files niscat sort
NIS
ypcat sort
None
awk sort
NIS+ NIS
nismatch ypmatch
Task
Commands
Add a group.
NIS+ NIS
None
groupdel
You may find it useful to create a form from the following checklist to ensure that you have all the needed information about a user account before you create it. User name. UID. Primary group. Secondary groups. Comment. Default shell. Password status and aging. Home directory server name. Home directory path name. Mounting method. Permissions on home directory. Mail server. Department name.
Department administrator. Manager. Employee name. Employee title. Employee status. Employee number. Start date. Mail aliases to add account to. Desktop system name. [ Team LiB ]
[ Team LiB ]
User ID Number
A UID is always associated with each user name and is used by systems to identify the owners of files and directories and to identify the user at login. If you create user accounts for a single individual on more than one system, always use the same user name and UID. In that way, the user can easily move and copy files between systems without ownership problems. A UID must be a whole number less than or equal to 2147483647. The maximum UID was increased from 60000 to 2147483647 starting with the Solaris 2.5.1 release. UIDs are required for both regular user accounts and special system accounts. Table 33 lists the UIDs that are reserved for user accounts and system accounts. 0 root Root account. 1 daemon Daemon account. 2 bin Pseudouser bin account. 399 sys , uucp logins , who , tty , and ttytype System accounts. 10060000 Regular users General-purpose accounts. 60001 nobody Unauthenticated users. 60002 noaccess
Compatibility with previous Solaris and SVR4 releases. 600032147483647 Regular users General-purpose accounts.
CAUTION. Be careful when using UIDs in the 60000 to 2147483647 range. These numbers do not have full functionality and are incompatible with many Solaris subsystems. See Table 34 for more information .
Even though UIDs 0 through 99 are reserved for use by system accounts, you can add a user with one of these UIDs. You should not, however, use these UIDs for regular user accounts. Use the numbers 0 through 99 to assign system accounts, uucp logins, and pseudouser logins.
NIS+ nameservice. Users with UIDs above 60000 are denied access on systems running the Solaris 2.5 Operating Environment, compatible versions, and the NIS+ name service.
Table 34. Interoperability Issues for UIDs and GIDs over 60000
Category Product/Command Issues/Cautions
Table 35 summarizes the limitations of using large UIDs and GIDs. 60003 or greater. A UID and GID of nobody are assigned to users who log in to systems running the Solaris 2.5 Operating Environment and compatible releases and the NIS or files nameservice. 65536 or greater. Solaris 2.5 Operating Environment and compatible release systems running the NFS version 2 software truncate UIDs in this category to 16 bits, creating possible security problems.
Using the cpio command with the default archive format to copy files displays an error message for each file, and the UID and GID are set to nobody in the archive.
SPARC-based systems: Systems running the SunOS 4.0 Operating Environment and compatible applications display EOVERFLOW messages from some system calls, and the UID and GID are set to nobody .
IA-based systems: SVR3-compatible applications on an IA system are likely to display EOVERFLOW messages from system calls.
IA-based systems: If users create a file or directory on a mounted System V file system, the System V file system returns an EOVERFLOW error. 100000 or greater. The ps -l command displays a maximum five-digit UID, so the printed column is not aligned when it includes a UID or GID greater than 99999. 2622144 or greater.
Using the cpio command with -H odc format or the pax -x cpio command to copy files returns an error message for each file, and the UIDs and GIDs are set to nobody in the archive. 10000000 or greater. The ar command sets UIDs and GIDs to nobody in the archive. 2097152 or greater. UIDs and GIDs are set to nobody when the tar command, the cpio -H ustar command, or the pax -x tar command is used.
/home
auto_home
-nobrowse
This entry tells the automounter to mount the directories specified in the auto_home database onto the /home mount point on the local system. The entries in auto_home use the following format.
login-name
system-name:/export/home/login-name
When a user logs in with login-name , the automounter mounts the specified directory (/export/home/ login-name ) from the specified system (system-name ) onto the /home/ loginname mount point on the system to which the user is logged in. This method works even when the home directory is stored on the same system to which the user has logged in. But more importantly, the user can log in to any other system and have his or her home directory mounted on /home/ login-name on that system.
NOTE. When the automounter is used to mount home directories, you are not permitted to create any directories under the /home mount point on the user's system. The system recognizes the special status of /home when the automounter is active .
To create a home directory, you must already have created the user's account. You need the following information. User's login name and UID. The name of the system on which to create the home directory. The home directory server and the user's system can be on any network segment. Use the df command to check the servers to make sure there is enough space for a new home directory. The name of the directory under which you will create the user's account.
By convention, the home directory is named /export/home . However, on a large file server you may have multiple directories/export/home1 , /export/home2 , and so on. Under each directory, different subdirectories are created for different users (for example, /export/home/ login-namea , /export/home/ login-nameb ... /export/home1/ login-namey ... /export/home2/ login-namez , and so forth). All the following steps apply regardless of whether the home directory is created on the local system or on a remote file server. 1. Become superuser on the system on which you want to create the home directory. 2. Type cd /export/ home-root and press Return. home-root is the name of the directory under which you want to create the user's home directory. The following example changes to the directory /export/home1 .
# cd /export/home1
3. Type mkdir login-name and press Return. login-name is the login name of the user. You have created a directory that matches the login name of the user. The following example creates a directory for a user with a login name of ignatz .
# mkdir ignatz
4. Type chown login-name login-name and press Return. The user now owns the home directory. The following example changes the ownership for user ignatz .
5. Type chgrp primary-GID login-name and press Return. The user is assigned to the primary group you specified for the user account. The following example changes the primary group for user ignatz to the staff group.
6. Type chmod 755 /export/ home-root/login-name and press Return. The user's home directory permissions are set to rwx for owner, r-x for group, and r-x for other. The following example changes home directory permissions for user ignatz .
The following steps describe how to share a home directory from a Solaris server. 1. Type share and press Return to find out whether the home directory has already been shared. If the home directory is listed, information that looks like the following example is displayed.
rw
""
If the home directory root is not listed, perform the following steps to set it up so that it can be shared by other systems. You perform these steps once for each /export/ homeroot directory. By convention, these directories are named /export/home, /export/home1, /export/home2 , and so on. 2. Edit the file /etc/dfs/dfstab and add the following line.
3. Type shareall -F nfs and press Return. All the share commands in the /etc/dfs/dfstab file are executed so you do not need to reboot the system. If you reboot the system, the shareall command is automatically run. 4. Type ps -ef | grep mountd and press Return. If the daemon mountd is running, the procedure is complete. The following example shows that mountd is not running. If mountd is not running, follow the next step.
16
18:07:25 pts/1
5.
5. Type /etc/init.d/nfs.server start and press Return. The daemons required for sharing file directories are started.
NOTE. If your network is not running NIS, NIS+, or LDAP, you need to add the home directory server's Internet Protocol (IP) address and system name to the /etc/hosts file on the user's system .
After you have created the user's home directory, you must make it available. You make the home directory available by adding it to the appropriate NIS, NIS+, or LDAP database or by adding an entry to the /etc/vfstab file on the user's system for NFS mounting.
3. To create the mount point on the user's system, type mkdir /home/ login-name and press Return.
NOTE. The home directory does not have the same name on the user's system as it does on the server. For example , /export/home/ignatz on the server is mounted as /home/ignatz on the user's system .
4.
4. Type chown login-name /home/ login-name and press Return. The user now owns the home directory. 5. Type chgrp primary-GID /home/ login-name and press Return. The user's primary group has permission to access the user's home directory. 6. Type mountall and press Return. All entries in the current vfstab file (whose mount at boot fields are set to yes ) are mounted. 7. To verify that all entries are mounted, type mount and press Return. The file systems that are mounted are displayed.
$HOME/.cshrc Define user's environment for all C shells invoked after login shell. Bourne $HOME/.profile
Define user's environment at login. Korn $HOME/.profile Define user's environment at login.
$HOME/ksh-env Define user's environment at login in the file specified by the ksh-env environment variable.
The Solaris Operating Environment provides default user initialization files for each shell in the /etc/skel directory, as shown in Table 37 . C /etc/skel/local.login C /etc/skel/local.cshrc Bourne or Korn /etc/skel/local.profile
# if possible, start the windows system. Give user a chance to bail out # if ( "'tty'" == "/dev/console" ) then if ( "$TERM" == "sun" || "$TERM" == "sun-color" || "$TERM" == "AT386" ) then if ( ${?OPENWINHOME} == 0 ) then setenv OPENWINHOME /usr/openwin endif echo "" echo -n "Starting OpenWindows in 5 seconds (type Control-C to interrupt)" sleep 5 echo "" $OPENWINHOME/bin/openwin clear # get rid of annoying cursor rectangle logout # logout after leaving windows system endif endif
# @(#)cshrc 1.11 89/11/29 SMI umask 022 set path=(/bin /usr/bin /usr/ucb /etc .) if ( $?prompt ) then set history=32 endif
# # If possible, start the windows system # if [ "`tty`" = "/dev/console" ] ; then if [ "$TERM" = "sun" -o "$TERM" = "sun-color" -o "$TERM" = "AT386" ] then if [ ${OPENWINHOME:-""} = "" ] ; then OPENWINHOME=/usr/openwin export OPENWINHOME fi echo "" echo "Starting OpenWindows in 5 seconds (type Control-C to interrupt)" sleep 5 echo "" $OPENWINHOME/bin/openwin clear exit fi fi # get rid of annoying cursor rectangle # logout after leaving windows system
As you can see, these files define a minimal environment. To minimize the need to edit the customization files for each user, you can customize the files in /etc/skel to set as many systemwide default variables as you want.
source /home/site-files/site-init-files
To reference a site initialization file in a Bourne or Korn shell user initialization file, put a line similar to the following example at the beginning of the user initialization file.
. /home/site-files/site-init-files
# @(#)site.login main: echo "Application Environment Selection" echo "" echo "1. Application, Version 1" echo "2. Application, Version 2" echo "" echo -n "Type 1 or 2 and press Return to set your application environment: " set choice = $< if ( $choice !~ [1-2] ) then goto main endif switch ($choice) case "1": setenv APPHOME /opt/app-v.1 breaksw case "2": setenv APPHOME /opt/app-v.2 endsw
You would reference the site.login site initialization file located on a server named server2 in a user's .cshrc file (C shell users only) with the following line. The automounter must be running on the user's system.
source /home/site-init-files/site.login
# cd /home/ignatz #
3.
3. Type cp /etc/skel/local.* . and press Return. You have copied all of the default user initialization files to the user's home directory. 4. Type chmod 744 local.* and press Return. Permissions are set for the initialization files. 5. Type chown login-name * and press Return. The user now owns the initialization files.
# chown ignatz * #
6. Type chgrp primary-GID local.* and press Return. The files are assigned to the primary group (for example, staff ) you specified in the Passwd database for the user account.
7. Rename the shell initialization files. If the user's shell is the C shell, type mv local.login .login; mv local.cshrc .cshrc and press Return. If the user's shell is the Korn or Bourne shell, type mv local.profile .profile and press Return. 8. Type rm local.* and press Return. You have removed the unused shell initialization files. 9. On the user's system, log in as the user. 10.
9. 10. Assign the user an interim password. See "Creating a Password" on page 162 for information on how to create passwords. 11. Check to make sure the user's environment is set up correctly. 12. Edit the user's initialization file (or files) and make changes as needed. Use the following steps to edit the user's initialization file (or files). 1. Set the user's default path to include any additional directories or mount points for the user's windowing environment and applications. For the Bourne, Bourne Again, or Korn shell, type PATH=/ dirname1:/dirname2:/ dirname3...:.;export PATH . For example, enter a line such as the following in the user's $HOME/.profile file.
2. To check that the PATH environment variable is set correctly, type echo $PATH and press Return.
3. Add or change the settings of environment variables. For the C shell, type setenv VARIABLE value (or set variable=value for the path and term variables).
NOTE. Set environment variables in the .login file for the C and TC shells and .profile for the Bourne, Bourne Again, and Korn shells.
The following example sets the history to the last 100 commands.
For the Bourne or Korn shell, type VARIABLE=value; export VARIABLE . The following example sets the user's default mail directory.
MAIL=/var/mail/ignatz;export MAIL
4. Check the umask setting. If you need to change it, type umask nnn and press Return. You can either include or omit leading zeros. For example, to set file permissions to 644, type umask 022 and press Return. Table 38 shows the file permissions that are created for each of the octal values of umask .
The LANG variable and LC environment variables determine the locale-specific conversions and conventions the shell uses. These conversions and conventions include time zones, collation orders, and formats of dates, time, currency, and numbers. If necessary, set these variables in the user's initialization file. LANG sets all possible conversions and conventions for a given locale. If you have special needs, you can set various aspects of localization separately by using the LC variables LC_COLLATE , LC_CTYPE , LC_MESSAGES , and LC_NUMERIC . Table 39 shows the values for several locales. de German fr French iso_8895_1 English and European it Italian japanese Japanese korean Korean
If the system needs to support multibyte characters (for example, Japanese), add the following command to the system initialization file (/etc/profile or /etc/.login ).
The preceding command sets character size to the maximum (cs8 ) and sets the width of multibyte characters to the default values for the locale specified by LC_CTYPE . When the initialization files are complete, log out of the user's account.
The client's mailbox is automatically mounted any time the system is rebooted. 4. Type mount -a to mount the mailbox. The client's mailbox is mounted.
NOTE. The sendmail program automatically creates mailboxes in the /var/mail directory the first time a message is delivered. You do not need to create individual mailboxes for your mail clients .
If you are using NIS+, use the following steps to set up mail aliases for the user. 1. Compile a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems. 2. Become superuser on any system. 3. For each alias, type aliasadm -a alias expanded-alias [ options comments ] and press Return. The alias is added to the NIS+ aliases table. The following example adds an alias for user iggy.ignatz .
4. Type aliasadm -m alias and press Return. The entry you created is displayed. 5. Check the entry to be sure it is correct.
5. Alternatively, when you have created a nameservice domain toolbox for SMC, you can use SMC/System Configuration/Users/Mailing Lists to edit network mail aliases.
Creating a Password
Passwords are an important part of system security. Each user account should be assigned a password of 6 to 10 characters as a combination of letters and numbers.
You can assign and manage passwords with the SMC Users tool. By default, SMC manages accounts on the local system. You can create a nameservice domain toolbox to manage accounts in the LDAP, DNS, NIS+, or NIS nameservices. Refer to the Solaris Management Console Tools book available from Sun Microsystems Press and Prentice Hall for instructions on how to create a nameservice domain toolbox.
Table 40 lists the commands that you use to manage passwords in the passwd and shadow databases in nameservice domains.
files passwd [-r files] username NIS passwd -r nis username (replacement for yppasswd(1) .) NIS+ passwd -r nisplus username (replacement for nispasswd(1) .) LDAP passwd -r ldap username
In the Solaris Operating Environment, the encrypted password and associated password aging information are stored in the nameservice password or shadow database or in the local /etc/shadow file. Permissions for the /etc/shadow file are -r-------- . Only root can read the /etc/shadow file, and only the passwd command can write to the file. The following example shows the contents of an /etc/shadow file.
root:4ZfnV.kupl.SA:11081:::::: daemon:NP:6445:::::: bin:NP:6445:::::: sys:NP:6445:::::: adm:NP:6445:::::: lp:NP:6445:::::: uucp:NP:6445:::::: nuucp:NP:6445:::::: listen:*LK*::::::: nobody:NP:6445:::::: noaccess:NP:6445:::::: nobody4:NP:6445:::::: winsor:OVHZsESoDAEwk:11081:::::: ray:::::::: des:::::::: rob::11080:::::: ppp:*LK*::::::: ignatz::::::::
Users can create or change their own passwords at any time. You must be root to create the initial password for any other user. In addition, to create a nameservice password, you must have the appropriate privileges and you must have established the necessary networkwide credentials. Use the following steps to create a local password. 1. Become superuser on the local system. 2. Type passwd login-name and press Return. The prompt New password : is displayed. 3. Type the new password and press Return. The prompt Re-enter new password : is displayed. 4. Retype the password and press Return. The password is assigned, as shown in the following example, and added to the /etc/shadow
4.
file.
NOTE. You can also use passwd to define, change, and view password attributes, such as password aging. You can use password aging for the file, NIS+, and LDAP nameservices, but not for NIS. See the passwd (1) manual page for more information .
Changing a local password is similar to adding a new password. When prompted to do so, type the old password, and then type the new password two times, as prompted.
To create or change passwords in NIS, NIS+, and LDAP nameservice environments, use the passwd -r (repository) option to specify an nis , nisplus , or ldap repository.
[ Team LiB ]
[ Team LiB ]
NOTE. It's best to explicitly define all groups so that every group has a name.
All users belong to at least one grouptheir primary groupwhich is indicated by the Group field of their user account. Although it is not required by the operating system, you should add the user to the member list of the group you've designated as his or her primary group. Optionally, users can belong to up to 16 secondary groups. To belong to a secondary group, the user must be added to the group's member list. The groups command shows the groups to which a user belongs. In the following example, the user belongs to the staff group.
You can use the id -a command to display more information about a user account, including the group name and GID, as shown in the following example.
For any user, only one group at a time can be considered the primary group. However, users can temporarily change the primary group (with the newgrp command) to any other group they belong to. Some applications look at the user's primary group only. For example, ownership of files created and accounting data recorded reflect only the primary group. Other applications may take into account a user's membership across groups. For example, when using Admintool (which has been replaced by the SMC tools) a user had to be a member of the sysadmin group to make changes to a database, but it didn't matter if sysadmin was the current primary group or a secondary group. User groups are probably best known as the groups referred to by the read-write-execute permissions for the user, group, and other on files and directories. These permissions are a cornerstone of security. You cannot access others' files (if they do not allow world access) unless your primary or a secondary group has permission to access the files. For example, a group called techwrite could be created for technical writers, and a central directory of document files could be set up with write permission for the techwrite group. That way, only writers would be able to change the files. User groups can be local to a workstation or used across a network. Across the network, user groups allow a set of users on the network to access a set of files on a workstation or file server without making those files available to everyone.
NOTE. NIS+ supports another, unrelated, kind of group, called an NIS+ group, which assigns access rights to NIS+ objects. These groups have nothing to do with using NIS+ to maintain a database of user groups.
You can use the SMC System Configuration/Users/Groups tool to create and administer groups. By default, SMC manages accounts on the local system. You can create a nameservice domain toolbox to manage accounts in the LDAP, DNS, NIS+, or NIS nameservices. Refer to the Solaris Management Console Tools book for instructions.
The Group database (NIS maps, NIS+ tables, LDAP DIT entries, or local /etc/group file) has the following fields. Group Name. Group ID. User (Member) List. An additional Group Password field is rarely used. The Group Password field is a relic of earlier versions of UNIX. It is usually left empty or filled with an asterisk. If a group has a password, the newgrp command prompts users to enter it. However, there is no command to set the password.
By default, all Solaris workstations and servers have the following groups.
root::0:root other::1: bin::2:root,bin,daemon sys::3:root,bin,sys,adm adm::4:root,adm,daemon uucp::5:root,uucp mail::6:root tty::7:root,tty,adm lp::8:root,lp,adm nuucp::9:root,nuucp staff::10: daemon::12:root,daemon sysadmin::14: nobody::60001: noaccess::60002: nogroup::65534
NOTE. The sysadmin group with a GID of 14 is part of the default set of groups.
Modifying Groups
Membership in group accounts can change frequently as new employees are hired and other employees change job responsibilities. Consequently, you will modify existing group accounts to add or remove users. If you choose to have a user belong to secondary groups, you must modify those groups to add the user to the user lists. When adding groups, you may make a mistake. The ability to modify or delete groups helps you correct such mistakes. If a group account is no longer needed, you can delete user accounts from it.
[ Team LiB ]
NOTE. Solaris User Registration is not started when a user is logged in as root.
If the user chooses to register, a copy of the completed form is stored in $HOME/.solregis/uprops. If the user chooses to never register, he can always start User Registration in one of the following ways. By typing solregis& at any command-line prompt. By clicking on the Registration icon in the Application Manager's desktop tools folder in the CDE environment. For more information, refer to the solregis(1) manual page.
When users complete the Solaris User Registration process, they can access Solaris Solve, an exclusive Web site that offers valuable Solaris product information and solutions in one convenient location. Beginning on April 16, 2001, users of the Solaris Solve Web site are automatically redirected to the BigAdmin System Administrator's Portal. BigAdmin provides a quick and easy way for users to get the most recent information on what is happening with the latest Solaris release. BigAdmin also provides a preview of additional Sun contract and service opportunities.
NOTE. Solaris Solve (redirected to BigAdmin) and SunSolve are separate Web sites.
To complete the Solaris User Registration form and access BigAdmin, users can follow the steps below.
1.
1. Fill in the electronic Solaris User Registration profile. 2. Submit the profile by e-mail or print the profile to fax or mail. 3. Access the BigAdmin site at http://www.sun.com/bigadmin/.
Error Conditions
Table 41 suggests ways to resolve user problems with registration.
Check whether e-mail is configured correctly. Also ensure that CDE is available on the user system because it must be present before the completed registration form can be e-mailed. Alternatively, users can print the form and fax or mail it. Check whether the printer is configured correctly. Alternatively, user can e-mail form.
Check user's home directory. Required action depends on the system configuration.
1. Type cd $HOME/.solregis and press Return. Focus is in the .solregis directory. 2. Type rm uprops and press Return.
2. You have removed the uprops file that contains the previous registration information. 3. Type /usr/dt/bin/solregis& and press Return. The Solaris User Registration form is redisplayed. 4. Fill in the form and click on the appropriate button at the bottom of the window to either register by e-mail or print a copy to fax or mail.
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
Audit Control Audit Review Basic Solaris User Cron Management Device Management
Device Security Grants the right to manage and configure devices and volume manager. DHCP Management File System Management File System Security Grants the right to manage the DHCP service. Grants the right to manage file system mounts and shares. Grants the right to manage file system security attributes.
Right FTP Management iPlanet Directory Management Log Management Mail Management Maintenance and Repair Media Backup Media Restore
Description Grants the right to configure the FTP server. Grants the rights to manage iPlanet directory servers.
Grants the right to manage log files. Grants the right to configure sendmail, modify mailing lists, and check mail queues. Grants the right to use commands needed to maintain or repair a system. Grants the right to back up files but not the right to restore them. Grants the right to restore backed-up files but not the right to perform system backup.
Message Queue Grants the right to manage message queues. Management Name Service Management Name Service Security Network Management Network Security Object Access Management Operator Primary Administrator Grants the right to control the daemons used by a nameservice. Grants the right to manage all nameservice properties and table data. Grants the right to manage the host and network configuration. Grants the right to manage network and host security with authorizations for modifying trusted network databases. Grants the right to file ownership and permissions. Contains Printer Management, Media Backup, and All rights. Operator rights also include Process Management, Rights Delegation, and Software Installation rights. Assigns all the rights of the root user and is responsible for assigning rights to users, assigning users to roles, creating new roles, and changing the rights associated with administrative roles. The Primary Administrator can designate other users as a Primary Administrator. The Primary Administrator can also grant Rights Delegation, which gives other administrators the limited ability to grant to others only rights the delegators already have or rights to roles to which the delegators are already assigned. Grants the right to manage printer devices, daemons, and spooling. Grants the right to manage current processes and daemons.
Description Grants the right to perform project management. Grants the user or role limited ability to assign to other users or roles those rights and roles already assigned to the user with the Rights Delegation right. Grants the right to add and remove application software. Contains Audit Review, Cron Management, Device Management, File System Management, Mail Management, Maintenance and Repair, Media Backup, Media Restore, Name Service Management, Network Management, Object Access Management, Printer Management, Process Management, Software Installation, User Management, and All rights. Grants the right to create and modify user accountsexcept for its own user account. It does not grant the right to modify user passwords. Grants the right to create and modify user passwords.
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
The Solaris UDF file system provides the following features. Access to industry-standard CD-ROM and DVD-ROM media when they contain a UDF file system. Flexibility in exchanging information across platforms and operating systems. A mechanism for implementing, according to the DVD video specification based on the UDF format, new applications that offer broadcast-quality video, high-quality sound, and interactivity. This UDF release does not contain the following features. Support for write-once media, CD-RW, and DVD-RAM, with either the sequential disk-atonce and incremental recording. UFS components such as quotas, ACLs, transaction logging, file system locking, and file system threads. These components are not part of the UDF 1.50 specification. The System V (S5) file system traditionally provided with System V releases is not included in the Solaris Operating Environment because of significant limitations, such as a maximum of 64,000 files in a file system, a restriction of 14 characters for file names, and lack of a quota facility. Each type of disk-based file system is customarily associated with a particular media device. UFS and S5FS with hard disk and any other media (CD-ROM, DVD, diskette). HSFS with CD-ROM. PCFS with diskette. UDF with DVD. These associations are not, however, restrictive. For example, CD-ROMs and diskettes can have UFS file systems installed on them.
Virtual file systems (previously called pseudo file systems) are virtual or memory-based file systems that provide access to special kernel information and facilities. Most virtual file systems do not use file system disk space. Some virtual file systems, such as the temporary file system, may, however, use the swap space on a physical disk. Cache file systems use a file system on the disk to contain the cache.
/tmp/newroot or any of its subdirectories. See "Making File Systems Available" on page 199 for more information about mounting and unmounting file systems.
paperbark% ls -l /proc total 128 dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 daemon dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 daemon dr-x--x--x 5 daemon dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root dr-x--x--x 5 root
root root root root root root daemon root root root root root root root root root root other other root root root root root root root root root staff root
736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736
May May May May May May May May May May May May May May May May May May May May May May May May May May May May May May
11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11
08:45 08:45 08:46 08:46 08:46 08:46 08:46 08:46 08:46 08:46 08:46 08:45 08:46 08:46 08:46 08:46 08:46 08:46 08:46 08:46 08:45 08:46 08:46 08:46 08:46 08:46 08:46 08:46 08:46 08:46
0 1 108 125 155 161 165 168 179 185 195 2 200 213 222 225 227 241 242 275 3 304 317 323 324 333 336 337 340 346
dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x dr-x--x--x paperbark%
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
root root root root winsor winsor winsor winsor winsor winsor winsor root winsor root winsor winsor winsor winsor winsor winsor winsor root winsor winsor winsor winsor winsor root winsor winsor winsor winsor winsor winsor
root root root root staff staff staff staff staff staff staff root staff root staff staff staff staff staff staff staff root staff staff staff staff staff root staff staff staff staff staff staff
736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736 736
May May May May May May May May May May May May May May May May May May May May May May May May May May May May May May May May May May
11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11
08:46 08:46 08:46 08:47 08:47 08:47 08:47 08:47 08:47 08:47 08:47 08:45 08:47 08:47 08:47 08:47 08:47 08:47 08:47 08:47 08:47 08:45 08:48 08:48 08:48 08:48 08:48 08:48 08:48 08:48 08:48 08:48 08:48 09:36
349 350 357 370 375 385 389 421 422 424 439 44 440 441 447 449 450 451 452 453 455 46 461 462 463 464 466 468 470 473 476 483 486 521
NOTE. /proc files do not use disk space, so there is little reason to delete files from this directory.
The /proc directory does not require any system administration. Starting with the Solaris 2.6 release, the flat /proc file system is restructured into a directory hierarchy that contains additional subdirectories for state information and control functions. It also provides a watchpoint facility that remaps read/write permissions on the individual pages of the address space of a process. This facility has no restrictions and is multithread (MT) safe.
The new /proc file structure provides complete binary compatibility with the old /proc interface except that the new watchpoint facility cannot be used with the old interface. Debugging tools have been modified to use the new /proc watchpoint facility, which means the entire watchpoint process is faster. The following restrictions no longer apply to setting watchpoints with the dbx debugging tool. Setting watchpoints on local variables on the stack because of SPARC register windows. Setting watchpoints on multithreaded processes. For more information, refer to the proc(4), core(4), and adb(4) manual pages.
paperbark% more /etc/mnttab /dev/dsk/c0t0d0s0 / ufs rw,intr,largefiles,onerror=panic,suid,de v=800000 958013089 /proc /proc proc dev=2d80000 958013088 fd /dev/fd fd rw,suid,dev=2e40000 958013090 mnttab /etc/mnttab mntfs dev=2f40000 958013092 swap /var/run tmpfs dev=1 958013092 swap /tmp tmpfs dev=2 958013094 /dev/dsk/c0t0d0s7 /export/home ufs rw,intr,largefiles,onerror=panic
,suid,dev=800007 958013094 /dev/dsk/c0t1d0s7 /export/home0 ufs rw,intr,largefiles,onerror=panic ,suid,dev=80000f 958013094 -hosts /net autofs indirect,nosuid,ignore,nobrowse,dev=3000001 95801311 8 auto_home /home autofs indirect,ignore,nobrowse,dev=3000002 95801311 8 -xfn /xfn autofs indirect,ignore,dev=3000003 958013118 paperbark:vold(pid228) /vol nfs ignore,dev=2fc0001 958013123 paperbark%
[ Team LiB ]
[ Team LiB ]
The top of the hierarchical file tree. The root directory contains the directories and files critical for system operation, such as the kernel (/kernel/unix), the device drivers, and the programs used to start (boot) the system. It also contains the mount point directories to which local and remote file systems can be attached to the file tree. Read-only information provided directly from the kernel about mounted file systems for the local system. New in the Solaris 8 Operating Environment. System files and directories that can be shared with other users. Files that run only on certain types of systems are in the /usr directory (for example, SPARC executables). Files (such as manual pages) that can be used on all types of systems are in /usr/share. Sun's current recommendation is that you make /usr part of the root file system. The mount point for the users' home directories, which store users' work files. By default, /home is an automounted file system. On standalone systems, /export/home is a UFS file system on a local disk slice. System files and directories that are likely to change or grow over the life of the local system. These include system logs, vi and ex backup files, uucp files, and mail and calendar files. Sun's current recommendation is that you make /var part of the root file system. Because /var is the most likely directory to fill up with with log files, the Solaris 9 Operating Environment provides a log management command that you can use to rotate, compress, age, and eventually remove log files before they fill up this file system. See logadm(1M) and logadm.conf(4) for more information. Mount point for optional, third-party software. Sun's current recommendation is that you make /opt part of the root file system unless it is too large to fit on the boot disk.
/etc/mnttab
mntfs
/usr
ufs
/export/home or /home
ufs, NFS
/var
ufs
/opt
ufs
Directory
Description
/tmp
Temporary files, cleared each time the system is booted or unmounted. A file system for storing temporary files that are not needed after the system is booted. A list of active system processes, by number.
The root (/) and /usr file systems are both needed to run a system. Some of the most basic commands from the /usr file system (such as mount) are included in the root file system so that they are available when the system boots or is in single-user mode. If you make /usr part of the / file system, both partitions are always available. [ Team LiB ]
[ Team LiB ]
castle% more /etc/vfstab #device device mount #to mount to fsck point # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr fd /dev/fd fd no /proc /proc proc no /dev/dsk/c0t3d0s1 swap /dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 swap /tmp tmpfs yes castle%
FS type ufs / -
fsck pass 1
no ufs
no
Refer to "Disk-Naming Conventions" on page 296 for information on disk device naming conventions. Note that for / and /usr, the mount at boot field value is specified as no because these file systems are mounted as part of the boot sequence before the mountall command is run. If the mount at boot field value is specified as yes, the mountall program redundantly (and unnecessarily) tries to mount these already mounted file systems. The file system table has seven fields, each separated by a Tab, as described in Table 45.
The slice for local UFS file systems (for example, /dev/dsk/c0t0d0s0). The resource name for remote file systems (for example, myserver:/export/home for an NFS file system). The name of the slice on which to swap (for example, /dev/dsk/c0t3d0s1). The /proc directory and proc file system type. A block special device that denotes a particular slice on a CD-ROM. This slice has an HSFS file system or some other CD-ROM-compatible file system written to it. /dev/diskette as PCFS or UFS file system type. This field is also used to specify swap file systems. device to fsck The raw (character) special device that corresponds to the file system identified by the device to fsck field (for example, /dev/rdsk/c0t0d0s0). This field determines the raw interface that is used by fsck. Use a dash (-) when either there is no file system written on the slice or the entry denotes an NFS-mounted file system. The mount point directory (for example, /usr for /dev/dsk/c0t0d0s6). The type of file system identified by the device to fsck field. The pass number used by fsck to decide whether to check a file system. When the field contains a dash (-), the file system is not checked. When the field contains a value of 1 or more, the file systems are checked sequentially; non- ufs file systems with a zero fsck pass are checked. For ufs file systems only, when the field contains a zero (0), the file system is not checked. When fsck is run on multiple ufs file systems that have fsck pass values greater than 1 and the preen option (-o p) is used, fsck automatically checks the file systems on different disks in parallel to maximize efficiency. Otherwise, the value of the pass number has no effect. Indicate yes or no for whether the file system should be automatically mounted by mountall when the system is booted. A list of comma-separated options (with no spaces) that are used in mounting the file system. Use a dash (-) to show no options. See the mount_file-system-type(1M) manual page for a list of the available options.
* In the Solaris Operating Environment, fsck pass does not explicitly specify the order in which file systems are checked as it did with SunOS 4.x system software.
NOTE. You must have an entry in each field in the /etc/vfstab file. If there is no value for the field, be sure to enter a dash ().
NOTE. You cannot mix servers running different versions of the NFS protocol by using a command line or in an /etc/vfstab entry. You can mix servers supporting NFS V2 and V3 protocols only with the automounter. In this case, client failover uses the best subset of version 2 or version 3 servers.
The following example uses the mount command with client failover.
Use the following steps to create an entry in the file system table.
1. Become superuser. 2. Edit the /etc/vfstab file, using an editor such as vi. 3. Add the entry, separating each field with white space (a space or a Tab). If a field has no entry, enter a dash (-). 4. Save the changes. 5. Check to be sure the mount point directory is present. If it's not, create the mount point by changing to the directory in which you want to create it, typing mkdir directory-name, and pressing Return. 6. Type mount mount-point and press Return. The entry is mounted. The following example mounts the disk slice /dev/dsk/c0t3d0s7, which contains a UFS file system, as a ufs file system attached to the mount point directory /files1 with the default mount options (read/write). It specifies the raw character device /dev/rdsk/c0t3d0s7 as the device to check with fsck. The fsck pass value of 2 means that the file system is checked, but not sequentially.
#device device mount FS fsck #to mount to fsck point type pass # /dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /files1 ufs 2
mount at boot
mount options
yes -
The following example mounts the directory /export/man from the system oak as an nfs file system on mount point /usr/man. You do not specify a device to fsck or a fsck pass for NFS file systems. In the following example, mount options are ro (read-only) and soft. For greater reliability, for read/write NFS file systems, specify the hard mount option (rw,hard).
device to fsck -
FS type nfs
fsck pass -
The following example mounts a CD-ROM drive on a mount point named /hsfiles. CD-ROM files typically are read-only, so you specify ro for the mount options. Specify no for mount at boot because you are most likely to mount and unmount a CD-ROM from the command line or by using volume management. Because hsfs is read-only, specify no device to fsck and no fsck pass number.
FS type hsfs
fsck pass -
mount at boot no
mount options ro
The following example mounts the diskette drive on a mount point named /pcfiles. Specify no for mount at boot because you are most likely to mount and unmount a diskette from the command line or by using volume management. Specify no to fsck or fsck pass because the pcfs file system does not support fsck.
device to fsck -
FS type pcfs
fsck pass -
mount at boot no
mount options rw
The following example mounts the root file system on a loopback mount point named /mnt/newroot. Specify yes for mount at boot, no device to fsck, and no fsck pass number. Loopback file systems must always be mounted after the file systems used to make up the loopback file system. Be sure that the loopback entry is the last entry in the /etc/vfstab file so that it follows the entries that depend on it.
device to fsck -
FS type lofs
fsck pass -
mount options -
[ Team LiB ]
[ Team LiB ]
umountall(1M) Unmount all file systems specified in a file system table. volcopy(1M) Make an image copy of a file system.
CAUTION. Do not use the file-systemspecific commands directly. If you specify an operation on a file system that does not support it, the generic command displays the error message command: Operation not applicable for FSType type.
The options and arguments to the generic commands are shown in Table 47.
-V
generic-options Options common to different types of file systems. -o specific-options A list of options specific to the type of file system. The list must have the following format: -o followed by a space, followed by a series of keyword [= value] pairs separated by commas with no intervening spaces. special| mount-point Identify the file system. Name either the mount-point or the special device file for the slice holding the file system. For some commands, the special file must be the raw (character) device, and for other commands it must be the block device. See Chapter 8, "Administering Devices," for more information about disk device names. In some cases, this argument is used as a key to search the /etc/vfstab file for a matching entry from which to obtain other information. In most cases, this argument is required and must come immediately after specific-options. However, it is not required when you want a command to act on all the file systems (optionally limited by type) listed in the /etc/vfstab file.
Option
Description
operands Arguments specific to a type of file system. See the specific manual page of the command (for example, mkfs_ufs) for a detailed description.
swap drusilla%
/tmp
tmpfs
yes -
If vfstab does not have an entry for a file system, use one of the following procedures to determine the file system's type. To identify a mounted file system's type, type grep mount-point /etc/mnttab and press Return. Information on the mount point is displayed, as shown in the following example.
drusilla% grep /home /etc/mnttab drusilla:(pid129) /home nfs ro,ignore,map=/etc/auto_home,indirect,dev=21c0004 693606637 bigriver:/export/home/bigriver /tmp_mnt/home/bigriver nfs rw,dev=21c0005 695409833 drusilla%
NOTE. Starting with the Solaris 8 release, the /etc/mnttab file is no longer a text file, but you can still use the grep command to search it for specific entries.
Or, type mount and press Return. A list of the mounted file systems is displayed, as shown in the following example.
drusilla% mount / on /dev/dsk/c0t3d0s0 read/write on Tue Dec 24 12:29:22 1999 /usr on /dev/dsk/c0t1d0s6 read/write on Tue Dec 24 12:29:22 1999 /proc on /proc read/write on Tue Dec 24 12:29:22 1999 /usr/man on swsvr4-50:/export/svr4/man read/write/remote on Mon Dec 30 12:49:11 1999 /usr/openwin on swsvr4-50:/export/svr4/openwinV3 read/write/remote on Mon Dec 30 13:50:54 1999 /tmp on swap o on Wed Jan 8 13:38:45 1992 /mnt on swsvr4-50:/export/svr4 read/write/remote on Fri Jan 10 15:51:23 1992 /tmp_mnt/home on bigriver:/export/home read/write/remote on Tue Jan 14 09:23:53 1992 drusilla%
1. Type devnm mount-point and press Return. The raw device name is displayed. 2. Become superuser. 3. Type fstyp/dev/rdsk/cntndnsn and press Return. The type of the file system is displayed, as shown in the following example.
drusilla% devnm /usr /dev/dsk/c0t1d0s6 /usr drusilla% su Password: # fstyp /dev/rdsk/c0t3d0s0 ufs #
[ Team LiB ]
[ Team LiB ]
When you mount a file system, any files or directories that might be present in the mount point directory are unavailable as long as the file system is mounted. These files are not permanently affected by the mounting process and become available again when the file system is unmounted. However, mount directories typically are empty because you usually do not want to obscure existing files.
umountall(1M) Unmount all file systems specified in a file system table. The mount command does not mount a read/write file system that has inconsistencies. If you receive an error message from the mount or mountall command, you may need to check the file system. The umount command does not unmount a file system that is busy. A file system is considered busy if a user is in a directory in the file system or if a program has a file open in that file system. Table 49 describes the general mount options that you can specify with the -o option of the mount command. If you specify multiple options, separate them with commas (no spaces). For example, -o ro, nosuid.
nosuid
remount
Option f
Description Forcibly unmount a file system. Without this option, umount does not allow a file system to be unmounted if a file on that file system is busy. This option can result in data loss for open files; programs that access files after the file system has been unmounted get an error (IEO). Mount the file system without making an entry in /etc/mnttab.
UFS, S5FS
logging | nologging UFS bg | fg soft | hard NFS Specify the procedure if the server does not respond. soft indicates that an error is returned. hard indicates that the retry request is continued until the server responds. The default is hard. NFS Enable or disable UFS logging. See "UFS Logging" on page 202 for more information. If the first attempt fails, retry in the background (bg) or in the foreground (fg). The default is fg.
intr | nointr NFS Specify whether keyboard interrupts can be used to kill a process hung while waiting for a response on hard-mounted file systems. The default is intr (interrupts allowed). Retry the mount operations when it fails.
retry=n largefiles
NFS
A file system mounted using this option may contain files larger than 2 Gbytes, but it is not a requirement. This option is the default.
Disable the -largefiles mount option to provide backward compatibility with previous file system behavior and enforcing the 2Gbyte maximum file size limit.
index filename NFS URL public NFS URL Automatically load a file matching filename if it is found in a directory referenced by an NFS URL. Reset the public file handle to the current directory to enable you to access an NFS URL even if the file system cannot be mounted in the usual way. Specify the size of the XMEMFS file system. This option is required. Specify the large memory page size as the file system block size.
size=sz largebsize
XMEMFS XMEMFS
UFS Logging
UFS logging, new starting with the Solaris 7 Operating Environment, is the process of storing transactions (the changes that make up a complete UFS operation) in a log file before the transactions are applied to the UFS file system. Once a transaction is stored, the file system can apply the transactions to the file system later, if needed, during a recovery. UFS logging is not enabled by default. To enable UFS logging, specify the -o logging option with the mount command when mounting a file system. If you specify logging, then logging is enabled while the file system is mounted. This option prevents file systems from becoming inconsistent, thereby eliminating the need to run fsck. And, because you can bypass fsck, logging reduces the time required to reboot a system after a crash or after an unclean halt. The default behavior is nologging. The log is allocated from free blocks on the file system and sized at approximately 1 Mbyte per 1 Gbyte of file system up to a maximum of 64 Mbytes. You can enable logging on any UFS file system, including root (/). The log created by UFS logging is continually flushed as it fills up. The log is totally flushed when the file system is unmounted when the lockfs -f command is run. The fsdb command has been updated with new debugging options to support UFS logging.
oak% mount / on /dev/dsk/c0t0d0s0 read/write/setuid on Wed Oct 23 10:08:50 1999 /usr on /dev/dsk/c0t0d0s6 read/write/setuid on Wed Oct 23 10:08:50 1999 /proc on /proc read/write/setuid on Wed Oct 23 10:08:50 1999 /tmp on swap on Wed Oct 23 10:08:52 1999 /usr/openwin on cheers:/export/openwin hard/remote on Wed Oct 23 10:11:08 1999 /home on blowup:(pid136) read only/intr/map=auto.home/indirect on Wed Oct 23 10:11:10 1999 /vol on blowup:(pid136) read only/intr/map=auto.vol/indirect on Wed Oct 23 10:11:10 1999 /nse on blowup:(pid136) read only/intr/map=/etc/auto.nse /indirect on Wed Oct 23 10:11:10 1999 oak%
1. Become superuser. 2. Type mountall and press Return. All the file systems in the local /etc/vfstab file are mounted, as shown in the following example.
1. Become superuser. 2. Type mountall -F filesystem-type and press Return. All the file systems of the type you specify that are in the local /etc/vfstab file are mounted. The following example mounts all NFS file systems.
Starting with the Solaris 2.6 release, the -largefiles mount option is used as the default for mounting UFS file systems. If you want to prevent users from mounting file systems that contain files larger than 2 Gbytes, you must explicitly use the nolargefiles mount option to disable the default behavior.
1. Become superuser. 2. Type mount mount-point and press Return. The file system is mounted, as shown in the following example.
1. Become superuser. 2. Type cd /filesystem and press Return. 3. Type find. -xdev -size +2147485647c -exec ls -l {} \; and press Return. 4. 5.
2. 3. 4. Remove any large files listed as the result of the find command. 5. Type umount / filesystem and press Return. 6. Type fsck /dev/rdsk/ device-name and press Return. 7. Type mount -o nolargefiles /dev/rdsk/ device-name and press Return. The file system is mounted. In the following example, the directory /files1 is searched for large files, unmounted, fsck is run, and the directory is mounted again with the nolargefiles option.
oak% su Password: # cd /files1 # find. -xdev -size +2000000 -exec ls -l {} \; # umount /files1 # fsck /dev/rdsk/c0t3dos7 /files1 # mount -o nolargefiles /dev/dsk/c0t3d0s7 /files1 #
1. Become superuser. 2. Type umountall -F nfs and press Return. All the remote file systems in the local /etc/vfstab file are unmounted, as shown in the following example.
CAUTION. If you unmount all file systems (by using umountall without any arguments), the system may be unusable and you may need to reboot it.
oak% mount / on /dev/dsk/c0t0d0s0 read/write/setuid on Wed Oct 23 10:08:50 1999 /usr on /dev/dsk/c0t0d0s6 read/write/setuid on Wed Oct 23 10:08:50 1999 /proc on /proc read/write/setuid on Wed Oct 23 10:08:50 1999 /tmp on swap on Wed Oct 23 10:08:52 1999 /usr/openwin on cheers:/export/openwin hard/remote on Wed Oct 23 10:11:08 1999 /home on blowup:(pid136) read only/intr/map=auto.home/indirect on Wed Oct 23 10:11:10 1999 /vol on blowup:(pid136) read only/intr/map=auto.vol/indirect on Wed Oct 23 10:11:10 1999 /nse on blowup:(pid136) read only/intr/map=/etc/auto.nse /indirect on Wed Oct 23 10:11:10 1999 [41]oak% su Password: # cd /
# umount /home #
Automounting Directories
You can mount file systems shared through NFS by using a method called automounting. The AutoFS subsystem runs in the background and mounts and unmounts remote directories as they are needed. Whenever a user on a client system running the automounter accesses a remote file or directory available through the automounter, the automounter mounts the file system on the user's system. The remote file system remains mounted as long as the user remains in the directory and has one or more files open. If the remote file system is not accessed for a certain period of time, it is automatically unmounted. The automounter mounts and unmounts file systems as required without any intervention on the part of the user other than changing into or out of a directory. You can mount some file hierarchies with the automounter, and you can change others by using the /etc/vfstab file and the mount command. A diskless machine must have entries for / (root), /usr, and /usr/kvm in the /etc/vfstab file. The automounter works with the file systems specified in maps. These maps can be maintained as NIS, NIS+, or local files. The automounter maps can specify several remote locations for a particular file system. This way, if one of the servers is down, the automounter can try to mount from another machine. You can specify which servers are preferred for each resource in the maps by assigning each server a weighting factor. The automounter starts automatically when a system enters run level 3. You can also start it from a command line. (Describing how to set up and administer the automounter is beyond the scope of this book.) By default, the Solaris Operating Environment automounts /home.
When you share a resource, you make it available for mounting by remote systems. You can share a resource in the following ways. Using the share or shareall command. For the shareall command to run, the /etc/dfs/dfstab file must already exist. The share command can be run without the dfstab file. Adding an entry to the /etc/dfs/dfstab (distributed file system table) file. The default /etc/dfs/dfstab file shows the syntax and an example of entries.
paperbark% more /etc/dfs/dfstab # # # # # # # # # # Place share(1M) commands here for automatic execution on entering init state 3. Issue the command '/etc/init.d/nfs.server start' to run the NFS daemon processes and the share commands, after adding the very first entry to this file. share [-F fstype] [ -o options] [-d "<text>"] <pathname> [resource] .e.g, share -F nfs -o rw=engineering -d "home dirs" /export/home2
paperbark%
[ Team LiB ]
[ Team LiB ]
NOTE. When an in-use file system develops inconsistencies, strange error messages may be displayed in the console window or the system may crash. Before using fsck, you may want to refer to the fsck (1M) manual page for more information.
1.
1. Become superuser. 2. Unmount the file system if it is mounted. 3. Typefsck -m /dev/rdsk/cntndnsnandpress Return. The state flag in the superblock of the file system you specify is checked to determine whether the file system is clean or requires checking. If you omit the device argument in the fsck command, all the UFS file systems listed in /etc/vfstab with a fsck pass value greater than 0 are checked. In the following example, the first file system needs to be checked; the second file system does not.
paperbark% su Password: # umount /dev/rdsk/c0t0d0s6 # fsck -m /dev/rdsk/c0t0d0s6 ** /dev/rdsk/c0t0d0s6 ufs fsck: sanity check: /dev/rdsk/c0t0d0s6 needs checking # umount /dev/rdsk/c0t0d0s7 # fsck -m /dev/rdsk/c0t0d0s7 ** /dev/rdsk/c0t0d0s7 ufs fsck: sanity check: /dev/rdsk/c0t0d0s7 okay #
1. Become superuser. 2. Unmount the file system. 3. Type fsck and press Return. All file systems in the /etc/vfstab file with entries in the fsck pass field greater than 0 are checked. You can also specify the mount point directory or /dev/rdsk/cntndnsn as arguments to fsck. Any inconsistency messages are displayed. In the following example, /dev/rdsk/c0t0d0s6 is checked and the incorrect block count is corrected.
paperbark% su Password: # umount /dev/rdsk/c0t0d0s6 # fsck /dev/rdsk/c0t0d0s6 checkfilesys: /dev/rdsk/c0t0d0s6 ** Phase 1 - Check Block and Sizes INCORRECT BLOCK COUNT I=2529 (6 should be 2) CORRECT? y ** Phase 2 - Check Pathnames ** Phase 3 - Check Connectivity ** Phase 4 - Check Reference Counts ** Phase 5 - Cylinder Groups Dynamic 4.3 FFFS 929 files, 8928 used, 2851 free (75 frags, 347 blocks, 0.6% fragmentation) /dev/rdsk/c0t0d0s6 FILE SYSTEM STATE SET TO OKAY ***** FILE SYSTEM WAS MODIFIED *****
[ Team LiB ]
[ Team LiB ]
Back up complete or individual file systems to a local or remote tape device. ufsdump Restore complete or individual file systems to a local disk. ufsrestore
Table 50. Commands for Backing Up and Restoring Files and File Systems
Task Command
You can specify a numerical argument to ufsdump from 0 to 9 to designate the level of the backup to be performed. A level 0 dump backs up all of the files in the file systems you specify. All files that have been modified since the last ufsdump at a lower dump level are copied to the dump file destination. For example, if a level 2 dump was done on Monday, followed by a level 4 dump on Tuesday, a subsequent level 3 dump on Wednesday would contain all files modified or added since the level 2 (Monday) backup.
remote-host:/dev/rmt/unit
For example, the device name for a remote tape drive /dev/rmt/0 , on the system oak , would be oak:/dev/rmt/0 . Use the following steps to do a level 0 (full) backup of a file system. 1. Type telinit s and press Return. The system is brought to single-user mode, which ensures that no users can change the file systems you are backing up. 2. Insert a tape cartridge in the QIC-150 tape drive. 3. Type ufsdump 0cuf /dev/rmt/ unit cntndns[[0-7] andpress Return. The 0 option specifies a level 0 (complete) dump. The c option specifies cartridge tape. The u option updates the dump record. The f option followed by the device name specifies the device file. Type the raw disk slice for the file system you want to back up, for example, c0t0d0s7 for /files1 . The following example does a level 0 dump of the c0t0d0s7 slice.
oak% su Password: # telinit s # ufsdump 0cuf /dev/rmt/0 c0t0d0s7 DUMP: Date of this level 0 dump: Wed Mar 11 10:16:53 1992 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/rdsk/c0t3d0s7 (/export/home) to /dev/rmt/0 DUMP: mapping (Pass I) [regular files] DUMP: mapping (Pass II) [directories] DUMP: estimated 956 blocks (478KB) DUMP: Writing 63 Kilobyte records DUMP: dumping (Pass III) [directories] DUMP: dumping (Pass IV) [regular files] DUMP: level 0 dump on Wed Mar 11 10:16:53 1992 DUMP: 956 blocks (478KB) on 1 volume DUMP: DUMP IS DONE #
4. If the dump requires more than one tape, the ufsdump command tells you when to change to a new tape. 5. Label the tape with the command, file system, and date so that you can easily find the backup tape if you need to restore files.
5.
1.
2. Refer to your backup plan to find the date of the last backup that would have the file or file system on it. Note that you do not necessarily use the most recently backed up version of the file. To retrieve the most recent version of a file, work backward through the incremental backups from highest to lowest level and most recent to least recent. 3. If you have on-line archive files created by the ufsdump -a option, type ufsrestore ta archive-name / path/ filename(s) and press Return. Be sure to use the complete path for the filename(s) . A list of the files and the media they are stored on is displayed. 4. Retrieve the media containing the backups. Be aware of the storage organization of backup media at your site so that you can locate media that are months or years old. 5. Insert media in the drive and type ufsrestore tf device-name /path/filename (s) and press Return. Be sure to use the complete path for the filename (s ). If a file is in the backup, its name and inode number are listed. Otherwise, a message says it is not on the volume. 6. If you have multiple dump files on the same tape, you can use the -s n option to position the tape at the dump you want to use. For example, type ufsrestore xfs /dev/rmt0 5 and press Return to position the tape at the fifth dump and restore it.
CAUTION. This procedure completely destroys any data already in the file system by overwriting any files or directories under the directory to which you tell ufsrestore to restore .
1. Become superuser. 2. Type telinit s and press Return. The system is brought to single-user mode, which ensures that no one is using the file system you are restoring. 3. Type umount mount-point and press Return. The mount point you specify (for example, /files1 ) is unmounted. 4.
3.
4. Type newfs /dev/rdsk/cntndnsnandpress Return. The raw device file for the disk slice (for example, /dev/rdsk/c0t0d0s7 for the /home slice) is wiped clean and the file system is rebuilt. 5. Typemount /dev/dsk/cntndnsnandpress Return. The file system, specified as the block file device (for example, /dev/dsk/c0t0d0s7 for /files1 ), is remounted at the mount point you specify. 6. Type cd mount-point and press Return. Focus is in the directory you want to restore. 7. Insert the tape cartridge in the QIC-150 tape drive. 8. Type ufsrestore rvf /dev/rmt/0h and press Return. The h option extracts the actual directory instead of the files that it references. This option prevents hierarchical restoration of complete subtrees from the tape. The file system is restored. In the following example, the /files1 slice c0t0d0s7 is restored.
oak% su Password: # telinit s # umount /files1 # newfs /dev/rdsk/c0t0d0s7 # mount /dev/dsk/c0t0d0s7 /files1 # cd /files1 # ufsrestore rvf /dev/rmt/0h #
1. 2. Write-protect the tape for safety. 3. Put the backup tape in the tape drive. 4. Type cd /var/tmp and press Return. If you want to restore the files to a different directory, substitute the directory name for /var/tmp in this step. 5. Type ufsrestore if /dev/rmt/ unit and press Return. Some informational messages and the restore> prompt are displayed. 6. Create a list of files to be restored. To list the contents of a directory, type ls and press Return. To change directories, type cd directory-name and press Return. To add a directory or file name to the list of files to be restored, type add filename and press Return. To remove a directory or file name from the list of files to be restored, type delete filename and press Return. To keep the mode of the current directory unchanged, type setmodes and press Return. Then type n and press Return. 7. When the list is complete, type extract and press Return. Then, ufsrestore asks you which volume number to use. 8. Type the volume number and press Return. If you have only one volume, type 1 and press Return. The files and directories in the list are extracted and restored to the current working directory. 9. Type quit and press Return. The shell prompt is displayed. 10. Use the ls -l command to list the restored files and directories. A list of files and directories is displayed. 11. Check the list to be sure all the files and directories you specified in the list have been restored. 12. Use the mv command to move the files to the proper directories. The following example restores the files backup.examples and junk from the pubs directory.
# cd /var/tmp # ufsrestore if /dev/rmt/0 ufsrestore > ls .: lost+found/ pubs/ ufsrestore > cd pubs ufsrestore > ls ./pubs: .Xauthority .Xdefaults .cshrc .desksetdefaults
ufsrestore > add backup.examples ufsrestore > add junk ufsrestore > setmodes set owner/mode for '.'? [yn] n ufsrestore > extract You have not read any volumes yet. Unless you know which volume your file(s) are on you should start with the last volume and work towards the first. Specify next volume #: 1 set owner/mode for '.'? [yn] n ufsrestore > quit # ls -l total 6 drwxrwxrwt 3 sys sys 512 Mar 11 10:36 ./ drwxrwxr-x 18 root sys 512 Mar 10 16:43 ../ drwxr-xr-x 2 pubs staff 512 Mar 11 10:11 pubs/ # pwd /var/tmp # cd pubs # ls ./ ../ backup.examples junk #
3.
/var/tmp in this step. 4. Type ufsrestore xf /dev/rmt/ unit /pathto/filename and press Return. The x option tells ufsrestore to copy specific files or directories in the /pathto/filename argument. The message set owner/mode for '.'? [yn] is displayed. 5. Type n and press Return. Directory modes remain unchanged. 6. Type the volume number where files are located and press Return. If there is only one volume, type 1 and press Return. The file is restored to the current working directory. 7. Type ls -l filename and press Return. A listing for the file is displayed. 8. Use the mv command to move the file to the proper directory.
You can use the fssnap (1M) command, new in the Solaris 9 release, to create a read-only snapshot of a file system. You can use the snapshot to back up file systems while the file system is mounted. When you run the fssnap command, it creates a virtual device and a backing-store file. You can use any of the existing Solaris backup commands to back up the virtual device, which looks and acts like a real device. The backing-store is a bitmapped file that contains copies of presnapshot data that has been modified since the snapshot was taken. With UFS snapshots, you can keep the file system mounted and the system in multiuser mode while performing system backups. In previous releases, you were advised to bring the system to singleuser mode to keep the file system inactive while using the ufsdump command to back up file systems. UFS snapshots are similar to the Instant Image process. Instant Image allocates space equal to the size of the entire file system being captured. The UFS snapshot backing-store file occupies only as much disk space as needed and you can place a maximum size on the backing-store file.
NOTE. Although you can use UFS snapshots to make copies of large file systems, it is better suited for smaller systems. Instant Image is better suited for enterprise-level systems .
When you first create the UFS snapshot, users of the file system might notice a slight pause. The length of the pause increases with the size of the file system being captured. While the snapshot is
active, users of the file system may notice a slight performance impact when writing to the file system but will notice no impact when the file system is read.
/usr/sbin/fssnap [-F FSType][-V] -o special_options[mount-point | special ] /usr/sbin/fssnap -d [-F FSType] [-V] -o special_options [mount-point | special ] /usr/sbin/fssnap -i [-F FSType] [-V] -o special_options [mount-point | special]
-d Delete the snapshot associated with the given file system. -F FSType Specify the file system type to be used. You can specify the FSType here, or fssnap determines it by matching the block special device with an entry in the /etc/vfstab table or by consulting /etc/default/fs . -i Display the state of any given FSType snapshot. If you specify no mount-point or device , fssnap displays a list of all snapshots on the system. When you specify a mount-point or device , fssnap provides detailed information for the specified file system snapshot by default. The format and meaning of this information is file system dependent. See the FSType-specific fssnap manual page for details. -o special_options
See the FSType-specific manual page for fssnap . The UFS special_options are listed below
backing-store= path
Use path as the backing-store file. path must not reside on the file system that is being captured in a snapshot. path must exist and must be either a directory or a regular file. If path is a directory, then a temporary file is created and held open. That device is then used as-is. You can abbreviate this option as bf= path or bs= path .
unlink Unlink the backing-store file after the snapshot is created. This option specifies that the backing-store file does not need to be removed manually when the snapshot is deleted. This behavior might make administration more difficult because the file is not visible in the file system. If you do not specify this option, manually remove the backing-store files after the snapshot is deleted.
chunksize= n [k,m,g]
Use n to specify the granularity of the data that is sent to the backing-store. Specify chunksize in k for kilobytes, m for megabytes, or g for gigabytes. By default, chunk size is four times the block size of the file system (typically 32k).
maxsize= n[k,m,g]
Do not allow the size of the backing-store file to exceed n , where n is the specified unit. The snapshot is deleted automatically when the backing-store file exceeds maxsize . Specify maxsize in k for kilobytes, m for megabytes, or g for gigabytes.
raw Display to standard output the name of the raw device instead of the block device when a snapshot is created. The block device is printed by default (when you do not specify raw ). This option makes it easier to embed fssnap commands in the command line for commands that require the raw device instead. Both devices are always created. This option affects only the output. -V Echo the complete command line, but do not execute the command.
Option
Description
mopoke% df -h Filesystem size used avail capacity /dev/dsk/c1t0d0s0 4.3G 1.1G 3.2G 26% /proc 0K 0K 0K 0% mnttab 0K 0K 0K 0% fd 0K 0K 0K 0% swap 545M 40K 545M 1% swap 546M 304K 545M 1% /dev/dsk/c1t0d0s7 4.9G 1.1G 3.8G 22% /export/home/winsor 4.9G 1.1G 3.8G 22% mopoke% su Password: # fssnap -F ufs -o bs=/home/winsor/rootbackup
/ /dev/fssnap/0 # fssnap -i 0 / # /usr/lib/fs/ufs/fssnap -i / Snapshot number : 0 Block Device : /dev/fssnap/0 Raw Device : /dev/rfssnap/0 Mount point : / Device state : idle Backing store path : /home/winsor/rootbackup Backing store size : 1536 KB Maximum backing store size : Unlimited Snapshot create time : Mon Sep 30 15:36:11 2002 Copy-on-write granularity : 32 KB #
# fssnap -i 0 / # fssnap -d /
[ Team LiB ]
[ Team LiB ]
Understanding CacheFS
With CacheFS you can enable a client system to cache a file system from a server. Initial access to the file system may seem slow, but subsequent uses of the same file by the user are faster. Typically, you would cache an NFS or HSFS file system. You create cache file systems individually on each client system that needs improved NFS performance.
NOTE. CacheFS does not support caching of the root (/) and /usr file systems.
1. On the client system, use the cfsadmin(1M) command to create a cache so that file systems you specify to be mounted in the cache can be accessed by the user locally instead of across the network. To prevent conflicts within the CacheFS software, after you have created the cache you should not perform any operations within the cache directory on the client system. 2. On the client, create a mount point at which the file system from the servercalled the back file systemis mounted. 3. Note the name of the server and path to the back file system you want to cache. The format is server: back-filesystem. 4. Mount a file system in a cache by using the mount command on the client, adding an entry to the client's /etc/vfstab file, or using the automounter to automount the file system. After you have completed the setup of the CacheFS, files are dynamically placed in the cache as the user accesses them.
NOTE. You can mount only file systems that are shared from the server in question. Refer to the share (1M) manual page for more information or see "Sharing Files from a Server" on page 207.
Creating a Cache
Use the following steps on a client system to create a cache.
1. Decide what name you want to use for the cache directory. 2. On the client system, become superuser. 3. Type cfsadmin -c cache-directory and press Return. In the following example, a cache directory named cachefile is created in the /local directory.
# mkdir /cachemount #
1. On the client system, become superuser. 2. All on one line, type mount -F cachefs -o backfstype= fstype, cachedir= cachedirectory [ , options] back-file-system mount-point and press Return. 3. Type cachefsstat mount-point and press Return. The output from this command verifies that the cache you created was mounted. The following example creates a cache directory named /local/cachedir, creates a mount point named /usr/local, and mounts the NFS file system castle:/export/local as a cached file system named /usr/local in the cache named /local/cachedir.
paperbark% su Password: # mkdir /usr/local # mkdir /local # cfsadmin -c /local/cachedir # mount -F cachefs -o backfstype=nfs,cachedir=/local/cachedir castle:/export/local /usr/local # cachefsstat /usr/local /usr/local
100% 0 0 0
If the file system was not mounted in the cache, an error message similar to the following is displayed.
1. On the client system, become superuser. 2. Using an editor, add the following line to the /etc/vfstab file.
3. Type mount mount-point and press Return or reboot the system to mount the file system.
3. The following example mounts the /export /local directory from the remote system castle with the back file system /local/cachedir on the cache directory /usr/local.
1. Become superuser. 2. Using an editor, add the following line to the auto_direct map.
3.
Using an editor, add /- to the auto_master map. The /- entry is a pointer to check the auto_direct map.
4. Reboot the system. 5. Type cd files-system and press Return. 6. Type ls files-system and press Return.
5. 6. Review the output of the ls command to verify that the entry was made correctly.
Maintaining Caches
After you set up cache file systems, you can perform the following maintenance tasks on them. Modify file systems in the cache by unmounting, deleting, re-creating, and remounting the cache. Display cache information. Check cache consistency. Delete a file system from the cache. Check cached file system integrity. If you are using the /etc/vfstab file to mount file systems, you modify the cache by editing the file system options in the /etc/vfstab file. If you are using the automounter, you modify the cache by editing the file system options in the automounter maps. Table 52 lists the commands that you can use to perform cache maintenance. Refer to the appropriate manual page for more details.
cachefspack
cachefslog
cachefswssize Interpret the log file to give a recommended cache size. See the cachefsswsize(1M) manual page for more information. cachefsstat Display statistical information about a specific file system or all cached file systems. The information provided in the output of this command is taken directly from the cache. See the cachefsstat(1M) manual page for more information.
Command
Description Check the integrity of cached file systems and automatically correct problems without requiring user interaction. See the fsck_cachefs(1M) manual page for more information.
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
RCM Scripting
The new Reconfiguration Coordination Manager (RCM) script enables you to write your own scripts to shut down your applications or to cleanly release the devices from your applications during dynamic reconfiguration. An RCM script is an executable shell script (Perl, sh, csh, or ksh) or binary program that the RCM daemon runs. Perl is the recommended scripting language. An RCM script requires the RCM commands listed in Table 53.
You can also use the RCM commands listed in Table 54 in RCM scripts, but these commands are optional.
queryremove Query whether the resource can be released. preremove postremove undoremove Release the resource. Provide post-resource-removal notification. Undo the actions done in preremove.
Refer to the "Reconfiguration Coordination Manager (RCM) Script Overview" section in the Sun System Administration Guide: Basic Administration and the rcmscript(4) and cfgadm(1M) manual pages for more information about writing and administering RCM scripts.
[ Team LiB ]
See Chapter 9, "Administering Systems," for examples of these commands. [ Team LiB ]
[ Team LiB ]
Allocating Devices
The Solaris 9 Operating Environment provides a device allocation method that fulfills the Trusted Computer System Evaluation Criteria (TCSEC) object-reuse requirement for computing systems at level C2 and above. The device allocation mechanism prevents simultaneous access to a device, prevents one user from reading media being written to the device by another user, and prevents one user from accessing any information from the device or driver internal storage after another user is finished with the device. For example, several users often share a single tape drive that may not be located at an individual user's location. If the tape drive is located remotely, some time can elapse between the time the user loads a tape in the drive and the time the user invokes a command to access the tape in the drive. Because other users could access the drive while the tape is unattended, another user could access or overwrite the data on the tape. With the device allocation mechanism, you can ensure that one user at a time has access to a specific tape device. Use the commands described in Table 56 to manage device allocation.
NOTE. The device allocation commands are available only if the Basic Security Module (BSM) has been enabled.
Enabling BSM
The basic security module (BSM) is the Sun Microsystem implementation of C2 security. It provides an auditing capability with self-contained audit records that contain all the relevant information about an event. For example, an audit record describing a file event contains the absolute path name and a time stamp and date stamp of the opening or closing of the file. Use the bsmconv command as root to enable BSM.
NOTE. The bsmconv command adds a line to /etc/system that disables the ability to abort the system with the Stop-A keyboard sequence. If you want to retain that ability, you must comment out the following line in the /etc/system file after you run the bsmconv command.
set abort_enable = 0
1. Become superuser. 2. Type telinit 1 and press Return to bring the system to single-user mode. 3. Type /etc/security/bsmconv and press Return to begin the process of enabling BSM. 4. Type y and press Return to enable BSM. 5. Type telinit 6 and press Return to reboot the system as a multiuser BSM system. The following example uses the bsmconv command to enable the basic security model and uses the telinit 6 command to reboot the system.
# /etc/security/bsmconv This script is used to enable the Basic Security Module (BSM). Shall we continue with the conversion now? [y/n] y bsmconv: INFO: checking startup file. bsmconv: INFO: move aside /etc/rc2.d/S92volmgt. bsmconv: INFO: turning on audit module.
bsmconv: INFO: initializing device allocation files. The Basic Security Module is ready. If there were any errors, please fix them now. Configure BSM by editing files located in /etc/security. Reboot this system now to come up with BSM enabled. # telinit 6
Disabling BSM
If you no longer require BSM, you can disable it with the bsmconv command. Use the following steps to disable BSM and remove the BSM entry from the /etc/system file.
1. Become superuser. 2. Type telinit 1 and press Return to bring the system to single-user mode. 3. Type /etc/security/bsmunconv and press Return to begin the process of disabling BSM. 4. Type y and press Return to disable BSM. 5. Type telinit 6 and press Return to reboot the system without BSM. The following example uses the bsmunconv command to disable the basic security model.
# /etc/security/bsmunconv This script is used to disable the Basic Security Module (BSM). Shall we continue the reversion to a non-BSM system now? [y/n] y bsmunconv: INFO: moving aside /etc/security/audit_startup. bsmunconv: INFO: restore /etc/rc2.d/S92volmgt. bsmunconv: INFO: removing c2audit:audit_load from /etc/system. The Basic Security Module has been disabled. Reboot this system now to come up without BSM. # telinit 6
-u [device] List the path name(s) of device special files associated with the device that are allocated to the owner of the current process. If you specify device, list_devices lists only the files associated with that device. -U uid Use the user ID uid instead of the real user ID of the current process when performing the list_devices operation. Only a user with the solaris.devices.revoke authorization can use this option.
The following example shows the long listing for the list_devices command.
mopoke% list_devices -l device: audio type: audio files: /dev/audio /dev/audioctl /dev/sound/0 /dev/sound/0ctl device: fd0 type: fd files: /dev/diskette /dev/rdiskette /dev/fd0a /dev/rfd0a /dev/fd0 /dev/fd0b /dev/rfd0b /dev/fd0c /dev/rfd0c /dev/rfd0 device: sr0 type: sr files: /dev/sr0 /dev/rsr0 /dev/dsk/c1t1d0s0 /dev/dsk/c1t1d0s1 /dev/dsk/c1t1d0s2 /dev/dsk/c1t1d0s3 /dev/dsk/c1t1d0s4 /dev/dsk/c1t1d0s5 /dev/dsk/c1t1d0s6 /dev/dsk/c1t1d0s7 /dev/rdsk/c1t1d0s0 /dev/rdsk/c1t1d0s1 /dev/rdsk/c1t1d0s2 /dev/rdsk/c1t1d0s3 /dev/rdsk/c1t1d0s4 /dev/rdsk/c1t1d0s5 /dev/rdsk/c1t1d0s6 /dev/rdsk/c1t1d0s7 mopoke%
The /etc/security/device_maps file contains access information about each physical device. Each device is represented by a one-line entry.
mopoke% more /etc/security/device_maps audio:\ audio:\ /dev/audio /dev/audioctl /dev/sound/0 /dev/sound/0ctl:\ fd0:\ fd:\ /dev/diskette /dev/rdiskette /dev/fd0a /dev/rfd0a /dev/fd0 /dev/fd0b /de v/rfd0b /dev/fd0c /dev/rfd0c /dev/rfd0:\ sr0:\ sr:\ /dev/sr0 /dev/rsr0 /dev/dsk/c1t1d0s0 /dev/dsk/c1t1d0s1 /dev/dsk/c1t1d0s2 /dev/dsk/c1t1d0s3 /dev/dsk/c1t1d0s4 /dev/dsk/c1t1d0s5 /dev/dsk/c1t1d0s6 /dev/ds k/c1t1d0s7 /dev/rdsk/c1t1d0s0 /dev/rdsk/c1t1d0s1 /dev/rdsk/c1t1d0s2 /dev/rdsk/c1 t1d0s3 /dev/rdsk/c1t1d0s4 /dev/rdsk/c1t1d0s5 /dev/rdsk/c1t1d0s6 /dev/rdsk/c1t1d0 s7:\ mopoke%
You can use the dminfo command to report information about a device entry in the /etc/security/device_maps file. Table 58 lists the options to the dminfo command.
Description Search by dev-type. Search device_maps(4) for a device_type field matching the given dev-type. You cannot use this option with -d, -n, or -u. Update the device_maps(4) file. You can use this option to add entries to the device_maps(4) file. The dm-entry must be a complete device_maps(4) file entry. The dm-entry has fields, as in the device_maps file. Use the colon (:) as a field separator and white space as the device_list subfield separators. If any fields are missing or if the entry would be a duplicate, dm-entry is not made. Only superuser or a user with the appropriate rights can update the default device_maps file. Print the requested entry or entries, one line per entry, on the standard output. If you specify no entries, all are printed.
-v
The following example uses the verbose option to display all device_maps entries.
mopoke% dminfo -v audio:audio:/dev/audio /dev/audioctl /dev/sound/0 /dev/sound/0ctl: fd0:fd:/dev/diskette /dev/rdiskette /dev/fd0a /dev/rfd0a /dev/fd0 /dev/fd0b /dev/rfd0b /dev/fd0c /dev/rfd0c /dev/rfd0: sr0:sr:/dev/sr0 /dev/rsr0 /dev/dsk/c1t1d0s0 /dev/dsk/c1t1d0s1 /dev/dsk/c1t1d0s2 /dev/dsk/c1t1d0s3 /dev/dsk/c1t1d0s4 /dev/dsk/c1t1d0s5 /dev/dsk/c1t1d0s6 /dev/dsk/c1t1d0s7 /dev/rdsk/c1t1d0s0 /dev/rdsk/c1t1d0s1 /dev/rdsk/c1t1d0s2 /dev/rdsk/c1t1d0s3 /dev/rdsk/c1t1d0s4 /dev/rdsk/c1t1d0s5 /dev/rdsk/c1t1d0s6 /dev/rdsk/c1t1d0s7: mopoke%
Allocating a Device
Use the allocate command to allocate a device. Table 59 lists the options to the allocate command.
-F device Reallocate a device allocated to another user. This option is often used with -U to reallocate a specific device to a specific user. Only a user with the solaris.devices.revoke authorization is permitted to use this option. Use the device argument to specify the device to be manipulated, for example, st0 for a streaming tape device. You can display a list of available devices with the -l option to the list_devices(1) command, also new in the Solaris 9 Operating Environment. The default allocate operation allocates the device special files associated with device to the UID of the current process. When you specify the -F option, the device-cleaning program is executed when allocation is performed. This cleaning program is found in /etc/security/lib. The name of this program is found in the device_allocate(4) entry for the device in the dev-exec field. -g dev-type Allocate a nonallocated device with a device type matching dev-type. Use the dev-type argument to specify the type of device. You can determine the type of device from the output of the list_devices -l command. -s -U uname Suppress any diagnostic output. Use the user ID uname instead of the user ID of the current process when performing the allocate operation. Only a user with the solaris.devices.revoke authorization is permitted to use this option.
Deallocating a Device
Use the deallocate command to deallocate a device allocated to the evoking user. Table 60 lists the options to the deallocate command.
-s
[ Team LiB ]
[ Team LiB ]
NOTE. Not all SCSI and PCI controllers support hot-plugging with the cfgadm command.
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
Using Tapes
This section describes tape device-naming conventions, useful commands for streaming tape cartridges, and ways to use the tar, cpio, and pax commands to archive and retrieve files from tapes. You can use the tar, cpio, and pax commands to copy files and file systems to tape. The command you choose depends on how much flexibility and precision you require for the copy. Use tar to copy files and directory subtrees to a single tape. Note that the Solaris tar command can archive special files (block and character devices, fifos), but the SunOS 4.x tar command cannot extract them. The cpio command provides better portability between different versions of the UNIX operating system. Use cpio to copy arbitrary sets of files, special files, or file systems that require multiple tape volumes, or to copy files from Solaris systems to SunOS 4.x systems. The cpio command packs data onto tape more efficiently than does tar and skips over any bad spots in a tape when restoring. The cpio command also provides options for writing files with different header formats (tar, ustar, crc, odc, bar) for portability between systems of different types. Use pax to copy files, special files, or file systems that require multiple tape volumes or when you want to copy files to and from POSIX-compliant systems. Because tar, cpio, and pax use the raw tape device, you do not need to format or make a file system on tapes before you use them. The tape drive and device name you use depend on the hardware and configuration for each system.
Device 0 is the first tape device connected to the system (/dev/rmt/0). The tape device could be a QIC-11, QIC-24, QIC-150, 4mm, 8mm, AIT, DTL, or DAT drive.
/dev/rmt/0
/dev/rmt/1
NOTE. Most device names start their numbering sequence with zero (0). Consequently, when you talk about the first disk or target, its number is 0, not 1.
/dev/rmt/XA
To determine the different densities that are supported for a drive, look at the /dev/rmt subdirectory, which includes the set of tape device files that support different output densities for each tape. The unit and density characters are shown in Table 61. For example, to specify a raw magnetic tape device on the first (0) drive with medium density, use the following device name.
/dev/rmt/0m
= /dev/rmt/ XA
/dev/rmt/0mn
If you omit the density character, the tape is usually written at its highest density, not compressed. Each SCSI tape drive vendor encodes the vendor and tape drive model into their drives. When the OpenBoot PROM or Solaris Operating Environment probes the SCSI bus, each SCSI device returns its SCSI information that contains the vendor and drive model data. Solaris matches the returned value against each entry in the /kernel/drv/st.conf file and turns on the proper SCSI transport and tape drive features such as compression and data density.
Character null l m h u
Density, 1/4-Inch Cartridge Default, preferred (highest) density. QIC-11 format. QIC-24 format. QIC-150. Reserved.
For 1/4-inch cartridges, density is specified by the format in which the data is written: the QIC format. The QIC-11 and QIC-24 formats write approximately 1000 bpi on each track. The density for QIC-150 is somewhat higher. The preferred density for a 60-Mbyte 1/4-inch cartridge drive is QIC-24 and for a 150-Mbyte 1/4-inch cartridge drive, it is QIC-150. A 150-Mbyte drive can write only QIC-150; it cannot be switched to write QIC-24 or QIC-11. Format selection is useful only for drives that can write both QIC-24 and QIC-11.
DLT (Digital Linear Tape) 1/2-inch cartridge tapes have a 35- to 70-Gbyte capacity and a standard SCSI-2 interface that can connect to a wide range of host adapters, including Fast-Wide SCSI. The DLT7000 supports most data management software packages, including Solstice Backup and VERITAS NetBackup. AIT (Advanced Intelligent Tape) is another standard SCSI tape device with an intelligent chip inside each tape cartridge. When you add a DLT or AIT drive to a Solaris system, check for an appropriate entry in the /kernel/drv/st.conf file. It is likely that no relevant entry exists for a new tape drive. Contact the vendor of the drive for the syntax of the line to insert into the /kernel/drv/st.conf file. Once you insert the line in the file and reboot the system, Solaris can take full advantage of all features of the new tape drive.
The following example shows the status for the tape in drive /dev/rmt/1.
oak% mt -f /dev/rmt/1 status Archive QIC-150 tape drive: sense key(0x6)= unit attention file no= 0 block no= 0 oak%
residual= 0
retries= 0
NOTE. The /usr/sfw/bin/gtar GNU tar command now ships with the Solaris 9 Operating Environment and has none of the limitations of the tar command.
The following sections describe how to use the tar command to copy files to a tape, list the files, append the files, and retrieve the files.
1. Change to the directory that contains the file you want to copy. 2.
CAUTION. Copying files to a tape with the c option to tar destroys any files already on the tape. If you want to preserve the files already on the tape, use the r option described in "Appending Files to a Tape (tar)" on page 248. Using absolute path names can be dangerous because you can overwrite the original files, and you cannot choose to restore files to a different location. 3. Type tar cvf /dev/rmt/n filename filename filename... and press Return. The c (create) option copies the files you specify, the v (verbose) option displays information about the files as they are copied, and the f (files) option followed by the tape device name specifies where the tar files are to be written. The file names you specify are copied to the tape, overwriting any existing files on the tape.
NOTE. You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file-name argument. If you specify a directory name as the file name, the directory and all its subdirectories are recursively copied to the tape.
4. Remove the tape from the drive and write the names of the files on the tape label. The following example copies two files to a tape in tape drive 0.
oak% cd /home/winsor oak% ls evaluation* evaluation.doc evaluation.doc.backup oak% tar cvf /dev/rmt/0 evaluation* a evaluation.doc 86 blocks a evaluation.doc.backup 84 blocks oak%
1. 2. Type tar tvf /dev/rmt /n and press Return. The t (table) option lists the files you specify, the v (verbose) option displays complete information about the files as they are listed in a form similar to the ls -l command, and the f (files) option followed by the tape device name specifies the device where the tar files are located. In the following example, the table of contents for the tape in drive 0 contains two files.
oak% tar tvf /dev/rmt/0 rw-rw-rw-6693/10 44032 Apr 23 14:54 2000 evaluation.doc rw-rw-rw-6693/10 43008 Apr 23 14:47 2000 evaluation.doc.backup oak%
Reading from left to right, the first column shows the permissions for the file; the second column shows the UID and GID file ownership; the third column shows the number of characters (bytes) in the file; the fourth, fifth, sixth, and seventh columns contain the month, day, time, and year the file was last modified, and the final column contains the name of the file.
1. Change to the directory that contains the file you want to copy. 2. Insert a tape that is not write-protected into the tape drive. 3. Type tar rvf /dev/rmt/ n filename filename filename ... and press Return. The file names you specify are appended to the files already on the tape in the drive you specify.
NOTE. You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file-name argument.
4. Remove the tape from the drive and write the names of the files on the tape label. The following example appends one file to the files already on the tape in drive 0.
oak% cd /home/winsor oak% tar cvf /dev/rmt/0 a junk 1 blocks oak% tar rvf /dev/rmt/0 rw-rw-rw-6693/10 44032 rw-rw-rw-6693/10 18 oak%
junk evaluation.doc Apr 23 14:54 2000 evaluation.doc Dec 10 11:36 2000 junk
You can put more than one tar archive on a tape if you use the n (no-rewind) option as part of the tape device name. For example, type tar cvf /dev/rmt/ nn filename. The tape is not rewound after the files are copied, and the next time you use the tape, the files are written after the end of the previous set of files. See "Specifying the No-Rewind Option" on page 243 for more information.
1. Change to the directory into which you want to put the files. 2. Insert the tape into the tape drive. 3. Type tar xvf /dev/rmt/ n and press Return. All the files on the tape in the drive you specify are copied to the current directory. The following example copies all files from the tape in drive 0.
oak% cd /home/winsor/Evaluations oak% tar xvf /dev/rmt/0 x evaluation.doc, 44032 bytes, 86 tape blocks x evaluation.doc.backup, 43008 bytes, 84 tape blocks oak%
To retrieve individual files from a tape, type tar xvf /dev/rmt/ n filename filename filename... and press Return. The file names you specify are extracted from the tape and placed in the current working directory. The following example copies the evaluation.doc file from the tape
in drive 0.
oak% cd /home/winsor/Evaluations oak% tar xvf /dev/rmt/0 evaluation.doc x evaluation.doc, 44032 bytes, 86 tape blocks oak%
Use the following steps to retrieve directories and subdirectories recursively from a tape.
1. Change to the parent directory into which you want to copy the files. If the directory already exists, be sure you are in the parent directory and that it is okay to overwrite the contents of the directory before you copy the files from the tape. For example, to restore the contents of a directory named Book that is in /home/winsor/Book, you would change to /home/winsor and type tar xvf /dev/rmt/ n Book and press Return. If you are in the directory /home/winsor/Book, the files are restored as /home/winsor/Book/Book. 2. Type tar xvf /dev/rmt/ n directory-name and press Return. The directory and all its subdirectories are recursively copied from the tape.
NOTE. The names of the files extracted from the tape exactly match the names of the files stored on the archive. If you have any doubts about the names or paths of the files, first list the files on the tape. See "Listing the Files on a Tape (tar)" on page 248 for instructions and the tar(1) manual page for more information.
1. Insert a write-enabled tape into the tape drive. 2. Type ls | cpio -oc > /dev/rmt/ n and press Return. The o option copies the files. The c option writes header information in ASCII character form for portability. All the files in the directory are copied to the tape in the drive you specify, overwriting any existing files on the tape, and the total number of blocks copied is displayed. 3. Remove the tape from the drive and write the names of the files on the tape label. In the following example, all the files in the directory /home/winsor/TOI are copied to the tape in tape drive 0.
1. Insert a tape into the tape drive. 2. Type cpio -civt < /dev/rmt/ n and press Return. The -c option reads header information in ASCII character format for portability. The i option reads in the contents of the tape. The v option displays the output in a format similar to the output from the ls -l command. The t option lists the table of contents for the files on the tape in the tape drive you specify.
NOTE. Listing the table of contents takes as long as it does to read the archive file because the cpio command must process the entire archive.
In the following example, the table of contents for the tape in drive 0 contains four files.
oak% cpio -civt < /dev/rmt/0 100666 winsor 3895 Feb 24 100666 winsor 3895 Feb 24 100666 winsor 6491 Feb 24 100666 winsor 1299 Feb 24 31 blocks oak%
The first column shows permissions in octal format; the second column shows the owner of the file; the third column displays the number of characters (bytes) in the file; the fourth, fifth, sixth, and seventh columns show the month, date, time, and year the file was last modified; and the final column shows the name of the file.
CAUTION. Using absolute path names can be dangerous because you can overwrite the original files and you cannot choose to restore files to a different location.
1. Change to the directory into which you want to put the files. 2. Insert the tape into the tape drive. 3. Type cpio -icv < /dev/rmt/ n and press Return. All the files on the tape in the drive you specify are copied to the current directory. The following example copies all files from the tape in drive 0.
oak% cd /home/winsor/Book oak% cpio -icv "*chapter" < /dev/rmt/0 Boot.chapter Directory.chapter Install.chapter Intro.chapter 31 blocks oak%
systems that require multiple tape volumes or when you want to copy files to and from POSIXcompliant systems. Disadvantages of the pax command are that it is not aware of file system boundaries and that the full path-name length cannot exceed 255 characters.
1. Change to the directory that contains the files you want to copy. 2. Insert a write-enabled tape into the tape drive. 3. Type pax -w -f /dev/rmt/ n . and press Return. The -w option writes the current directory contents to tape. The -f option identifies the tape drive. The dot (.) at the end of the command specifies the current directory. The pax command does not list the files as they are copied. 4. Type pax -l -f /dev/rmt/ n and press Return. The -l option lists the files on the tape to verify that the files are copied. 5. Remove the tape from the drive and write the names of the files on the tape label. The following example copies all files from the tape in drive 0.
castle% pax -w -f /dev/rmt/0 . castle% pax -l -f /dev/rmt/0 . ./addusr-1.rs ./addusr-2.rs ./at-addmn.rs ./at-base.rs ./at-menu.rs castle%
NOTE. When you use the pax command to copy files to a single-volume tape, you can also list and retrieve files from that tape with the tar command.
1. Change to the directory into which you want to copy the files. 2. Insert a write-enabled tape into the tape drive. 3. Type pax -r -f /dev/rmt/ n. and press Return. The -r option reads the contents of the tape to the current directory. The -f option identifies the tape drive. The dot (.) at the end of the command specifies the current directory. The pax command does not list the files as they are copied. 4. Type ls -l and press Return. The ls -l command lists the files in the current directory and shows their permissions to verify that the files are copied. 5. Remove the tape from the drive and write the names of the files on the tape label. The following example copies all files from the tape in drive 0.
-f /dev/rmt/0 . winsor winsor winsor winsor winsor staff staff staff staff staff 245660 245660 181315 181309 181315 Sep Sep Sep Sep Sep 12 12 12 12 12 11:52 10:31 10:29 10:27 10:28 addusr-1.rs addusr-2.rs at-addmn.rs at-base.rs at-menu.rs
[ Team LiB ]
[ Team LiB ]
NOTE. Removable Media Manager was introduced in the Solaris 8 6/00 release.
When you start Removable Media Manager, it displays all media currently loaded into the drives. If none of the drives contain any media, nothing is displayed in the Removable Media Manager window. The different forms of devices are represented by icons and are unlimited. For example, if a system has three drives loaded with diskettes, three diskette icons are displayed, and the icon view is updated each time you insert or eject a device. Each class of media is represented by a different icon.
A device is displayed with a nickname (cdrom0), an optional volume name (SOL_8_DOC), and an optional partition or slice number (0). You can view additional information about a device and set properties. You can select one or more devices and perform operations on them, such as formatting and slicing devices, creating Solaris slices, and write-protecting a device either with or without a password.
[ Team LiB ]
1. Become superuser. 2. Type touch /reconfigure and press Return. The /reconfigure file is created. 3. Type telinit 0 and press Return to shut down the system and turn off power. 4. Connect the DVD-ROM device. 5.
NOTE. If a system has both a CD-ROM and a DVD-ROM device, the CD-ROM might be named /cdrom/cdrom0 and the DVD-ROM might be named /cdrom/cdrom1. If the system has only a DVD-ROM device, try using /cdrom/cdrom0.
1. Type ls /cdrom and press Return. The contents of the /cdrom directory are displayed. 2. Type ls /cdrom/cdrom1 (or ls /cdrom/cdrom0 if the system has no CD-ROM device) and press Return. The following example displays the contents of a DVD-ROM device.
Automatic display with the CDE file manager is not yet implemented. You can use all other CDE file manager functions, such as drag and drop for copying and imagetool features.
1. Become superuser. 2. Type mkfs -F udfs -m /dev/rdsk/ device-name and press Return. See mkfs_udfs(1M) for more information.
1. Become superuser. 2. Type mkfs -F udfs /dev/rdsk/device-name and press Return. See mkfs_udfs(1M) for more information. 3. Verify the UDF file system is created by mounting it. See "Mounting a UDF File System" on page 259 for more information.
1. Become superuser. 2. Type fsck -F udfs /dev/rdsk/ device-name and press Return. See fsck_udfs(1M) for more information.
1. Become superuser. 2. Type mount -F udfs /dev/rdsk/ device-name / mountpoint and press Return. 3.
1. 2. 3. Type ls / mountpoint and press Return to verify that the UDF file system is mounted. See mount_udfs(1M) for more information.
1. Become superuser. 2. Type labelit -F udfs /dev/rdsk/ device-name fsname volume and press Return. See labelit_udfs(1M) for more information. [ Team LiB ]
[ Team LiB ]
NOTE. If the system has the Solaris 8 10/00 or Solaris 8 01/01 release installed, Jaz or Zip drives do not work. At the time of this writing, no workaround exists. These problems are fixed in the Solaris 8 04/01 and following releases.
See "Formatting a UFS Diskette (rmformat)" on page 289 for instructions on how to use the rmformat command to format Jaz or Zip disks. You can also use Removable Media Manager to format Jaz or Zip disks. The procedure is similar to formatting diskettes. See "Using Removable Media Manager to Format Diskettes" on page 282 for more information. To access information on a Jaz or Zip drive, insert a disk into the drive. The file systems on the drive are mounted, and a File Manager window opens showing the contents, as shown in Figure 4.
Figure 4. File Manager Window with Mounted Zip Disk File Systems
You can also access the file systems on a Zip or Jaz drive from the command line with the following steps.
1.
1. Type ls /rmdisk and press Return. The default /rmdisk mount point is used for any removable media disk devices. The contents of the /rmdisk drive are displayed. 2. Type cd /rmdisk/zip or cd /rmdisk/jaz and press Return. The file systems on the Zip or Jaz drive are displayed. The following example shows the contents of a Zip disk.
mopoke% ls /rmdisk zip zip0 mopoke% cd /rmdisk/zip mopoke% ls ___Move&Rename Mail Folder Eudora Nicknames TheFindByContentFolder mopoke%
You can also use the Removable Media Manager to format, protect, and view data on removable media devices.
NOTE. If you want to create a PCFS file system without an fdisk partition, skip step 4.
1. Type rmformat -F quick device-name and press Return. 2. When prompted, type y and press Return. The disk is formatted. 3. Become superuser. 4. 5.
3. 4. Type fdisk device-name and press Return. 5. Type mkfs -F pcfs device-name and press Return. 6. When prompted, type y and press Return. A new FAT file system is created in the specified partition. The following example creates an alternative fdisk partition on /dev/rdsk/c0t4d0s2:c.
paperbark% rmformat -F quick /dev/rdsk/c0t4d0s2:c Formatting will erase all the data on disk. Do you want to continue? (y/n) y paperbark% su Password: # fdisk /dev/rdsk/c0t4d0s2:c # mkfs -F pcfs /dev/rdsk/c0t4d0s2:c Construct a new FAT file system on /dev/rdsk/c0t4d0s2:c (y/n)? y #
[ Team LiB ]
[ Team LiB ]
Writing CD Discs
You can use the cdrw command to create data and audio CDs. You can also use this command to extract audio tracks from an audio CD. The cdrw command works with any MMC-compliant CD-R or CD-RW drive. The cdrw command was initially provided starting with the Solaris 8 Update 2 (10/00) release on the separate Software Supplement CD for the Solaris 8 Operating Environment. Starting with the Solaris 9 release, the cdrw command is included in the Solaris 9 release and is available when you install the SUNWcdrw package. Table 64 lists the options to the cdrw command.
-b all | session Blank a CD-RW disc. You must specify the type of erasing by specifying the all or session argument. -c Copy a CD. If you specify no other argument, the default CD writing device is assumed to be the source device as well. In this case, the copying operation reads the source CD into a temporary directory and prompts you to put a blank CD into the drive for copying to proceed. Use the CD stated capacity. Without this option, cdrw uses a default value for writable discs, which is 74 minutes for an audio CD or 681,984,000 bytes for a data CD. Specify CD writing device. Help. Print usage message. Specify an image file for creating data CDs. The file size should be less than what can be written on a CD-R or CD-RW disc, which is 681,984,000 bytes by default or the CD stated capacity when you use the -C option. Also, it is better to have the file locally available instead of having it on an NFS-mounted file system because the CD writing process expects data to be available continuously without interruptions.
-C -d -h -i
Option -l -m
Description List all the CD writers found in the system. Use an alternative temporary directory instead of the system default temporary directory for storing track data while copying a CD. You might use an alternative temporary directory because the amount of data on a CD can be huge (as much as 800 Mbytes for an 80-minute audio CD) and the system default temporary directory might not have that much space. Report CD status. cdrw reports whether the disc is blank; if not, cdrw reports the table of contents, the last session's start address, and the next writable address if the disc is open. Keep the disc open. cdrw closes the session, but it keeps the disc open so that another session can be added later to create a multisession disc. Set the CD writing speed. For example, -p 4 sets the speed to 4X. If you do not specify this option, cdrw uses the default speed of the CD writer. If you specify this option, cdrw tries to set the drive write speed to this value, but the speed actually used by the drive is not guaranteed. Specify the source device for copying to the CD. Operate in simulation mode. In this mode, cdrw does everything with the drive laser turned off, so nothing is written to the CD. You can use this option to verify that the system can provide data at a rate good enough for CD writing. Specify the audio format to use extracting audio files or reading audio files for audio CD creation. The audio type can be sun, wav, cda, or aur. Use verbose mode. Extract audio data from an audio track.
-M -O -p
-s -S
-T -v -x
See the cdrw(1) manual page for more information about this command. [ Team LiB ]
[ Team LiB ]
Volume Management
Starting with the Solaris 2.2 system software, volume management automates mounting of CD-ROMs and diskettes; users no longer need to have superuser permissions to mount a CD-ROM or a diskette.
CAUTION. The Solaris 2.0 and 2.1 procedures for mounting CD-ROMs and diskettes do not work for Solaris 2.2 and later releases. Volume management controls the /dev/dsk/c0t6d0s2 path to a CD-ROM drive and the /dev/diskette path to the diskette drive. If you try to access a CD-ROM or diskette and specify these paths, an error message is displayed.
Volume management provides users with a standard interface for dealing with diskettes and CDROMs. Volume management provides three major benefits. Automatically mounting diskettes and CDs simplifies their use. Users can access diskettes and CDs without having to become superuser. Users on the network can gain automatic access to diskettes and CDs mounted on remote systems. Mounting devices manually requires the following steps.
1. Insert medium. 2. Become superuser. 3. Determine the location of the medium device. 4. Create a mount point. 5. Make sure the current working directory is in the mount point directory. 6. Mount the device using the proper mount options. 7. Exit the superuser account. 8. Work with files on the medium. 9. Become superuser. 10. Unmount the medium device. 11. 12.
9. 10. 11. Eject medium. 12. Exit the superuser account. Using volume management requires the following steps.
1. Insert medium. 2. For diskettes, use the volcheck command. 3. Work with files on the medium. 4. Eject medium.
# ident "@(#)vold.conf 1.26 # # Volume Daemon Configuration file # # Database to use (must be first) db db_mem.so
00/07/17 SMI"
# Labels supported label cdrom label_cdrom.so cdrom label dos label_dos.so floppy rmdisk pcmem label sun label_sun.so floppy rmdisk pcmem # Devices to use use cdrom drive /dev/rdsk/c*s2 dev_cdrom.so cdrom%d use floppy drive /dev/rdiskette[0-9] dev_floppy.so floppy%d use pcmem drive /dev/rdsk/c*s2 dev_pcmem.so pcmem%d forceload=true use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d
# Actions eject dev/diskette[0-9]/* user=root /usr/sbin/rmmount eject dev/dsk/* user=root /usr/sbin/rmmount insert dev/diskette[0-9]/* user=root /usr/sbin/rmmount insert dev/dsk/* user=root /usr/sbin/rmmount notify rdsk/* group=tty user=root /usr/lib/vold/volmissing -p remount dev/diskette[0-9]/* user=root /usr/sbin/rmmount remount dev/dsk/* user=root /usr/sbin/rmmount # List of file system types unsafe to eject unsafe ufs hsfs pcfs udfs
If a system has additional diskette drives, volume management automatically creates two subdirectories in /vol/dev for each additional driveone to provide access to the file systems and the other to provide access to the raw device. For a second diskette drive, volume management creates directories named diskette1 and rdiskette1. For a third diskette drive, it creates directories named diskette2 and rdiskette2 (and so on for additional drives). The syntax for a Devices to use entry is shown below.
Volume management does not automatically mount DVD devices. Table 66 describes each of the fields for the Devices to use syntax.
Description Location of the code that manages the device. The symbolic name that refers to this device. The symname is placed in the device directory: either /cdrom or /floppy). The user, group, and mode permissions for the inserted media.
options
# ident "@(#)rmmount.conf 1.12 00/08/29 SMI" # # Removable Media Mounter configuration file. # # File system identification ident udfs ident_udfs.so cdrom floppy rmdisk ident hsfs ident_hsfs.so cdrom ident ufs ident_ufs.so cdrom floppy rmdisk pcmem ident pcfs ident_pcfs.so floppy rmdisk pcmem # Actions action cdrom action_filemgr.so action floppy action_filemgr.so action rmdisk action_filemgr.so # Mount mount * hsfs udfs ufs -o nosuid
castle% ls -1 /usr/lib/vold db_mem.so.1 db_nis.so.1 dev_cdrom.so.1 dev_cdtest.so.1 dev_floppy.so.1 dev_pcmem.so.1 dev_rmdisk.so.1 dev_test.so.1 eject_popup label_cdrom.so.1 label_dos.so.1 label_sun.so.1 label_test.so.1 volcancel volmissing volmissing_popup volstat castle%
If you encounter problems with volume management, check the /var/adm/vold.log file for information. An example of this file is shown below.
oak% more /var/adm/vold.log Tue Jun 1 17:34:24 1999 warning: dev_use: couldn't find a driver for drive cdrom at /dev/dsk/c0t6 Tue Jun 1 17:39:12 1999 warning: dev_use: couldn't find a driver for drive cdrom at /dev/dsk/c0t6 Tue Jun 1 18:24:24 1999 warning: dev_use: couldn't find a driver for drive cdrom at /dev/dsk/c0t6 Wed Jun 23 15:08:47 1999 warning: check device 36.2: device not managed Wed Jun 23 15:09:58 1999 warning: check device 36.2: device not managed Wed Jun 23 15:11:08 1999 warning: check device 36.2: device not managed Thu Jul 15 13:51:23 1999 warning: check device 36.2: device not managed Thu Jul 15 13:52:53 1999 warning: check device 36.2: device not managed Thu Jul 15 14:04:37 1999 warning: check device 36.2: device not managed Thu Jul 15 14:05:52 1999 warning: check device 36.2: device not managed Thu Jul 15 14:06:16 1999 warning: check device 36.2: device not managed Wed Jul 21 16:33:33 1999 fatal: svc_tli_create: Cannot create server handle Thu Jul 22 16:32:28 1999 warning: cdrom: /dev/rdsk/c0t6d0s2; Device busy castle%
If you want to display debugging messages from the volume management daemon, you can start the daemon by typing /usr/sbin/vold -v -L 10. With these flags set, the volume management daemon logs quite a bit of information in /var/adm/vold.log. Another way to gather debugging information is to run the rmmount command with the debug flag. To do so, edit /etc/vold.conf and change the lines with /usr/sbin/rmmount in them to include the -D flag, as shown in the following example.
From the command line, type volcheck and press Return. From the CDE front panel, click on the Folders menu and then click on Open Floppy. From the CDE File Manager File menu, choose Open Floppy. From the OpenWindows File Manager File menu, choose Check for Floppy. When you use any of these methods, the files are mounted on the /floppy mount point. Table 67 describes the mount points and how volume management uses them.
If the medium does not contain a file system, volume management provides block and character devices in the /vol file system, as shown in Table 68.
Table 68. CD-ROM and Diskette Device Locations When No File System Is Present
State of Medium
/vol/dev/rdiskette0/unnamed_floppy Formatted unnamed disketteraw device access. /vol/dev/diskette0/unlabeled CD-ROM /vol/dev/dsk/c0t6d0/unnamed_cdrom CD-ROMblock device access. Unlabeled disketteblock diskette device access.
1. Push the button on the front of the CD-ROM drive to open the tray. 2. Place the CD-ROM into the tray so that the CD label is visible. Volume management creates a subdirectory on the /cdrom mount point, using the label written on the CD-ROM, or creates an unlabeled subdirectory if the CD-ROM doesn't have a label. Then volume management mounts the file system on the CD on that subdirectory. If File Manager is running, a window displays the contents of the CD-ROM, as shown in Figure 5.
3. To access files on the CD-ROM from a command line, type cd /cdrom/cdrom0 and press Return. 4. Type ls -L and press Return. The list of files in the /cdrom/cdrom0 directory is displayed. Use the -L option because some of the files on the CD may be symbolic links. You can use the File Manager CD-ROM window and the command line interchangeably. For example, you can eject a CD-ROM either from a command line by typing eject cdrom or by choosing Eject from the File menu in the File Manager CD-ROM window.
1. Become superuser. 2. Type ps -ef | grep nfsd and press Return. Review the output to determine whether the NFS daemon (nfsd) is running. If nfsd is running, skip to Step 7. 3. Type mkdir / dummy-dir and press Return. You have created a dummy directory for nfsd to share. You can use any directory name. This directory will not contain any files. Its sole purpose is to wake up the NFS daemon so that it notices the shared media drive. 4.
4. Add the following entry to the /etc/dfs/dfstab file. share -F nfs -o ro [-d comment] / dummy-dir When you start the NFS daemon, it sees this entry, wakes up, and notices the shared media drive. The -d comment is optional. 5. Type /etc/init.d/nfs.server start and press Return. NFS services are restarted. 6. Type ps -ef | grep nfsd and press Return. Review the output to verify that the NFS daemon (nfsd) is running. 7. Type eject medium and press Return. You have ejected any medium currently in the drive. 8. Type chmod 644 /etc/rmmount.conf and press Return. You have assigned root write permissions to the /etc/rmmount.conf file. 9. Add the following lines to the /etc/rmmount.conf file.
These lines share any medium loaded into your system's CD-ROM drive. You can, however, limit sharing to a particular CD or series of CDs, as described in share(1M). 10. Type chmod 444 /etc/rmmount.conf and press Return. You have removed write permissions from the /etc/rmmount.conf file and returned the file to its default permissions. 11. Load the medium. Any medium loaded into this system's drive is available to other systems. Remember to wait until the light on the drive stops blinking before you verify this task. 12. Type share and press Return. Review the output and verify that the medium is shared.
12.
The following example makes a local CD available to other systems on the network when the nfsd daemon is not running.
# ps -ef | grep nfsd # # mkdir /dummy # vi /etc/dfs/dfstab (Add the following line:). share -F nfs -o ro /dummy # eject /cdrom/cdrom0 # chmod 644 /etc/rmmount.conf # vi /etc/rmmount.conf (Add the following line to the FIle System Sharing section) share cdrom* # chmod 444 /etc/rmmount.conf # /etc/init.d/nfs.server start # ps -ef | grep nfsd root 577 1 0 10:51:55 ? 0:00 /usr/lib/nfs/nfsd # share /dummy ro "" #
The following example uses the ps command to verify that the mountd daemon is not already running, and if you are superuser, it runs the S15nfs.server script to stop NFS services and restart them.
oak% ps -ef | grep mountd root 4571 4473 5 12:53:51 pts/3 oak% su Password: # /etc/rc3.d/S15nfs.server stop # /etc/rc3.d/S15nfs.server start #
You can use the /mnt directory as the mount point for the CD-ROM files, or you can create another directory.
NOTE. Do not use the /cdrom mount point to mount NFS file systems. Volume management may interfere with accessing files on the volume management /cdrom mount point.
When the CD-ROM is in the remote drive and the files are shared by NFS, use the following steps to access the shared files on a local system.
1. On the local system, become superuser. 2. All on one line, type mount -F nfs -o ro nfs-server:/cdrom/cdrom0 / mount-point and press Return. The files from the remote system directory /cdrom/cdrom0 are mounted on the / mount-point directory. The cdrom0 subdirectory is symbolically linked to the actual name of the CD-ROM that has a name assigned by the application vendor. The following example mounts the files from the remote system castle on the /mnt mount point.
oak% su Password: # mount -F nfs -o ro castle:/cdrom/cdrom0 /mnt # cd /mnt # ls SUNWssser SUNWsssra SUNWsssrb SUNWsssrc SUNWsssrd #
SUNWssstr
1. On the local system, become superuser. 2. Type cd and press Return. 3. Type umount / mount-point and press Return.
2. 3. The files from the remote system directory /cdrom/cdrom0 are unmounted.
1. Become superuser. 2. Type fuser -u /cdrom/cdrom0 and press Return. The process ID and user name of those currently accessing the CD are displayed. 3. Type fuser -u -k /cdrom/cdrom0 and press Return. The processes accessing the CD are killed. 4. Type eject cdrom and press Return, or choose Eject from the File menu in the CD File Manager window. In the following example, user winsor is accessing the CD.
paperbark% eject cdrom /vol/dev/rdsk/c0t6d0/s8ap_doc: Device busy paperbark% su Password: # fuser -u /cdrom/cdrom0 /cdrom/cdrom0: 467c(winsor) # fuser -u -k /cdrom/cdrom0 # eject cdrom # exit paperbark%
UFS formats are not portable between architectures, so you must use them on the architecture for which they were formatted. For example, a UFS diskette formatted for a SPARC platform cannot be recognized by an IA platform. Likewise, an IA UFS diskette cannot be mounted by volume management on a SPARC platform. The same limitation applies to CDs. UFS incompatibility can occur more often with diskettes than with CDs because formats often can be established by the user. Be aware that if you format a UFS diskette on one architecture, you won't be able to use it on a different architecture.
The rmformat command, introduced in the Solaris 8 release, was buggy. The bugs in rmformat are fixed in the Solaris 9 release, and rmformat is preferred command for formatting removable media. Use the following steps to format a diskette from a command line with the rmformat command.
NOTE. If the diskette does not have a file system written on it, the volcheck command accesses the device. However, if the diskette already has a file system on it, you cannot use the volcheck command to mount the file system on the diskette. rmformat requires an unmounted diskette for formatting.
1. Insert a diskette into the diskette drive. 2. Type rmformat -F quick floppy0 and press Return to format and partition the diskette. Use fdformat -d to format an MS-DOS file system. rmformat does not provide an MS-DOS formatting option. 3. When prompted, type y and press Return to begin formatting the diskette. When formatting is complete, the prompt is redisplayed. The rmformat command automatically creates a new file system on the diskette. The following example formats a diskette on a system running volume management.
mopoke% rmformat -F quick floppy0 Formatting will erase all the data on the disk. Do you want to continue? (y/n) y mopoke%
NOTE. Starting with the Solaris 8 release, fdformat has been superseded by the rmformat(1) command, which provides most fdformat functionality.
Use the following steps to format a diskette from a command line with the fdformat command.
1. Insert a diskette into the diskette drive. 2. Type volcheck and press Return. The system has access to the unformatted diskette. 3. Type fdformat and press Return to format the diskette so that you can later write a UFS file system on it, or fdformat -d to format a diskette and immediately write an MS-DOS file system to it. 4. When prompted, press Return to begin formatting the diskette. 5. For UFS file systems, you must also make a new file system on the diskette. To do so, become superuser and type newfs /vol/dev/rdiskette0/unnamed_floppy, and press Return. Use the following steps to access files on a formatted diskette.
1. Insert a formatted diskette in the diskette drive. 2. Type volcheck and press Return. If there is a formatted diskette in the drive, volume management mounts it on a subdirectory of the /floppy mount point. If no diskette is in the drive, no error message is displayed. The volcheck command redisplays the prompt. When the diskette is mounted on the /floppy subdirectory mount point, you can access files on it either from the command line or from the File Manager Floppy window, described in "CDE File Manager Access" on page 281. 3. Type cd /floppy and press Return. 4. Type ls and press Return. The name of the diskette is displayed. 5. Type cd diskette-name and press Return. 6.
5. 6. Type ls and press Return. The names of the files on the diskette are displayed. You can copy files to and from the diskette with the cp command. In the following example, the diskette is not mounted, so the only directory in /floppy is ms-dos_5. After volcheck mounts the diskette, the directory with the name of the diskette is displayed. The diskette in this example contains only a lost+found directory.
oak% cd /floppy oak% ls ms-dos_5 oak% volcheck oak% ls ms-dos_5 unnamed_floppy oak% cd unnamed_floppy oak% ls lost+found oak% cp /home/winsor/Appx/appxA.doc . oak% ls appxA.doc lost+found oak%
1. Become superuser. 2. Type fuser -u /floppy/floppy0 and press Return. The process ID and user name of those currently accessing the diskette are displayed. 3. Type fuser -u -k /floppy/floppy0 and press Return. The processes accessing the diskette are killed. 4. Type eject floppy0 and press Return.
4.
NOTE. On a SPARC platform, the diskette is physically ejected from its drive. On an IA platform, you have to eject the diskette by hand. If you are running on an IA platform, look for a message on screen that says you can now eject the diskette. If the diskette jams, eject it manually by inserting a straightened paper clip about an inch into the small hole in the front of the drive.
Ejecting a Diskette
Use the following steps to eject the diskette.
1. Type cd and press Return. You have changed out of the /floppy directory. 2. Type eject and press Return. After a few seconds, the diskette is ejected from the drive.
1. Insert a formatted or unformatted diskette into the diskette drive. 2. From the front panel, open the Folders menu, shown in Figure 6, and click on Open Floppy.
3. If the diskette is unformatted, the Format Floppy window is displayed, as shown in Figure 7.
4. Choose the format, type a diskette name in the text field if you want to assign one, and click the Format button. The diskette is formatted and a new file system is created. When the diskette is formatted and contains the file system, the File Manager Floppy window displays the contents of the diskette.
The floppy is mounted to a subdirectory of the /floppy directory and a File Manager window opens. If the diskette is already formatted, after the light on the front panel stops flashing (about 5 to 10 seconds), the floppy is mounted to a subdirectory of the /floppy directory and a File Manager window opens. Figure 8 shows an example of the File Manager floppy window for a formatted diskette.
1. Insert a formatted or unformatted diskette into the diskette drive. 2. From the File Manager File menu, shown in Figure 9, choose Open Floppy.
If the disk is unformatted, the Format Floppy window is displayed. If the disk is formatted, the File Manager window display shows the contents of the diskette. 3. From the File Manager File menu you can also eject, format, and rename the diskette, as shown by the menu items in Figure 10.
You can use the Removable Media Manager graphical user interface to create the following formats and file systems on a diskette. PCFS (DOS). UFS (UNIX). UDFS. NEC DOS. You can format an unformatted diskette or reformat a formatted diskette.
Use the following steps to format a diskette with Removable Media Manager.
1. Insert the diskette you want to format in the diskette drive. 2. Choose Open Floppy from the CDE Front Panel Files menu, or, in a Terminal window, type volcheck and press Return. The command checks the diskette drive and mounts a formatted diskette if found. If volume management finds an unformatted diskette in the drive, the diskette is not mounted. Instead, it is made visible as a raw device to the Removable Media Manager, as indicated by the (...unformatted) message and a dash (-) instead of the normal number used to indicate which instance of the diskette is mounted. 3. From the CDE Front Panel Files menu, choose Removable Media Manager. The Removable Media Manager window opens and displays any mounted media on the system. In the example shown in Figure 11, an unformatted diskette is the only available medium.
4. Click on the diskette icon. The diskette is highlighted to show that you selected it. 5. From the Selected menu, choose Format. The Media Format window is displayed, as shown in Figure 12.
6. Choose the file system type from the File System Type menu. 7. 8.
6. 7. (Optional) Type a label in the Volume Label field if you want to assign a name to the device. 8. Click on the Format button. The diskette icon is removed from the Removable Media Manager window, and the Format button in the Format window is dimmed. No other status information is displayed while the diskette is formatting. When the diskette is formatted, a notice is displayed, as shown in Figure 13.
The icon in the Removable Media Manager window is updated to show the new format and volume name (if assigned), as shown in Figure 14.
/vol/dev/aliases/floppy0
Use the following steps to create a tar archive that contains a single file.
1. Insert a formatted diskette into the diskette drive. 2. Type volcheck and press Return. 3. Type tar cvf /vol/dev/aliases/floppy0 filename and press Return. The files are copied to the diskette. 4. Type eject and press Return. After a few seconds, the diskette is ejected. Use the following steps to copy all tar files from a diskette.
1. Insert a formatted diskette into the diskette drive. 2. Change to the directory into which you want to put the files. 3. Type volcheck and press Return. Volume manager creates the proper device files under /vol/dev so that you can access the raw device. 4. Type tar xvf /vol/dev/aliases/floppy0 and press Return. The files are extracted from the raw tar datastream on the diskette. 5. Type eject and press Return. After a few seconds, the diskette is ejected. Alternatively, with Solaris 2.2 (and later) systems, you can access tar or cpio files by using the following device name syntax.
/vol/dev/rfd0/media-name
The most common media-name is unlabeled. With Solaris 2.3, the device name syntax is changed. You access tar or cpio files with the following device name syntax.
/vol/dev/rdiskette0/ media-name
The most frequent media-name for media without a file system is unlabeled. For example, to put files into a tar archive that is sent as a raw datastream to the raw diskette device, type tar cvf /vol/dev/rdiskette0/unlabeled filename and press Return. To read a raw tar archive datastream from the raw diskette device and extract the files it contains, type tar xvf /vol/dev/rdiskette0/unlabeled and press Return.
# ident "@(#)rmmount.conf
1.12
00/08/29 SMI"
# # Removable Media Mounter configuration file. # # File system identification ident udfs ident_udfs.so cdrom floppy rmdisk ident hsfs ident_hsfs.so cdrom ident ufs ident_ufs.so cdrom floppy rmdisk pcmem ident pcfs ident_pcfs.so floppy rmdisk pcmem # Actions action cdrom action_workman.so pathname action cdrom action_filemgr.so action floppy action_filemgr.so action rmdisk action_filemgr.so # Mount mount * hsfs udfs ufs -o nosuid
A pathname is the name of the path by which users access the workman programfor example, /usr/dist/exe/workman. When you have made this change, audio CD-ROMs are automatically detected and the workman program is started when an audio CD-ROM is inserted into the CD-ROM drive.
NOTE. When you set up workman in the way described here, you should not try to start workman from the application because volume management may become confused. In addition, with Solaris 2.2 (and later) volume management, if you are using workman, you must eject the CD-ROM from the workman application. If you eject the CD-ROM from another window, workman hangs. This problem is fixed in Solaris 2.3 and later system software.
1. Become superuser. 2. Remove or rename the /etc/rc2.d/S92volmgt script. 3. Type /etc/init.d/volmgt stop and press Return. You can disable part of volume management and leave other parts functional. You may, for example,
3.
want to automatically mount CD-ROMs but use the Solaris 2.0 method for accessing files on a diskette. You can do so by commenting out the lines for diskettes in the /etc/vold.conf file, as shown below.
# ident "@(#)vold.conf 1.26 # # Volume Daemon Configuration file # # Database to use (must be first) db db_mem.so
00/07/17 SMI"
# Labels supported label cdrom label_cdrom.so cdrom label dos label_dos.so floppy rmdisk pcmem label sun label_sun.so floppy rmdisk pcmem # Devices to use use cdrom drive /dev/rdsk/c*s2 dev_cdrom.so cdrom%d # use floppy drive /dev/rdiskette[0-9] dev_floppy.so floppy%d use pcmem drive /dev/rdsk/c*s2 dev_pcmem.so pcmem%d forceload=true use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d # Actions eject dev/diskette[0-9]/* user=root /usr/sbin/rmmount eject dev/dsk/* user=root /usr/sbin/rmmount insert dev/diskette[0-9]/* user=root /usr/sbin/rmmount insert dev/dsk/* user=root /usr/sbin/rmmount notify rdsk/* group=tty user=root /usr/lib/vold/volmissing -p remount dev/diskette[0-9]/* user=root /usr/sbin/rmmount remount dev/dsk/* user=root /usr/sbin/rmmount # List of file system types unsafe to eject unsafe ufs hsfs pcfs udfs
[ Team LiB ]
[ Team LiB ]
The rmformat command, introduced in the Solaris 8 release, was buggy. The bugs to rmformat are fixed in the Solaris 9 release, and rmformat is the preferred command for formatting removable media. Use the following steps to format a diskette by using the rmformat command from a command line.
NOTE. Do not use the volcheck command to mount the diskette. rmformat requires an unmounted diskette for formatting.
1. Insert a diskette into the diskette drive. 2. Type rmformat -F quick /dev/rdiskette and press Return to format the diskette. 3.
1. 2. 3. When prompted, type y and press Return to begin formatting the diskette. When formatting is complete, the prompt is redisplayed. The following example formats a diskette on a system not running volume management.
mopoke% rmformat -F quick /dev/rdiskette Formatting will erase all the data on the disk. Do you want to continue? (y/n) y mopoke%
NOTE. Starting with the Solaris 8 release, fdformat has been superseded by the rmformat(1) command, which provides most fdformat functionality.
Use the following steps to format a diskette for use with Solaris UFS file systems.
1. Check the diskette to make sure that it is not write-protected. 2. Put the diskette in the drive.
CAUTION. Reformatting destroys any files already on the diskette. 3. Type fdformat and press Return. The message Press return to start formatting floppy is displayed. 4. Press Return. While the diskette is being formatted, a series of dots (...) is displayed. When formatting is complete, the prompt is redisplayed.
NOTE. If the drive jams, you can eject a diskette manually by inserting a straightened wire paper clip into the pinhole under the diskette slot.
To eject a CD-ROM disc from a CD-ROM drive, type eject cdrom and press Return.
1. Change to the directory that contains the file(s) you want to copy. 2. Insert a write-enabled formatted diskette into the drive.
CAUTION. Copying files to a formatted diskette with the c option destroys any files already on the diskette. If you want to preserve the files already on the diskette, use the r option described in "Appending Files to a Formatted Diskette (tar)" on page 291.
3. Type tar cvf /dev/rdiskette filename filename filename... and press Return. The file names you specify are copied to the diskette, overwriting any existing files on the
3.
diskette.
NOTE. You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file-name argument. 4. Type eject and press Return to remove the diskette from the drive. The diskette is ejected from the drive. 5. Write the names of the files on the diskette label. The following example copies two files to a diskette.
oak% cd /home/winsor oak% ls evaluation* evaluation.doc evaluation.doc.backup oak% tar cvf /dev/rdiskette evaluation* a evaluation.doc 86 blocks a evaluation.doc.backup 84 blocks oak% eject oak%
1. Insert a diskette into the drive. 2. Type tar tvf /dev/rdiskette and press Return. The t option lists the table of contents for the files on the diskette. In the following example, the table of contents for the diskette contains two files.
oak% tar tvf /dev/rdiskette rw-rw-rw-6693/10 44032 Apr 23 14:54 2000 evaluation.doc
rw-rw-rw-6693/10 oak%
See the tar(1) manual page for more information. If you need a multiple-volume interchange command, use cpio. The tar command is only a singlevolume command.
1. Change to the directory that contains the file you want to copy. 2. Insert a write-enabled formatted diskette into the drive. 3. Type tar rvf /dev/rdiskette filename filename filename... and press Return. The file names you specify are appended to the files already on the diskette.
NOTE. You can use metacharacters (? and *) as part of the file names you specify. For example, to copy all documents with a .doc suffix, type *.doc as the file-name argument. 4. Type eject and press Return to remove the diskette from the drive. The diskette is ejected from the drive. 5. Write the names of the additional files on the diskette label. The following example appends one file to the files already on the diskette.
oak% cd /home/winsor oak% tar rvf /dev/rdiskette a junk 1 blocks oak% tar tvf /dev/rdiskette rw-rw-rw-6693/10 44032 Apr rw-rw-rw-6693/10 43008 Apr rw-rw-rw-6693/10 18 Dec
junk
1. Change to the directory into which you want to put the files. 2. Insert the diskette into the drive. 3. Type tar xvf /dev/rdiskette and press Return. All the files on the diskette are copied to the current directory. 4. Type eject and press Return to remove the diskette from the drive. The diskette is ejected from the drive. The following example copies all files from the diskette.
oak% cd /home/winsor/Evaluations oak% tar xvf /dev/rdiskette x evaluation.doc, 44032 bytes, 86 tape blocks x evaluation.doc.backup, 43008 bytes, 84 tape blocks oak% eject oak%
To retrieve individual files from a diskette, type tar xvf /dev/rdiskette filename filename filename... and press Return. The file names you specify are extracted from the diskette and placed in the current working directory. The following example copies all files with the prefix evaluation from the diskette.
oak% cd /home/winsor/Evaluations oak% tar xvf /dev/rdiskette x evaluation.doc, 44032 bytes, 86 tape blocks x evaluation.doc.backup, 43008 bytes, 84 tape blocks
NOTE. You can use the -H bar option with -i to retrieve files only. You cannot create files with the bar header option. It is good practice to list the contents of an archive before extracting them.
1. Change to the directory into which you want to put the files. 2. Insert the diskette that contains bar files into the drive. 3. Type cpio -ivH bar < /dev/diskette and press Return. All the files on the diskette are copied to the current directory. 4. Type eject and press Return to remove the diskette from the drive.
1. 2. Become superuser. 3. Type newfs /dev/rdiskette and press Return. A UFS file system is created on the formatted diskette, as shown in the following example.
oak% fdformat Press return to start formatting floppy. ................................................................................ oak% su Password: # newfs /dev/rdiskette #
NOTE. Starting with the Solaris 8 release, fdformat has been superseded by the rmformat(1) command, which provides most fdformat functionality. However, the rmformat command does not provide an option for formatting PCFS file systems.
Use the following steps to format a diskette with the PCFS file system.
2. Type fdformat -d and press Return. The message Press return to start formatting floppy is displayed. 3. Press Return. While the diskette is being formatted, a series of dots (...) is displayed. When formatting is complete, the prompt is redisplayed, as shown in the following example.
1. Insert the PCFS diskette in the drive. 2. Become superuser. 3. Type mount -F pcfs /dev/diskette mount-point and press Return. The file system is mounted on the mount-point you specify. You can mount a PCFS file system with different mount options (for example, -o rw). See the mount_pcfs(1M) manual page for a description of the options that can be included in the list. If you use PCFS diskettes frequently, you may want to add the following entry to your /etc/vfstab file.
/dev/diskette -
/pcfs
pcfs
no
rw
Create a directory named /pcfs to use as the mount point for the diskette. With the mount point and the entry in the /etc/vfstab file, you can mount a PCFS diskette by becoming superuser and typing mount /pcfs and pressing Return. Once the diskette is mounted, you can use any of the Solaris file commands such as cp or mv to copy files to and from the diskette.
[ Team LiB ]
[ Team LiB ]
Administering Disks
The following sections describe the Solaris disk-naming conventions, commands for finding disk information (du, prtvtoc), and ways to repair or replace a bad disk.
Disk-Naming Conventions
Solaris disks have both block and raw (character) device files. The device name is the same, regardless of whether the command requires the block or raw device file. Each type of device file has its own subdirectory in /dev: /dev/dsk (the block interface) or /dev/rdsk (the raw interface). Some commands, such as mount, use the block interface device name from the /dev/dsk directory to specify the disk device. Other commands, such as newfs, require the raw interface device name from the /dev/rdsk directory to specify the disk device. Raw device interfaces transfer only small amounts of data at a time. To use a raw device, you specify the device in the /dev/rdsk subdirectory. The r in rdisk stands for raw. Block device interfaces include a buffer from which large blocks of data are read at one time. When a command requires the block device interface, you specify the /dev/dsk subdirectory. The device name you use to identify a specific disk with either type of interface depends on the controller type: bus-oriented (SCSI) or direct. You refer to a disk device by specifying the subdirectory to which it is symbolically linked (either /dev/dsk or /dev/rdsk) followed by a string identifying the particular controller, disk, and slice.
/dev/[r]dsk/cwtxdysz
cw is the controller number, tx is the target number, dy is the drive number, and sz is the slice identifier. For SCSI drives, the drive number is the equivalent of the Logical Unit Number (LUN) of the drive. Table 69 shows which interface to use for a few frequently used disk and file system commands.
Table 69. Device Interface Type for Some Frequently Used Commands
Command df(1M) fsck mount(1M) newfs(1M) Interface Type Block Raw Block Raw df /dev/dsk/c0t1d0s0 fsck -p /dev/rdsk/c0t0d0s0 mount /dev/dsk/c1t0d0s7 /export/home newfs /dev/rdsk/c0t0d1s1 prtvtoc /dev/rdsk/c0t0d0s2 Example
prtvtoc(1M) Raw
Figure 15. Naming Conventions for SPARC Disks with Bus Controllers
Each file system on a disk is assigned to a slicea group of cylinders set aside for use by that file
system. To specify a slice (partition) on a disk with a bus controller (either SCSI or IPI), use a device name with these conventions: /dev/dsk/cWtXdYsZ (the block interface) or /dev/rdsk/cWtXdYsZ (the raw interface).
NOTE. Solaris disk device names use the term slice (and the letter s in the device name) to refer to the slice number. Slice is simply another name for a disk partition.
Use the following guidelines to determine the values for the device file name. If you have only one controller on your system, W is always 0. For SCSI controllers, X is the target address set by the switch on the back of or inside the unit. Y is the Logical Unit Number (LUN) of the drive attached to the target. If the disk has an embedded controller, Y is always 0. Z is the slice (partition) number, with a value ranging from 0 to 7. Slice 2 is known as the backup slice and should never be used directly. Table 70 shows conventional assignments of slice (partition) numbers for the disk on which root is found.
Table 71 shows some examples of raw device names for disks with bus-oriented controllers.
Table 71. Examples of Device Names for Disks with Bus-Oriented Controllers
Device Name Description
/dev/rdsk/c0t0d0s0 Raw interface to the first slice (root) on the first LUN (disk) at the first SCSI target address on the first controller.
Device Name
Description
/dev/rdsk/c0t0d0s2 Raw interface to the third LUN (which represents the whole disk) on the first disk at the first SCSI target address on the first controller. /dev/rdsk/c0t1d0s6 Raw interface to seventh (/usr) slice on the first LUN (disk) at the second SCSI target address on the first controller.
NOTE. In releases before the Solaris 7 Operating Environment, SCSI support on the Intel platform was handled by the cmdk driver. Starting with the Solaris 7 release, this support is handled by the sd driver. This driver is similar to the SCSI disk driver on Solaris SPARC platforms, which is also named sd. There is no change in the administration of these devices. You will see references to sd instead of cmdk in the output of the prtconf, sysdef, dmesg, and format commands. Features and functionality are a superset of the features supplied by cmdk, so applications that use logical disk names in /dev/dsk are not affected by the driver change. IA systems with IDE devices still use the cmdk driver.
Figure 17. Naming Conventions for SPARC-Based Disks with Direct Controllers
Figure 18 shows the naming convention for IA-based disks with direct controllers.
Figure 18. Naming Conventions for IA-Based Disks with Direct Controllers
Description Hold files and directories that make up the operating system. Provide virtual memory or swap space. By convention, refer to the entire disk. The entire disk is defined automatically by the format command and the Solaris installation programs. Do not change the size of this slice. Hold applications software added to a system. If a slice is not allocated for this file system during installation, the /opt directory is merged into the slice that contains the root (/) file system. Hold operating system commandsalso known as executablesdesigned to be run by users. This slice also holds documentation, system programs such as init and syslogd, and library routines. If a slice is not allocated for this file system during installation, the /usr directory is merged into the slice that contains the root (/) file system.
/opt
Both
/usr
Both
IA Disk Slices
On IA-based systems, you divide disks into fdisk partitions. Each fdisk partition is a section of the disk reserved for a particular operating environment. For a Solaris fdisk partition, you can define 10 slices, numbered from 0 through 9 and assign each to a conventional use. The uses for slices 02 and 57 are the same as on Solaris systems, described in Table 73. Table 74 describes slices 8 and 9.
Slice 8 9
Description Contain the boot slice information at the beginning of the Solaris partition that enables Solaris to boot from the hard disk. Provide an area reserved for alternative disk blocks. Slice 9 is known as the alternative sector slice.
When you set up file systems for a disk, you choose not only the size of each slice but also which slices to use. Your decisions depend on the configuration of the system and the software you want to install on the disk. System types are defined by how they access the root (/) and /usr file systems, including the swap area. For example, stand-alone and server systems mount these file systems from a local disk; other clients mount the file system remotely. In previous releases, you could set up the following five system configurations. Servers. Diskless clients. Stand-alone systems. Dataless clients. Solstice AutoClient systems. With the Solaris 8 release, the system configurations are simplified to servers, stand-alone systems, and JavaStations. The JavaStation is a client designed for zero administration. It optimizes Java technology and takes full advantage of the network to deliver everything from Java applications and services to complete, integrated system and network management. You do no local administration for a JavaStation. The server handles booting, administration, and data storage. Table 75 summarizes the three system types.
SMC provides two tools in the Storage category, described in Table 76, that you can use to display and format disks.
Enhanced Storage
oak% du 2913 639 347 1998 607 38 2004 6593 13280 oak%
The output is displayed in 512-byte blocks. To convert to megabytes, divide by 2048. In the preceding example, 13280/2048 = 6.48 Mbytes. Starting with the Solaris 9 release, the du command has an -h option that you can use to display the output in a user-friendly format, as shown in the following example.
mopoke% 2K 1K 2K 1K 1K 19K 20K 11K 17K 1K 1K 1K 1K 2K 56K 1K 2K 2K 17K 1K 1K 2K 331K 1K 1.1G mopoke%
du -h ./.dt/sessionlogs ./.dt/types/fp_dynamic ./.dt/types ./.dt/icons ./.dt/appmanager ./.dt/help/winsor-mopoke-0 ./.dt/help ./.dt/sessions/current ./.dt/sessions ./.dt/tmp ./.dt/Trash ./.dt/Desktop ./.dt/palettes ./.dt/.Printers ./.dt ./.java/.userPrefs ./.java ./.solregis ./.netscape/cache ./.netscape/archive ./.netscape/xover-cache/host-news ./.netscape/xover-cache ./.netscape ./nsmail .
1. Become superuser. 2. Type prtvtoc /dev/rdsk/ cntndnsn and press Return. Information for the disk you specify is displayed, as shown in the following example.
paperbark% su Password: # prtvtoc /dev/rdsk/c0t0d0s2 * /dev/rdsk/c0t0d0s2 partition map * * Dimensions: * 512 bytes/sector * 80 sectors/track * 19 tracks/cylinder * 1520 sectors/cylinder * 3500 cylinders * 2733 accessible cylinders * * Flags: * 1: unmountable * 10: read-only * * First Sector * Partition Tag Flags Sector Count 0 2 00 1048800 2865200 1 3 01 0 1048800 2 5 00 0 4154160 7 8 00 3914000 240160
Mount Directory /
/export/home
Bad-Disk Repair
The following sections describe the steps for repairing a bad disk or reinstalling a new one.
You can specify a device name in place of the standard input, the standard output, or both. The following example copies contents of a diskette to a file in the /tmp directory.
oak% dd < /floppy/floppy0 > /tmp/output.file 2400+0 records in 2400+0 records out oak%
The dd command reports on the number of blocks it reads and writes. The number after the + is a count of the partial blocks that were copied. The dd command syntax is different from most other commands. You specify options as keyword=value pairs, where keyword is the option you want to set and value is the argument for that option. For example, you can replace the standard input and output with the following syntax.
dd if=input-file of=output-file
The following example uses the keyword=value pairs instead of the redirect symbols in the previous example.
1. Make sure the source and destination disks have the same geometry. 2. 3.
1. 2. Become superuser. 3. On the system with the master disk, type touch /reconfigure and press Return. The /reconfigure file is required on the system with the master disk so that it recognizes the clone disk once it is rebooted. 4. Type init 0 and press Return to shut down the system. 5. Attach the clone disk to the system and turn on the system. 6. At the ok prompt, type boot and press Return. 7. All on one line, type dd if=/dev/dsk/ device-name of=/dev/dsk/ device-name bs= blocksize and press Return. The input file, if, is the master disk device. The output file, of, is the clone disk device. 8. Type fsck /dev/rdsk/ device-name and press Return to check the new file system. 9. Type mount /dev/rdsk/ device-name /mnt and press Return to mount the clone disk's root file system. 10. Edit the /etc/vfstab file on the clone disk to reference the correct device names. 11. Type umount /mnt and press Return to unmount the clone disk's root file system. 12. Type init 0 and press Return to shut down the system. 13. Type boot disk n -s and press Return to boot the clone disk in single-user mode. The OpenBoot PROM creates certain well-known disk aliases for disks it expects to be attached to a system. And, the system administrator may have created additional disk aliases when attaching extra disks to a system. Use the appropriate alias for the cloned disk as the disk n argument. 14. Type sys-unconfig and press Return to unconfigure the clone disk. The system is shut down after the disk is unconfigured. 15. Type boot disk n and press Return to boot the clone disk. 16. Provide the relevant system information such as host name, time zone, and so on. 17. Log in as root to verify the system information once the system has booted, as shown in the following example.
# boot (Boot messages) # dd if=/dev/dsk/c0t0d0s2 of=/dev/dsk/c0t2d0s2 bs=100k # fsck /dev/rdsk/c0t2d0s2 # mount /dev/dsk/c0t2d0s2 /mnt # cd /mnt/etc # vi vfstab (Modify entries for the new disk) # cd / # umount /mnt # init 0 (Shutdown messages) # boot disk2 -s (Boot messages) # sys-unconfig # boot disk2
CAUTION. You must format the disk after you add the defect list. Any data on the disk is
destroyed by formatting. If the disk is not new, be sure the data is backed up before you proceed. See "Backing Up and Restoring File Systems" on page 211 for complete information on how to back up and restore file systems.
1. Become superuser. 2. Type format and press Return. 3. A list of available disks is displayed, as shown in the following example.
paperbark% su # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80> /sbus@1f,0/SUNW,fas@e,8800000/sd@0,0 1. c0t1d0 <SUN2.1G cyl 2733 alt 2 hd 19 sec 80> /sbus@1f,0/SUNW,fas@e,8800000/sd@1,0 Specify disk (enter its number):
4. Type the number of the new disk from the list that is displayed. The Format menu and the format> prompt are displayed. 5. Type defect and press Return. 6. Type primary and press Return. The original defect list is added to the disk, as shown in the following example.
defect> primary Extracting primary defect list . . . Extraction complete. Current Defect List updated, \ total of 30 defects.
7. Type quit and press Return. The format> prompt is displayed. 8. Type format and press Return. The disk begins formatting. Formatting takes about 10 minutes for a 107-Mbyte disk, longer for bigger disks. 9. When the format> prompt is redisplayed, type partition and press Return. 10. Re-create the partitions to match the partitions on the defective disk. 11. Type label and press Return. The disk is labeled. 12. Type quit and press Return. The Format menu and format> prompt are redisplayed. 13. Type quit and press Return. The shell prompt is redisplayed, as shown in the following example.
oak% su Password: # format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. sd0 at esp0 slave 24 sd0: <SUN0207 cyl 1254 alt 2 hd 9 sec 36> 1. sd2 at esp0 slave 16 sd2: <SUN0207 cyl 1254 alt 2 hd 9 sec 36> Specify disk (enter its number): 1 selecting c0t0d0 [disk formatted] FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector
label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name quit format > defect defect > primary Extracting primary defect list . . . Extraction complete. Current Defect List updated, total of 30 defects. defect > quit format > format format> partition PARTITION MENU: 0 - change '0' partition 1 - change '1' partition 2 - change '2' partition 3 - change '3' partition 4 - change '4' partition 5 - change '5' partition 6 - change '6' partition 7 - change '7' partition select - select a predefined table modify - modify a predefined partition table name - name the current table print - display the current table label - write partition map and label to the disk quit partition> <partition the disk> partition> label partition> quit format > quit #
CAUTION. Be sure you have specified the correct device name for the partition before performing the next step. If you specify the wrong partition, you will erase its contents when the new file system is created. 3. Type y to confirm. The newfs command uses optimized default values to create the file system. The following example creates a file system on /dev/rdsk/c0t3d0s7.
oak% su Password: # newfs /dev/rdsk/c0t3d0s7 newfs: construct a new file system /dev/rdsk/c0t3d0s7 (y/n)? y /dev/rdsk/c0t3d0s7: 163944 sectors in 506 cylinders of 9 tracks, 36 sectors 83.9MB in 32 cyl groups (16 c/g, 2.65MB/g, 1216 i/g) super-block backups (for fsck -b #) at: 32, 5264, 10496, 15728, 20960, 26192, 31424, 36656, 41888, 47120, 52352, 57584, 62816, 68048, 73280, 78512, 82976, 88208, 93440, 98672, 103904, 109136, 114368, 119600, 124832, 130064, 135296, 140528, 145760, 150992, 156224, 161456, #
1. As superuser, type cd /mnt and press Return. You have changed to the mount point directory. 2. 3.
1. 2. Write-protect the tapes for safety. 3. Insert the first volume of the level 0 tape into the tape drive. 4. Type ufsrestore rvf /dev/rmt/ unit and press Return. If this is a multivolume restore, when prompted, remove the first tape and insert the last tape in the tape drive. Follow instructions about the order of the rest of the tapes. The level 0 tape is restored. 5. Remove the tape and load the next-lowest-level tape in the drive. Always restore tapes starting with 0 and continuing until you reach the highest level. 6. Type ufsrestore rvf /dev/rmt/ unit and press Return. The next-level tape is restored. 7. Repeat steps 5 and 6 for each additional tape. 8. Type ls and press Return. 9. A list of files in the directory is displayed. Check the listing to verify that all the files are restored. 10. Type rm restoresymtable and press Return. The restoresymtable created by ufsrestore is removed.
Unmounting the File System from Its Temporary Mount Point (umount)
Use the following steps to unmount the file system from its temporary mount point.
1. As superuser, type cd / and press Return. 2. Type umount /mnt and press Return. The file system is unmounted from the temporary mount point.
Use the following steps to perform a level 0 backup of the restored file system.
1. Remove the last tape and insert a new write-enabled tape in the tape drive. 2. Type ufsdump 0uf /dev/rmt/ unit /dev/rdsk/cntndnsn and press Return.
[ Team LiB ]
You can use the SMC Devices and Hardware/Serial Ports tool to administer SAF for alphanumeric terminals and modems on a local system. See the Solaris Management Console Tools book published by Sun Microsystems Press and Prentice Hall for detailed instructions on how to use the Serial Ports tool.
NOTE. The ttymon port monitor replaces the SunOS 4.x getty port monitor. A single ttymon can replace multiple gettys.
[ Team LiB ]
1. Halt the system. 2. Make sure hardware carrier detect is disabled. At the OpenBoot PROM prompt, type setenv ttyb-ignore-cd=false and press Return. 3. Reboot the system. 4. Connect the modem and make sure any modem switches are set to allow bidirectional use. 5. Use the SMC Devices and Hardware/Serial Ports tool to configure a serial port for a modem. See the Solaris Management Console Tools book for detailed instructions. [ Team LiB ]
[ Team LiB ]
Using a Modem
To connect through the modem, type tip - baudrate phonenumber and press Return. When the software on the connecting system is configured properly, the remote system dials the modem phone number and the modem answers automatically. The following example uses the information phone number, which is not a dial-in modem number.
[ Team LiB ]
[ Team LiB ]
NOTE. Starting with the Solaris 9 release, you can use the following SMC tools. The System Configuration category provides Projects, Computers and Networks, and Patches tools. The System Performance tool enables you to monitor system performance on a local system.
[ Team LiB ]
[ Team LiB ]
You can also display the host ID number with the hostid command.
NOTE. The Solaris 9 uname manual page discourages use of the -m option. Instead, Sun recommends the -p option. See below for an example of the output of the -p option.
mopoke% prtconf System Configuration: Sun Microsystems sun4u Memory size: 128 Megabytes System Peripherals (Software Nodes): SUNW,Sun-Blade-100 packages (driver not attached) SUNW,builtin-drivers (driver not attached) deblocker (driver not attached) disk-label (driver not attached) terminal-emulator (driver not attached) obp-tftp (driver not attached) dropins (driver not attached) kbd-translator (driver not attached) ufs-file-system (driver not attached) chosen (driver not attached) openprom (driver not attached) client-services (driver not attached) options, instance #0 aliases (driver not attached) memory (driver not attached) virtual-memory (driver not attached) pci, instance #0 ebus, instance #1 flashprom (driver not attached) eeprom (driver not attached) idprom (driver not attached) isa, instance #0 dma, instance #0 floppy, instance #0 parallel (driver not attached) power, instance #0 serial, instance #0 serial, instance #1 network, instance #0 firewire, instance #0 usb, instance #0 storage, instance #1 disk, instance #2
keyboard, instance #2 mouse, instance #1 pmu, instance #0 i2c, instance #0 temperature, instance #0 card-reader (driver not attached) dimm (driver not attached) ppm, instance #1 beep, instance #1 fan-control, instance #1 sound (driver not attached) ide, instance #0 disk (driver not attached) cdrom (driver not attached) dad, instance #0 sd, instance #0 SUNW,m64B, instance #0 pci (driver not attached) SUNW,UltraSPARC-IIe, instance #0 os-io (driver not attached) pseudo, instance #0 mopoke%
An alternative way to display system configuration information and show the state of tunable parameters is to type sysdef and press Return. System configuration information is displayed. The complete output shown in the following example shows the level of detail you can access about a system's configuration.
mopoke% sysdef * * Hostid * 8304b666 * * sun4u Configuration * * * Devices * packages (driver not attached) SUNW,builtin-drivers (driver not attached) deblocker (driver not attached)
disk-label (driver not attached) terminal-emulator (driver not attached) obp-tftp (driver not attached) dropins (driver not attached) kbd-translator (driver not attached) ufs-file-system (driver not attached) chosen (driver not attached) openprom (driver not attached) client-services (driver not attached) options, instance #0 aliases (driver not attached) memory (driver not attached) virtual-memory (driver not attached) pci, instance #0 ebus, instance #1 flashprom (driver not attached) eeprom (driver not attached) idprom (driver not attached) isa, instance #0 dma, instance #0 floppy, instance #0 parallel (driver not attached) power, instance #0 serial, instance #0 serial, instance #1 network, instance #0 firewire, instance #0 usb, instance #0 storage, instance #1 disk, instance #2 keyboard, instance #2 mouse, instance #1 pmu, instance #0 i2c, instance #0 temperature, instance #0 card-reader (driver not attached) dimm (driver not attached) ppm, instance #1 beep, instance #1 fan-control, instance #1 sound (driver not attached) ide, instance #0 disk (driver not attached) cdrom (driver not attached) dad, instance #0 sd, instance #0 SUNW,m64B, instance #0 pci (driver not attached) SUNW,UltraSPARC-IIe, instance #0 os-io (driver not attached) pseudo, instance #0 clone, instance #0
ip, instance #0 ip6, instance #0 tcp, instance #0 tcp6, instance #0 udp, instance #0 udp6, instance #0 icmp, instance #0 icmp6, instance #0 sad, instance #0 conskbd, instance #0 wc, instance #0 consms, instance #0 iwscn, instance #0 ptsl, instance #0 rts, instance #0 tl, instance #0 keysock, instance #0 spdsock, instance #0 sysmsg, instance #0 cn, instance #0 mm, instance #0 kstat, instance #0 pm, instance #0 atmmb, instance #0 q93b, instance #0 laner, instance #0 skip_key, instance #0 screen_skip, instance #0 log, instance #0 vol, instance #0 sy, instance #0 random, instance #0 ptm, instance #0 pts, instance #0 devinfo, instance #0 ksyms, instance #0 * * Loadable Objects * * Loadable Object Path = /platform/SUNW,Sun-Blade-100/kernel * drv/sparcv9/grppm drv/sparcv9/pmubus drv/sparcv9/grfans drv/sparcv9/grbeep misc/sparcv9/platmod * * Loadable Object Path = /platform/sun4u/kernel * tod/todstarfire tod/todmostek tod/sparcv9/todmostek
tod/sparcv9/todsg tod/sparcv9/todstarcat tod/sparcv9/todstarfire tod/sparcv9/todds1287 tod/sparcv9/todm5819 genunix unix cpu/SUNW,UltraSPARC-III cpu/SUNW,UltraSPARC-III+ cpu/SUNW,UltraSPARC-II cpu/SUNW,UltraSPARC-IIi cpu/SUNW,UltraSPARC-IIe cpu/SUNW,UltraSPARC cpu/sparcv9/SUNW,UltraSPARC-II cpu/sparcv9/SUNW,UltraSPARC-IIi cpu/sparcv9/SUNW,UltraSPARC-III+ cpu/sparcv9/SUNW,UltraSPARC-IIe cpu/sparcv9/SUNW,UltraSPARC-III cpu/sparcv9/SUNW,UltraSPARC dacf/consconfig_dacf dacf/sparcv9/consconfig_dacf drv/dma drv/ebus drv/fd drv/ledma drv/pci_pci drv/pcipsy drv/power drv/rootnex drv/sbbc drv/sbus drv/sbusmem drv/simba drv/stc drv/su drv/trapstat drv/zs drv/zsh drv/sf drv/i2c drv/db21554 drv/m64 drv/gfxp drv/afb drv/ce drv/cgsix drv/tod drv/bwtwo drv/cgthree drv/ffb drv/gfb drv/ifb
drv/igs drv/cpc hard link: sys/cpc drv/i2cadc drv/i2cgpio drv/Neide drv/atata drv/ata drv/disk_ata drv/cmdk drv/eide drv/i8042 drv/kb_ps2 drv/kdmouse drv/consbus drv/echip drv/gchip drv/scman drv/lom drv/lomp drv/sparcv9/ifb drv/sparcv9/dma drv/sparcv9/ebus drv/sparcv9/fd drv/sparcv9/gpio_87317 drv/sparcv9/isadma drv/sparcv9/ledma drv/sparcv9/lm75 drv/sparcv9/ltc1427 drv/sparcv9/max1617 drv/sparcv9/mc-us3 drv/sparcv9/pcf8574 drv/sparcv9/pcf8584 drv/sparcv9/pcf8591 drv/sparcv9/pci_pci drv/sparcv9/pcipsy drv/sparcv9/pcisch drv/sparcv9/pmc drv/sparcv9/power drv/sparcv9/sbbc drv/sparcv9/sbus drv/sparcv9/sbusmem drv/sparcv9/schppm drv/sparcv9/seeprom drv/sparcv9/simba drv/sparcv9/smbus drv/sparcv9/smbus_ara drv/sparcv9/ssc050 drv/sparcv9/ssc100 drv/sparcv9/stc drv/sparcv9/su drv/sparcv9/tda8444
drv/sparcv9/trapstat drv/sparcv9/upa64s drv/sparcv9/i2c drv/sparcv9/ce drv/sparcv9/ffb drv/sparcv9/i2cadc drv/sparcv9/scmi2c drv/sparcv9/db21554 drv/sparcv9/sf drv/sparcv9/bbc_beep drv/sparcv9/i2cgpio drv/sparcv9/disk_ata drv/sparcv9/tod drv/sparcv9/fcode drv/sparcv9/Neide drv/sparcv9/atata drv/sparcv9/igs drv/sparcv9/i8042 drv/sparcv9/kb_ps2 drv/sparcv9/kdmouse drv/sparcv9/gfb drv/sparcv9/us drv/sparcv9/m64 drv/sparcv9/rootnex drv/sparcv9/zs drv/sparcv9/gfxp drv/sparcv9/zsh drv/sparcv9/afb drv/sparcv9/cgsix drv/sparcv9/wrsmd drv/sparcv9/cpc hard link: sys/sparcv9/cpc drv/sparcv9/consbus drv/sparcv9/echip drv/sparcv9/gchip drv/sparcv9/scman drv/sparcv9/uflash drv/sparcv9/lom drv/sparcv9/lomp drv/sparcv9/lomv misc/consconfig misc/forthdebug misc/md5 misc/obpsym misc/pcmcia misc/platmod misc/vis misc/dadk misc/gda misc/snlb misc/strategy misc/bootdev
misc/cpr misc/sparcv9/forthdebug misc/sparcv9/i2c_svc misc/sparcv9/md5 misc/sparcv9/obpsym misc/sparcv9/pcmcia misc/sparcv9/platmod misc/sparcv9/sbd misc/sparcv9/vis misc/sparcv9/fcpci misc/sparcv9/gptwo_cpu misc/sparcv9/consconfig misc/sparcv9/fcodem misc/sparcv9/gptwocfg misc/sparcv9/pcicfg.e misc/sparcv9/bootdev misc/sparcv9/cpr misc/kgss/sparcv9/gl_kmech_krb5 sparcv9/genunix sparcv9/unix strmod/kbsm_ps2 strmod/vuidps2 strmod/kb misc/kgss/gl_kmech_krb5 strmod/sparcv9/kbsm_ps2 strmod/sparcv9/vuidps2 strmod/sparcv9/kb * * Loadable Object Path = /kernel * ipp/dlcosmk ipp/ipgpc ipp/dscpmk ipp/flowacct ipp/tokenmt ipp/tswtclmt ipp/sparcv9/dlcosmk ipp/sparcv9/ipgpc ipp/sparcv9/dscpmk ipp/sparcv9/flowacct ipp/sparcv9/tokenmt ipp/sparcv9/tswtclmt genunix drv/md drv/bpp drv/clone drv/cn drv/conskbd drv/consms drv/dad drv/devinfo drv/esp
drv/icmp hard drv/pcic drv/icmp6 hard drv/ip hard drv/pcs drv/ip6 hard drv/pem drv/ippctl drv/ipsecesp hard drv/stp4020 drv/isp drv/iwscn drv/keysock hard drv/le drv/lebuffer drv/llc1 drv/lofi drv/log drv/mm drv/openeepr drv/options drv/poll drv/pseudo drv/ptc drv/ptsl drv/random drv/rts hard drv/pcelx drv/sad hard drv/pcmem drv/sd drv/sgen drv/spdsock drv/st drv/sy drv/sysmsg drv/tcp hard drv/pcram drv/tcp6 hard drv/pcser drv/tl drv/uata
link:
strmod/icmp
link: link:
strmod/icmp6 strmod/ip
link:
strmod/ip6
link:
strmod/ipsecesp
link:
strmod/keysock
link:
strmod/rts
link:
strmod/sad
link:
strmod/tcp
link:
strmod/tcp6
drv/udp hard link: drv/ecpp drv/udp6 hard link: drv/wc drv/xbox drv/glm drv/soc drv/ssd drv/se drv/pcata drv/qlc drv/ses drv/fcp drv/ge drv/fas drv/qfe drv/ifp drv/fp drv/arp hard link: drv/ipsecah hard link: drv/pln drv/audioens drv/dbri drv/rtvc drv/hubd drv/hid drv/ohci drv/scsa2usb drv/usb_ac drv/usb_as drv/usb_mid drv/usbprn drv/usoc drv/hme drv/scsi_vhci drv/audiocs drv/fcip drv/socal drv/bofi drv/nca drv/skip_key drv/screen drv/aar drv/atmip drv/atmmb drv/ba drv/lane drv/laner strmod/udp
strmod/udp6
strmod/arp strmod/ipsecah
drv/q93b drv/qcc drv/pf drv/nf drv/smt drv/HSIP drv/HSI drv/tsalarm drv/sparcv9/hubd drv/sparcv9/cn drv/sparcv9/conskbd drv/sparcv9/consms drv/sparcv9/dad drv/sparcv9/devinfo drv/sparcv9/esp drv/sparcv9/icmp hard link: strmod/sparcv9/icmp drv/sparcv9/hid drv/sparcv9/ohci drv/sparcv9/scsa2usb drv/sparcv9/usb_ac drv/sparcv9/usb_as drv/sparcv9/usb_mid drv/sparcv9/iwscn drv/sparcv9/keysock hard link: strmod/sparcv9/keysock drv/sparcv9/usbprn drv/sparcv9/lebuffer drv/sparcv9/llc1 drv/sparcv9/lofi drv/sparcv9/log drv/sparcv9/mm drv/sparcv9/openeepr drv/sparcv9/options drv/sparcv9/poll drv/sparcv9/pseudo drv/sparcv9/ptc drv/sparcv9/ptsl drv/sparcv9/random drv/sparcv9/rts hard link: strmod/sparcv9/rts drv/sparcv9/pcs drv/sparcv9/pem drv/sparcv9/usoc drv/sparcv9/sgen drv/sparcv9/spdsock drv/sparcv9/st drv/sparcv9/sysmsg drv/sparcv9/tcp hard link: strmod/sparcv9/tcp drv/sparcv9/eri drv/sparcv9/fcip
drv/sparcv9/ttymux drv/sparcv9/uata drv/sparcv9/fcp drv/sparcv9/dcam1394 drv/sparcv9/ge drv/sparcv9/fas drv/sparcv9/hme drv/sparcv9/stp4020 drv/sparcv9/pcmem drv/sparcv9/hci1394 drv/sparcv9/pcelx drv/sparcv9/pcic drv/sparcv9/pln drv/sparcv9/ssd drv/sparcv9/audiocs drv/sparcv9/audioens drv/sparcv9/soc drv/sparcv9/pcram drv/sparcv9/pcser drv/sparcv9/ecpp drv/sparcv9/glm drv/sparcv9/se drv/sparcv9/pcata drv/sparcv9/ses drv/sparcv9/ifp drv/sparcv9/socal drv/sparcv9/scsi_vhci drv/sparcv9/md drv/sparcv9/fp drv/sparcv9/qlc drv/sparcv9/audiots drv/sparcv9/dbri drv/sparcv9/arp hard link: strmod/sparcv9/arp drv/sparcv9/clone drv/sparcv9/sy drv/sparcv9/udp hard link: strmod/sparcv9/udp drv/sparcv9/rtvc drv/sparcv9/qfe drv/sparcv9/bpp drv/sparcv9/icmp6 hard link: strmod/sparcv9/icmp6 drv/sparcv9/ip hard link: strmod/sparcv9/ip drv/sparcv9/ip6 hard link: strmod/sparcv9/ip6 drv/sparcv9/ippctl drv/sparcv9/ipsecah hard link: strmod/sparcv9/ipsecah drv/sparcv9/ipsecesp hard link: strmod/sparcv9/ipsecesp
drv/sparcv9/bofi drv/sparcv9/isp drv/sparcv9/le drv/sparcv9/sad hard link: strmod/sparcv9/sad drv/sparcv9/sd drv/sparcv9/tcp6 hard link: strmod/sparcv9/tcp6 drv/sparcv9/tl drv/sparcv9/udp6 hard link: strmod/sparcv9/udp6 drv/sparcv9/wc drv/sparcv9/nca drv/sparcv9/skip_key drv/sparcv9/screen drv/sparcv9/aar drv/sparcv9/atmip drv/sparcv9/atmmb drv/sparcv9/ba drv/sparcv9/lane drv/sparcv9/laner drv/sparcv9/q93b drv/sparcv9/qcc drv/sparcv9/pf drv/sparcv9/nf drv/sparcv9/smt drv/sparcv9/HSIP drv/sparcv9/HSI drv/sparcv9/tsalarm exec/elfexec exec/intpexec exec/aoutexec exec/sparcv9/intpexec exec/sparcv9/aoutexec exec/sparcv9/elfexec fs/autofs fs/fifofs fs/hsfs fs/lofs fs/mntfs fs/procfs fs/sockfs fs/specfs fs/tmpfs fs/ufs fs/udfs misc/kgss/gl_kmech_krb5 fs/cachefs fs/nfs hard link: sys/nfs fs/sparcv9/fifofs fs/sparcv9/hsfs
fs/sparcv9/lofs fs/sparcv9/mntfs fs/sparcv9/procfs fs/sparcv9/sockfs fs/sparcv9/specfs fs/sparcv9/tmpfs fs/sparcv9/ufs fs/sparcv9/autofs fs/sparcv9/udfs fs/sparcv9/cachefs fs/sparcv9/nfs hard link: misc/consconfig misc/dada misc/des misc/fssnap_if misc/gld misc/hpcsvc misc/ipc misc/krtld misc/md5 misc/pcicfg misc/pcihp misc/rpcsec misc/scsi misc/seg_drv misc/seg_mapdev misc/sha1 misc/strplumb misc/swapgeneric misc/tlimod misc/ufs_log misc/md_hotspares misc/md_mirror misc/audiosup misc/rpcsec_gss misc/klmops misc/amsrc1 misc/nfs_dlboot misc/md_notify misc/md_raid misc/md_sp misc/md_stripe misc/diaudio misc/md_trans misc/klmmod misc/kgssapi misc/mixer misc/busra misc/hidparser misc/fctl misc/kbtrans
sys/sparcv9/nfs
misc/usba misc/nfssrv misc/rsmops misc/vlan misc/mpxio misc/phx misc/sparcv9/dada misc/sparcv9/des misc/sparcv9/fssnap_if misc/sparcv9/gld misc/sparcv9/hpcsvc misc/sparcv9/ipc misc/sparcv9/krtld misc/sparcv9/md5 misc/sparcv9/pcicfg misc/sparcv9/pcihp misc/sparcv9/rpcsec misc/sparcv9/scsi misc/sparcv9/seg_drv misc/sparcv9/seg_mapdev misc/sparcv9/sha1 misc/sparcv9/strplumb misc/sparcv9/tlimod misc/sparcv9/ufs_log misc/sparcv9/hidparser misc/sparcv9/klmops misc/sparcv9/nfs_dlboot misc/sparcv9/nfssrv misc/sparcv9/rpcsec_gss misc/sparcv9/s1394 misc/sparcv9/audiosup misc/sparcv9/diaudio misc/sparcv9/mixer misc/sparcv9/consconfig misc/sparcv9/kgssapi misc/sparcv9/mpxio misc/sparcv9/phx misc/sparcv9/fctl misc/sparcv9/busra misc/sparcv9/swapgeneric misc/sparcv9/kbtrans misc/sparcv9/amsrc1 misc/sparcv9/usba misc/sparcv9/md_hotspares misc/sparcv9/md_mirror misc/sparcv9/md_notify misc/sparcv9/md_raid misc/sparcv9/md_sp misc/sparcv9/md_stripe misc/sparcv9/md_trans misc/sparcv9/klmmod misc/sparcv9/rsmops
misc/sparcv9/vlan sched/TS_DPTBL sched/TS sched/sparcv9/TS_DPTBL sched/sparcv9/TS strmod/authmd5h strmod/authsha1 strmod/bufmod strmod/connld strmod/dedump strmod/encr3des strmod/encrdes strmod/ldterm strmod/pckt strmod/pfmod strmod/pipemod strmod/ptem strmod/redirmod strmod/rpcmod hard link: sys/rpcmod strmod/atun strmod/ttcompat strmod/tun strmod/ms strmod/timod strmod/tirdwr strmod/hwc strmod/usbms strmod/usb_ah strmod/usbkbm strmod/bd strmod/efs strmod/spf strmod/sscop strmod/sparcv9/authsha1 strmod/sparcv9/bufmod strmod/sparcv9/connld strmod/sparcv9/dedump strmod/sparcv9/encr3des strmod/sparcv9/encrdes strmod/sparcv9/pckt strmod/sparcv9/pfmod strmod/sparcv9/pipemod strmod/sparcv9/ptem strmod/sparcv9/redirmod strmod/sparcv9/rpcmod hard link: sys/sparcv9/rpcmod strmod/sparcv9/usb_ah strmod/sparcv9/usbms strmod/sparcv9/ttcompat strmod/sparcv9/tun strmod/sparcv9/usbkbm
strmod/sparcv9/hwc strmod/sparcv9/atun strmod/sparcv9/authmd5h strmod/sparcv9/ldterm strmod/sparcv9/ms strmod/sparcv9/timod strmod/sparcv9/tirdwr misc/kgss/sparcv9/gl_kmech_krb5 strmod/sparcv9/bd strmod/sparcv9/efs strmod/sparcv9/spf strmod/sparcv9/sscop sys/doorfs sys/inst_sync sys/kaio sys/msgsys sys/pipe sys/pset sys/semsys sys/shmsys sys/c2audit sys/sparcv9/inst_sync sys/sparcv9/kaio sys/sparcv9/msgsys sys/sparcv9/pipe sys/sparcv9/pset sys/sparcv9/semsys sys/sparcv9/shmsys sys/sparcv9/c2audit sys/sparcv9/doorfs * * Loadable Object Path = /usr/kernel * exec/sparcv9/javaexec fs/sparcv9/fdfs fs/sparcv9/namefs fs/sparcv9/pcfs sched/sparcv9/RT_DPTBL sched/sparcv9/FX sched/sparcv9/FX_DPTBL sched/sparcv9/IA sched/sparcv9/RT sched/sparcv9/FSS sys/sparcv9/sysacct sys/sparcv9/acctctl sys/sparcv9/exacctsys misc/bsafe2_kern_lib misc/skip_bdc_rc2_cbc misc/skip_bdc_rc4 misc/skip_bdc_rc4_128 misc/skip_fast_des_cbc misc/skip_des_ede_k3
misc/skip_safer_128sk_cbc misc/screen_dns misc/screen_fail misc/screen_ftp misc/screen_ip misc/screen_nfsro misc/screen_normal misc/screen_ping misc/screen_pmap misc/screen_raudio misc/screen_rsh misc/screen_sqlnet misc/screen_stateless misc/screen_tcp misc/screen_ts7 misc/screen_ts8 misc/screen_udp drv/sparcv9/sppp drv/sparcv9/sppptun hard link: strmod/sparcv9/sppptun drv/sparcv9/dump drv/sparcv9/fssnap drv/sparcv9/kstat drv/sparcv9/ksyms drv/sparcv9/lockstat drv/sparcv9/logindmux drv/sparcv9/ptm drv/sparcv9/pts drv/sparcv9/pm drv/sparcv9/tnf drv/sparcv9/vol drv/sparcv9/winlock drv/sparcv9/llc2 drv/sparcv9/rsm drv/sparcv9/screen_ipsec drv/sparcv9/screen_skip strmod/sparcv9/telmod strmod/sparcv9/u8lat2 strmod/sparcv9/spppcomp strmod/sparcv9/u8lat1 strmod/sparcv9/u8koi8 strmod/sparcv9/rlmod strmod/sparcv9/spppasyn drv/dump drv/fssnap drv/kstat drv/ksyms drv/lockstat drv/logindmux drv/ptm drv/pts drv/winlock
drv/pm drv/vol drv/sppptun hard link: strmod/sppptun drv/rsm drv/tnf drv/llc2 drv/sppp drv/screen_ipsec drv/screen_skip exec/javaexec fs/fdfs fs/namefs fs/pcfs sched/FX sched/FX_DPTBL sched/IA sched/RT sched/RT_DPTBL sched/FSS strmod/spppcomp strmod/rlmod strmod/telmod strmod/u8koi8 strmod/u8lat1 strmod/u8lat2 strmod/spppasyn sys/acctctl sys/exacctsys sys/sysacct misc/sparcv9/skip_bdc_rc4 misc/sparcv9/skip_bdc_rc4_128 misc/sparcv9/skip_fast_des_cbc misc/sparcv9/skip_des_ede_k3 misc/sparcv9/skip_safer_128sk_cbc misc/sparcv9/screen_dns misc/sparcv9/screen_fail misc/sparcv9/screen_ftp misc/sparcv9/screen_ip misc/sparcv9/screen_nfsro misc/sparcv9/screen_normal misc/sparcv9/screen_ping misc/sparcv9/screen_pmap misc/sparcv9/screen_raudio misc/sparcv9/screen_rsh misc/sparcv9/screen_sqlnet misc/sparcv9/screen_stateless misc/sparcv9/screen_tcp misc/sparcv9/screen_ts7 misc/sparcv9/screen_ts8 misc/sparcv9/screen_udp *
* System Configuration * swap files swapfile dev swaplo blocks free /dev/dsk/c1t0d0s1 136,1 16 1049312 1049312 * * Tunable Parameters * 2449408 maximum memory allowed in buffer cache (bufhwm) 1866 maximum number of processes (v.v_proc) 99 maximum global priority in sys class (MAXCLSYSPRI) 1861 maximum processes per user id (v.v_maxup) 30 auto update time limit in seconds (NAUTOUP) 25 page stealing low water mark (GPGSLO) 5 fsflush run rate (FSFLUSHR) 25 minimum resident memory for avoiding deadlock (MINARMEM) 25 minimum swapable memory for avoiding deadlock (MINASMEM) * * Utsname Tunables * 5.9 release (REL) mopoke node name (NODE) SunOS system name (SYS) Generic_112737-02 version (VER) * * Process Resource Limit Tunables (Current:Maximum) * 0x0000000000000100:0x0000000000010000 file descriptors * * Streams Tunables * 9 maximum number of pushes allowed (NSTRPUSH) 65536 maximum stream message size (STRMSGSZ) 1024 max size of ctl part of message (STRCTLSZ) * * IPC Messages module is not loaded * * * IPC Semaphores module is not loaded * * * IPC Shared Memory module is not loaded * * * Time Sharing Scheduler Tunables * 60 maximum time sharing user priority (TSMAXUPRI) SYS system class name (SYS_NAME) mopoke%
1 user,
To find out when a system was booted, type who -b and press Return. The month, day, and time of the last boot are displayed.
1.
1. Become superuser. 2. Type date mmddhhmmyy and press Return, where mm is the month, dd is the day, hh is the hour, mm is the minute, and yy is the year. The system date and time are reset according to the month, day, hour, minute, and year that you specify.
# su Password: # date Sat Jul 1 16:07:01 WST 2000 # date 07011552 Sat Jul 1 15:52:00 WST 2000 #
Alaska Aleutian Arizona Central East-Indiana Eastern Hawaii Michigan Mountain Pacific Pacific-New Samoa
1. 2.
1. Become superuser. 2. Edit the /etc/TIMEZONE file, change the TZ= time-zone variable, and save the changes. The time zone is reset. 3. Reboot the system. The following example shows the /etc/TIMEZONE file for a system set to Australia West standard time. Note that /etc/TIMEZONE is now a symbolic link to /etc/default/init.
paperbark% more /etc/TIMEZONE # @(#)init.dfl 1.5 99/05/26 # # This file is /etc/default/init. /etc/TIMEZONE is a symlink to this file. # This file looks like a shell script, but it is not. To maintain # compatibility with old versions of /etc/TIMEZONE, some shell constructs # (i.e., export commands) are allowed in this file, but are ignored. # # Lines of this file should be of the form VAR=value, where VAR is one of # TZ, LANG, or any of the LC_* environment variables. # TZ=Australia/West CMASK=022 LANG=C paperbark%
oak% su Password: # vi /etc/TIMEZONE TZ=US/Eastern;export TZ :w! # reboot oak% date Tue Jul 1 14:24:52 EST 2000 oak%
NOTE. You may need to make your text editor do a confirmed write of the file. For example, in vi use the command :w! to write the changes even if the permissions normally would not allow it.
[ Team LiB ]
[ Team LiB ]
1. Become superuser. You can create a swap file without root permissions, but it is a good idea to have root be the owner of the swap file so that other processes cannot access it. 2. Type mkfile nnn[k|b|m] file-name and press Return. The letter following the number you specify indicates kilobytes, blocks, or megabytes. The swap file of the size and file name you specify is created. The following example creates a 1-Mbyte swap file named SWAP.
1.
1. Become superuser. 2. Type swap -a path-name and press Return. You must use the absolute path name to specify the swap file. The swap file is added and becomes available. 3. Type swap -l to verify that the swap file is added.
# swap -a /files1/SWAP # swap -l swapfile dev swapfs /dev/dsk/c0t3d0s1 /files1/SWAP # 8 32,25 2040
Use the following steps to remove a specified swap file from use.
1. Become superuser. 2. Type swap -d path-name and press Return. When the swap file is no longer in use, it is removed from the list so that it is no longer available for swapping. The file itself is not deleted.
oak% su Password: # swap -d /files1/SWAP # swap -l swapfile dev blocks free swapfs 94520 93512 /dev/dsk/c0t3d0s1 32,25 65512 45048 # ls -l /files1/SWAP -rw------1 root root #
swaplo 0
When you create additional swap space, if you want the swap space to remain available when the system is rebooted, you must add the entry to the /etc/vfstab file. Use the following steps to add a swap file entry to the /etc/vfstab file.
1. Become superuser. 2. Edit the /etc/vfstab file and add the following line. Be sure the line follows the entry for the partition in which the swap file was created.
path-name - - swap - no -
The next time the system is rebooted, the swap file is added automatically. The following example adds the swap file /files1/SWAP to the /etc/vfstab file after the entry that mounts the file system /files1.
/files1/SWAP - - swap - no -
[ Team LiB ]
[ Team LiB ]
1. Become superuser. 2. Edit the /etc/mail/aliases file. 3. At the end of the file, under the Local Aliases category, type aliasname:username1,username2,... and press Return after the last username. 4. Save the changes. For example, if you want to create an alias called friends, edit the /etc/mail/aliases file and add an entry like the following.
friends:dexter@elm,ogden@willow,mary@maple
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
1. Become superuser. 2. Type cd /etc and press Return. 3. Create a file named /etc/hostname.interface or /etc/hostname6.interface for each network interface. The Solaris installation program creates this file automatically for the primary network interface. This file maps host names to interfaces for IPv4. For IPv6, you need one /etc/hostname. interface or /etc/hostname6.interface file for each system, for example, hostname.le0 or hostname6.le0. 4. Edit the /etc/hostname.interface or /etc/hostname6.interface file and type either the system's IP address or its host name.
NOTE. The Solaris installation program creates the default /etc/inet/hosts file for the
local system. The old /etc/hosts name for this file is now a symbolic link to /etc/inet/hosts. If you are using IPv6, the installation program creates the default /etc/inet/ipnodes file.
5. Edit the /etc/inet/hosts file to add any IP addresses that you have assigned to any additional network interfaces in the local system along with the corresponding host name for each interface. If you are running IPv4, you do not need to create the /etc/inet/ipnodes file. If you have any IPv6 systems, copy all of the IPv4 IP addresses and host names from /etc/inet/hosts to the /etc/inet/ipnodes file. Add the IP addresses and host names for IPv6 systems only to the /etc/inet/ipnodes file.
NOTE. Put only the host name(s) and IP address(es) of network interfaces that are in each system in the /etc/inet/hosts file. DNS should handle all external host-nameto-IP-address mappings; you must, therefore, properly configure the /etc/nsswitch.conf and /etc/resolv.conf files to make this work. Follow this convention because you (as the system administrator) normally don't control the network or other systems on the network. If, for example, the owners of other systems or network equipment change their IP addresses or host names in DNS, the /etc/inet/hosts file on each of the systems under your control would then be out of date and each system's network configuration would mysteriously no longer work. 6. If the /usr file system is NFS mounted, also add the IP address or addresses of the file server to the /etc/inet/hosts file. 7. Edit the /etc/defaultrouter file and type the router's IP address. This file should contain an entry for each router that is directly connected to the network. The entry should be the IP address of an interface on the router that is on the same subnet as the system you're configuring. 8. Edit the /etc/inet/hosts file and type the name of the default router and its IP addresses. 9. If the network is subnetted, edit the /etc/inet/netmasks file and type the network number and netmask. If you have set up an NIS, NIS+, or LDAP server, you can type netmask information in the netmasks database on the server if server and clients are on the same network. 10. Reboot the system. [ Team LiB ]
[ Team LiB ]
3:42,
load average:
0.12,
0.12,
0.01
You can also display a list of all remote hosts in the subnet by typing rup and pressing Return. If you display a list, you can use the options shown in Table 78 to sort the output.
1:42, 0 min,
load average: 0.00, 0.31, 0.34 load average: 0.07, 0.01, 0.00
up 32 days, up 8 days,
14:39, 15:44,
load average: 0.21, 0.05, 0.00 load average: 0.02, 0.00, 0.00
1. Type ping system-name and press Return. The message system-name is alive means the system is accessible over the network. The message ping: unknown host system-name means the system name is not known on the network. The message ping: no answer from system-name means the system is known on the network but is not up at this time. 2. Type rup system-name and press Return. Information about how long the system has been up and the load average is displayed. 3. Type rpcinfo -p system-name and press Return. Information about RPC services is displayed. 4. Type rlogin system-name and press Return. You are logged in to the remote system.
cinderella% ping drusilla drusilla is alive cinderella% rup drusilla drusilla up 3 days, 15:10 load average: 0.07, 0.08, 0.09 cinderella% rpcinfo -p drusilla program vers proto port service 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100007 3 tcp 1029 ypbind 100007 3 udp 1025 ypbind 100021 1 tcp 1030 nlockmgr
100021 1 udp 1026 nlockmgr 100024 1 tcp 1028 status 100024 1 udp 1027 status 100021 3 tcp 1030 nlockmgr 100021 3 udp 1026 nlockmgr 100020 2 tcp 4045 llockmgr 100020 2 udp 4045 llockmgr 100021 2 tcp 1030 nlockmgr 100021 2 udp 1026 nlockmgr 100087 10 udp 1031 adm_agent 100011 1 udp 1034 rquotad 100002 1 udp 1037 rusersd 100002 2 udp 1037 rusersd 100012 1 udp 1041 sprayd 100008 1 udp 1043 walld 100001 2 udp 1046 rstatd 100001 3 udp 1046 rstatd 100001 4 udp 1046 rstatd 100068 2 udp 1049 cmsd 100068 3 udp 1049 cmsd 100083 1 tcp 4049 cinderella% rlogin drusilla Password: Last login: Mon Mar 2 10:31:55 from cinderella drusilla%
You can also use ping with a system's IP address by typing ping IP-address and pressing Return. The message IP-address is alive means the system is accessible over the network. The message ping: no answer from IP-address means the system is not available to the network. The message ping: unknown host IP-address means the system name is not known on the network.
oak% ping 129.144.52.119 129.144.52.119 is alive oak% ping 129.137.67.234 ping: unknown host 129.137.67.234 oak% ping 129.145.52.119 ping: no answer from 129.145.52.119 oak%
[ Team LiB ]
[ Team LiB ]
1. Type rlogin system-name and press Return. You may be prompted for a password. 2. If you have a local account on that system, type your local password. Otherwise, type your NIS, NIS+, or LDAP password. Unless you have a home directory that is accessible on the remote system (because it is local on that system or because it is hard-mounted or automounted), you log in to the root (/) directory.
oak% rlogin ash Password: No directory! Logging in with home=/ Last login: Tue Sep 17 13:54:28 from 129.144.52.119 Sun Microsystems, Inc. SunOS 5.8 Generic February 2000 ash%
password is required because the network already knows who the user is. Network authentication relies on either a trusting network environment set up with your local nameservice and the automounter or one of the nameservices pointed to by the remote system's /etc/nsswitch.conf file.
The rlogin command also interacts with the Pluggable Authentication Module (PAM) subsystem for authentication and may require configuration of the /etc/pam.conf file for authentication to work. For complete information on PAM, refer to the Sun System Administration Guide: Security Services or the "Using Authentication Services" chapter in the Solaris Advanced System Administrator's Guide available from Sun Microsystems Press and Prentice Hall.
When the /etc/hosts.equiv file contains an entry consisting of just a host name, such as the host1
entry above, the host is trusted and so is any user at that system. If the user name is also mentioned, as in the second entry above, then the host is trusted only for that specified user. A netgroup name preceded by a plus sign (+) means that all the systems in that netgroup are considered trusted. A netgroup name preceded by a minus sign (-) means that none of the systems in that netgroup are considered trusted. A single line of + in the /etc/hosts.equiv file indicates that every known host is trusted. The /etc/hosts.equiv file presents a security risk, especially if it contains a + entry. If you maintain an /etc/hosts.equiv file on a system, include only trusted hosts in your network. Do not include any host that belongs to a different network or any systems that are in public areas. For example, do not include a host for which you do not have administrative control.
NOTE. A .rhosts file must reside at the top level of a user's home directory. .rhosts files located in subdirectories are not consulted.
Users can create .rhosts files in their home directories. Using the .rhosts file is another way to enable trusted access between an individual's user accounts on different systems without using the /etc/hosts.equiv file. Unfortunately, the .rhosts file presents a major security problem. While the /etc/hosts.equiv file is under the control of system administrators and can be managed effectively, any user can create a .rhosts file granting access to whomever the user chooses without the system administrator's knowledge. The only secure way to manage .rhosts files is to completely disallow them. Use the following procedures to search and remove .rhosts files.
1. Become superuser. 2. All on one line, type find home-directories -name .rhosts -print -exec rm{} \; and press Return. The find command starts at the designated directory and searches for any file named .rhosts. If any .rhosts files are found, the path is printed on the screen and the file is removed.
The following example removes all .rhosts files in the users' home directories located in the /export/home directory.
paperbark% su Password: # find /export/home -name .rhosts -print -exec rm{} \; /export/home/ray/.rhosts /export/home/des/.rhosts #
Network Authentication
Network information is stored in NIS maps, NIS+ tables, or LDAP. Network authentication relies on one of the following two methods. A trusting network environment that has been set up with the user's local network information service and the automounters. One of the network information services pointed to by the /etc/nsswitch.conf file on the remote system that contains information about the user.
When you invoke the rlogin command on your local host, inetd(1M) on the remote host invokes the in.rlogind daemon. The server checks the client's source port. If the port is not in the range 5121023, the server aborts the connection. The server checks the client's source address. If an entry for the client exists in both /etc/inet/hosts and /etc/hosts.equiv, a user logging in from the client is not prompted for a password. If the address is associated with a host for which no corresponding entry exists in /etc/inet/hosts or if the host name is found in the NIS or NIS+ hosts map or in DNS, the user is prompted for a password, regardless of whether an entry for the client is present in /etc/hosts.equiv. Once the source port and address are checked, in.rlogind allocates a pseudoterminal and manipulates file descriptors so that the slave half of the pseudoterminal becomes the standard input, standard output, and standard error for a login process. The login process is an instance of the login(1) program invoked with the -r option. The login process then proceeds with the pam (3PAM) authentication process. If the login program finds your home directory, it sources both the .cshrc and .login files for the C shell or the .profile file for the Bourne shell. Therefore, your prompt on the remote system is your standard login prompt, and the current directory is the same as for a local login. For example, if your usual prompt is your system name followed by the percent (%) sign, such as paperbark%, when you log in to a remote system, the remote system name is displayed as the login prompt. In the following example, user winsor remotely logs in to the system castle and displays the current working directory.
paperbark% rlogin castle Password: Last login: Tue Jun 20 14:02:01 from :0 Sun Microsystems Inc. SunOS 5.7 Generic October 1998 You have mail. castle% pwd /export/home/winsor castle%
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
If the automounter is set up for your site, you can transfer files between systems by using commands such as cp and mv. This section describes how to use the rcp and ftp commands to transfer files between systems.
To transfer a file from a local system to a remote system, type rcp pathname systemname:destination-pathname and press Return. If you have proper security to access the remote system, the file is copied from the local system to the remote destination you specify. In the following example, the file quest is copied from the current working directory on the system oak to the /tmp directory on the system ash.
oak%
If you want, you can rename the file as part of the destination path name. For example, to rename the file quest to questions and put it in the /tmp directory, type /tmp/questions as the destination path name.
NOTE. You may need to have an account on each system to use the file transfer program. Some systems allow read-only ftp access to anybody who logs in as anonymous and types a login name at the password prompt.
If you have an NIS, NIS+, or LDAP account, you can use your login name and network password to access a remote system by using ftp.
1. Type ftp and press Return. The ftp> prompt is displayed. 2. Type open remote-system-name and press Return. System connection messages are displayed, and you are asked for a user name. 3. Type the user name for your account on the remote system and press Return. If a password is required, you are asked to enter it. 4. Type the password (if required) for your account on the remote system and press Return. A system login message and the ftp> prompt are displayed. 5. Type bin to set binary format or asc to set ASCII format and press Return. The file type is set. ASCII is the default format. 6. Type put local-filename destination-filename and press Return to transfer a single file. File transfer messages and the ftp> prompt are displayed. 7. Type quit and press Return.
7. A goodbye message and the command prompt are displayed. The following example establishes an ftp connection from the system oak to the system elm, specifies ASCII format, puts the file quest from oak into the /tmp/quest directory on elm, and quits the session.
oak% ftp ftp> open elm Connected to elm 220 elm FTP server (UNIX(r) System V Release 4.0) ready. Name (elm:ignatz): ignatz 331 Password required for ignatz. Password: 230 User ignatz logged in. ftp> asc ftp> put quest /tmp/quest 200 PORT command successful. 150 ASCII data connection for /tmp/quest (129.144.52.119,1333). 226 Transfer complete. ftp> quit 221 Goodbye. oak%
You can use the send command as an alternative to the put command. You can copy multiple files by using the mput command. There is no msend command. See the ftp(1) manual page for more information.
NOTE. You must have an account on each system to use the file transfer program.
If you have an NIS, NIS+, or LDAP account, you can use your login name and network password to access a remote system with ftp. Use the following steps to transfer files from a remote system to your local system by using the file transfer program.
1.
2. Type open remote-system-name and press Return. System connection messages are displayed, and you are asked for a user name. 3. Type the user name for your account on the remote system and press Return. If a password is required, you are asked to enter it. 4. Type the password (if required) for your account on the remote system and press Return. A system login message and the ftp> prompt are displayed. 5. Type bin to set binary format or asc to set ASCII format and press Return. The file type is set. ASCII is the default format. 6. Type get remote-filename destination-filename and press Return. File transfer messages and the ftp> prompt are displayed. 7. Type quit and press Return. A goodbye message and the command prompt are displayed. The following example establishes an ftp connection from the system oak to the system elm, specifies ASCII format, gets the file quest from elm, puts it into the /tmp/quest directory on oak, and quits the session.
oak% ftp ftp> open elm Connected to elm 220 elm FTP server (UNIX(r)System V Release 4.0) ready. Name (elm:ignatz): ignatz 331 Password required for ignatz. Password: 230 User ignatz logged in. ftp> asc ftp> get quest /tmp/quest 200 PORT command successful. 150 ASCII data connection for /tmp/quest (129.144.52.119,1333). 226 Transfer complete. ftp> quit 221 Goodbye. oak%
NOTE. You can copy multiple files by using the mget command. See the ftp (1) manual page for more information.
[ Team LiB ]
[ Team LiB ]
An organizational framework that is simpler to administer in large companies. Improved security. Improved distribution time to propagate changes through the network. In addition, the Solaris Operating Environment provides a nameservice switch file, /etc/nsswitch.conf, that lets you use several different network information services at once. The /etc/nsswitch.conf file also lets you specify which service provides which type of information. In previous SunOS releases, selection of the nameservice was hard-coded into the services, which made it difficult to switch to a new nameservice. The /etc/nsswitch.conf file defines the order in which local files and network databases are searched for information. Describing how to set up NIS+ is beyond the scope of this book.
Each table stores a different type of information about users, workstations, or resources on the network. For instance, the Hosts table stores the host name and network address of every workstation in the domain; the Bootparams table stores the location of the root, swap, and dump directories of the diskless clients in the domain. Each domain can have its own set of these NIS+ tables, which store all the NIS+ information for that particular domain. Table 79 lists the 16 NIS+ tables and the information they store.
Information in the Table The RPC program numbers for RPC services available in the domain. The location of all users' home directories in the domain.
Auto_Master Automounter map information. You can access information in NIS+ tables either by entry row or by column, as shown in Figure 20.
For example, if you want to find the network address of a workstation named drusilla in the Hosts database, you can ask a search program to look through the hostname column until it finds drusilla, as shown in Figure 21. The program then searches the drusilla entry row to find its network address, as shown in Figure 22.
You can use NIS+ commands to perform these types of searches for you. Table 80 lists the NIS+ administrative commands.
Description Search for information in an NIS+ table. Search for information in an NIS+ table. Display the entire contents of an NIS+ table.
See the manual pages for information about how to use these commands.
NIS+ Security
NIS+ uses a security authorization model that is similar to the UNIX file system model. It specifies that each item in the namespace as well as each record, each column, and each row has associated with it a set of access rights that are granted to four broad classes of principals. The owner of the item. A group owner of the item. All other principals. nobodythe class of users not defined in the NIS+ domain or those users accessing NIS+ resources from NIS clients. The specific access rights are different from the traditional read, write, and execute rights of file systems because of the nature of information services. Refer to your system manual for more information about NIS+ security. [ Team LiB ]
[ Team LiB ]
[ Team LiB ]
Quality-of-Service Capabilities
A new capability enables the labeling of packets belonging to particular traffic flows for which the sender requests special handling, such as nondefault quality of service or real-time service.
[ Team LiB ]
paperbark% netstat TCP: IPv4 Local Address -------------------localhost.32786 localhost.32773 localhost.32789 localhost.32784 localhost.32792 localhost.32791 localhost.32795 localhost.32784 localhost.32798 localhost.32797 localhost.32813 localhost.32784 localhost.32816 localhost.32815
Remote Address -------------------localhost.32773 localhost.32786 localhost.32784 localhost.32789 localhost.32791 localhost.32792 localhost.32784 localhost.32795 localhost.32797 localhost.32798 localhost.32784 localhost.32813 localhost.32815 localhost.32816
Swind Send-Q Rwind Recv-Q State ----- ------ ----- ------ -----32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED 32767 0 32768 0 ESTABLISHED 32768 0 32768 0 ESTABLISHED
Active UNIX domain sockets Address Type Vnode Conn Local Addr Remote Addr 707f1d90 stream-ord 705b89e0 00000000 /tmp/.X11-unix/X0 707f1ea8 stream-ord 00000000 00000000 paperbark%
Ipkts 11787 8
paperbark% netstat -r -n Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ------ --------172.16.8.0 172.16.8.22 U 1 0 hme0 224.0.0.0 172.16.8.22 U 1 0 hme0
127.0.0.1 paperbark%
127.0.0.1
UH
16
11150
lo0
Refer to the netstat(1M) manual page for more information. [ Team LiB ]
[ Team LiB ]
paperbark% ifconfig -a lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 172.16.8.22 netmask ffffff00 broadcast 172.16.8.255 paperbark%
The flags section shows the status of the interface. The mtu field tells you the maximum transfer size in octets. Information on the second line includes the IP address of the host you are using, the netmask currently being used, and the IP broadcast address of the interface. The following example shows the interfaces on the system castle.
castle% ifconfig -a lo0: flags=849<UP,LOOPBACK,RUNNING,MULTICAST> mtu 8232 inet 127.0.0.1 netmask ff000000 le0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500 inet 172.16.8.19 netmask ffff0000 broadcast 172.16.255.255
castle%
paperbark% su Password # ifconfig hme0 hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 172.16.8.22 netmask ffffff00 broadcast 172.16.8.255 ether 8:0:20:7d:79:d4 #
The flags section shows that the interface is configured UP, is capable of broadcasting, and not using trailer link-level encapsulation. The mtu field tells you that this interface has a maximum transfer size of 1500 octets. Information on the second line includes the IP address of the host, the netmask currently being used, and the IP broadcast address of the interface. The third line gives the system address (in this case, Ethernet) of the host. [ Team LiB ]
[ Team LiB ]
1. Become superuser. 2. Type netstat -i and press Return. Review the output to determine the interfaces that are attached to the system. 3. Type snoop and press Return. Packet information is displayed. 4. Press Control-C to halt the process. The following example traces packets during an FTP file transfer.
mopoke% netstat -i Name Mtu Net/Dest lo0 8232 loopback eri0 1500 mopoke
-> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> ->
G4 mopoke G4 mopoke G4 mopoke mopoke G4 G4 mopoke mopoke G4 G4 mopoke G4 172.16.8.255 172.16.8.255 172.16.8.255
FTP C port=32830 PORT 172,16,8,25,128 FTP R port=32830 200 PORT command suc FTP C port=32830 STOR examples\r\n FTP-DATA R port=32834 FTP-DATA C port=32834 FTP-DATA R port=32834 FTP R port=32830 150 Opening BINARY m FTP-DATA C port=32834 mopoke% netstat -i\nN FTP-DATA C port=32834 FTP-DATA R port=32834 FTP-DATA R port=32834 FTP-DATA C port=32834 FTP C port=32830 FTP R port=32830 226 Transfer complet FTP C port=32830 UDP D=631 S=631 LEN=76 UDP D=631 S=631 LEN=118 UDP D=631 S=631 LEN=107
1. Become superuser. 2. Type snoop -o filename and press Return. Review the output to determine the interfaces that are attached to the system. 3. To inspect the file, type snoop -i filename and press Return.
[ Team LiB ]
[ Team LiB ]
ssh-http-proxy-connect(1) Secure Shell proxy for HTTP. ssh-keygen(1) Authentication key generation. ssh-socks5-proxy-connect(1) Secure Shell proxy for SOCKS5. sshd(1M) ssh_config(4) SSH client configuration file. sshd_config(4) SSH server configuration file. Users can be authenticated with an account password or with a public/private key pair stored on the local host in the user's home directory in the .ssh subdirectory. The remote host is provided with the Secure Shell daemon.
public key, which is required to complete the authentication. Table 82 lists the default names for the identity files that store the public and private keys.
Secure Shell supports two versions of the Secure Shell protocol: the original version 1 and the more secure version 2. Version 2 also amends some of the basic security design flaws of version 1. Version 1 use is discouraged, and the SSH server daemon's configuration file turns on only SSH v2 compatibility (see the Protocol line in /etc/ssh/sshd_config). Version 1 is provided only to assist users migrating to version 2. Table 83 lists the authentication methods and local and remote host requirements.
Private key in $HOME/.ssh/id_rsa User's public key (id_rsa.pub or or $HOME/.ssh/id_dsa id_dsa.pub) in $HOME/.ssh/authorized_keys Public key in $HOME/.ssh/id_rsa.pub or $HOME/.ssh/id_dsa.pub RSA public key (v1) User account Private key in $HOME/.ssh/identity Public key in $HOME/.ssh/identity.pub User account User's public key (identity.pub) in $HOME/.ssh/authorized_keys
Authentication Method
Remote Host Requirements User account Local host name in /etc/hosts.equiv /etc/shosts/equiv $HOME/.rhosts or $home/.shosts
User account
.rhosts provides only weak security, and SSH in the Solaris 9 Operating Environment is, by default, configured to ignore .rhosts completely. .rhosts with RSA (v1) and password-based authentication (v1 or v2) provide medium security. RSA public key (v1) and RSA/DSA public key (v2) provide strong security. Password-based authentication is the default.
Benefits of SSH
SSH provides a secure replacement for the rsh, rlogin, rcp, telnet, and ftp commands. It automatically tunnels X11 traffic and allows authentication with passwords, Kerberos 4 and 5, and public keypairs. With Secure Shell, you can log in to another host securely over an unsecured network, copy files securely between two hosts, and run commands securely on the remote host.
SSH Configuration
At boot time, the /etc/init.d/sshd script normally starts the sshd Secure Shell daemon. The daemon listens for connections from clients. When the user runs the ssh, scp, or sftp command, a Secure Shell session begins. A new sshd daemon is forked for each incoming connection to handle key exchange, encryption, authentication, command execution, and data exchange with the client. The client-side configuration files and server-side configuration files determine the session characteristics. After the authentication succeeds, the user can execute commands remotely and copy data between hosts.
# # # # # # # # # # # # # # # #
Copyright (c) 2001 by Sun Microsystems, Inc. All rights reserved. ident "@(#)ssh_config 1.2 01/10/08 SMI" This file provides defaults for ssh(1). The values can be changed in per-user configuration files $HOME/.ssh/config or on the command line of ssh(1). Configuration data is parsed as follows: 1. command line options 2. user-specific file 3. system-wide file /etc/ssh/ssh_config Any configuration value is only changed the first time it is set. host-specific definitions should be at the beginning of the configuration file, and defaults at the end.
# Example (matches compiled in defaults): # # Host * # ForwardAgent no # ForwardX11 no # PubkeyAuthentication yes # PasswordAuthentication yes # FallBackToRsh no # UseRsh no # BatchMode no # CheckHostIP yes # StrictHostKeyChecking ask # EscapeChar ~
Lines have the format keyword arguments and are case sensitive. Table 84 lists valid keywords and their descriptions.
Keyword BatchMode
Description The argument must be yes or no. If set to yes, passphrase/password querying is disabled. This option is useful in scripts and other batch jobs for which no user is present to supply the password. If this option is set to yes, ssh additionally checks the host IP address in the known_hosts file. This option enables ssh to detect if a host key changed because of DNS spoofing. If the option is set to no, the check is not executed. Specify the cipher to use for encrypting the session in protocol version 1; blowfish and 3des are the only valid values. Specify the ciphers allowed for protocol version 2 in order of preference. Comma-separate multiple ciphers. The default is 3descbc,blowfish-cbc,aes-128-cbc. Specify whether to use compression. The argument must be yes or no.
CheckHostIP
Cipher
Compression
CompressionLevel Specify the compression level to use if compression is enabled. The argument must be an integer from 1 (fast) to 9 (slow, best). The default level is 6, which is good for most applications. ConnectionAttempts Specify the number of tries (one per second) to make before falling back to rsh or exiting. The argument must be an integer. This option can be useful in scripts if the connection sometimes fails. DSAAuthentication Specify whether to try DSA authentication. The argument to this keyword must be yes or no. DSA authentication is tried only if a DSA identity file exists. Note that this option applies to protocol version 2 only. EscapeChar Set the escape character. The default is tilde (~). You can also set the escape character on the command line. The argument should be a single character, ^, followed by a letter, or none to disable the escape character entirely (making the connection transparent for binary data).
FallBackToRsh Specify that if connecting with ssh fails because of a connection-refused error (there is no sshd listening on the remote host), automatically use rsh(1) instead (after a suitable warning about the session being unencrypted). The argument must be yes or no. ForwardAgent Specify whether to forward the connection to the authentication agent (if any) on the remote system. The argument must be yes or no. The default is no. ForwardX11 Specify whether X11 connections are automatically redirected over the secure channel and DISPLAY set. The argument must be yes or no. The default is no.
GatewayPorts Specify whether remote hosts are allowed to connect to local forwarded ports. The argument must be yes or no. The default is no. GlobalKnownHostsFile
Keyword
Host
Restrict the following declarations (up to the next Host keyword) to be those only for hosts that match one of the patterns given after the keyword. You can use asterisk (*) and question mark (?) as wildcards in the patterns. To provide global defaults for all hosts, use a single *. The host is the hostname argument given on the command line (that is, the name is not converted to a canonicalized host name before matching). Specify the real host name to log in to. You can use this option to specify nicknames or abbreviations for hosts. Default is the name given on the command line. Numeric IP addresses are also permitted (both on the command line and in HostName specifications).
HostName
IdentityFile Specify the file from which the user's RSA authentication identity is read. The default is $HOME/.ssh/identity in the user's home directory. Additionally, any identities represented by the authentication agent are used for authentication. The file name can use the tilde (~) syntax to refer to a user's home directory. You can specify multiple identity files in configuration files; all of these identities are tried in sequence. IdentityFile2 Specify the file from which the user's DSA authentication identity is read. The default is $HOME/.ssh/id_dsa in the user's home directory. The file name can use the tilde (~) syntax to refer to a user's home directory. You can have multiple identity files specified in configuration files; all of these identities are tried in sequence. KeepAlive Specify whether the system should send keepalive messages to the other side. If the messages are sent, death of the connection or crash of one of the systems are properly noticed. However, connections die if the route is down temporarily, which can be annoying. The default is yes (to send keepalives), which means the client notices if the network goes down or the remote host dies. This behavior is important in scripts, and many users also want it. To disable keepalives, set the value to no in both the server and the client configuration files. LocalForward Specify that a TCP/IP port on the local system be forwarded over the secure channel to a given host:port from the remote system. The first argument must be a port number, and the second must be host:port. You can specify multiple forwardings, and you can specify additional forwardings on the command line. Only superuser can forward privileged ports. LogLevel Specify the verbosity level used when logging messages from ssh. The possible values are QUIET, FATAL, ERROR, INFO, VERBOSE, and DEBUG. The default is INFO.
NumberOfPasswordPrompts Specify the number of password prompts before giving up. The argument to this keyword must be an integer. The default is 3.
Keyword PasswordAuthentication
Description
Specify whether to use password authentication. The argument to this keyword must be yes or no. Note that this option applies to both protocol versions 1 and 2. Port Protocol Specify the port number to connect on the remote host. The default is 22. Specify the protocol versions ssh should support, in order of preference. The possible values are 1 and 2. Comma-separate multiple versions. The default is 1,2, which means that ssh tries version 1 and falls back to version 2 if version 1 is not available.
ProxyCommand Specify the command to use to connect to the server. The command string extends to the end of the line and is executed with /bin/sh. In the command string, for %h substitute the host name to connect, and for %p substitute the port. The string can be any valid command and should read from its standard input and write to its standard output. It should eventually connect an sshd(1M) server running on some system or execute sshd -i somewhere. Host key management is done by use of the HostName of the host being connected (defaulting to the name typed by the user). Note that CheckHostIP is not available for connections with a proxy command. RemoteForward Specify that a TCP/IP port on the remote system be forwarded over the secure channel to a given host:port from the local system. The first argument must be a port number, and the second must be host:port. You can specify multiple forwardings and give additional forwardings on the command line. Only superuser can forward privileged ports. RhostsAuthentication Specify whether to try rhosts -based authentication. Note that this declaration affects only the client side and has no effect whatsoever on security. Disabling rhosts authentication can reduce authentication time on slow connections when rhosts authentication is not used. Most servers do not permit RhostsAuthentication, because it is not secure (see RhostsRSAAuthentication). The argument to this keyword must be yes or no. RhostsRSAAuthentication Specify whether to try rhosts -based authentication with RSA host authentication. This authentication method is the primary one for most sites. The argument must be yes or no. StrictHostKeyChecking If this option is set to yes, ssh never automatically adds host keys to the $HOME/.ssh/known_hosts file and refuses to connect hosts whose host key has changed. This option provides maximum protection against Trojan horse attacks. However, it can be inconvenient if you do not have good /etc/ssh_known_hosts files installed, and you frequently connect new hosts. This option forces the user to manually add any new hosts. Normally, this option is disabled, and new hosts are added automatically to the known host files. The host keys of known hosts are
Keyword
Description added automatically to the known host files. The host keys of known hosts are verified automatically in either case. The argument must be yes or no.
UsePrivilegedPort Specify whether to use a privileged port for outgoing connections. The argument must be yes or no. The default is yes. Note that setting this option to no turns off RhostsAuthentication and RhostsRSAAuthentication. User Specify the user to log in as. This option can be useful if you have different user names on different systems. Using this option means you do not need to enter the user name on the command line.
UserKnownHostsFile Specify a file to use instead of $HOME/.ssh/known_hosts. UseRsh Use rlogin or rsh for this host. It is possible that the host does not support the ssh protocol. ssh immediately executes rsh(1). All other options (except HostName) are ignored if you specify this option. The argument must be yes or no.
XAuthLocation Specify the location of the xauth(1) program. The default is /usr/openwin/bin/xauth. You determine the authentication method for a client by setting one of the following keywords to yes.
# # ident "@(#)sshd_config 1.3 01/10/08 SMI" # # Configuration file for sshd(1m) # # # # # # # # # # # Protocol versions supported The sshd shipped in this release of Solaris has support for major versions 1 and 2. It is recommended due to security weaknesses in the v1 protocol that sites run only v2 if possible. Support for v1 is provided to help sites with existing ssh v1 clients/servers to transition. Support for v1 may not be available in a future release of Solaris. To enable support for v1 an RSA1 key must be created with ssh-keygen(1). RSA and DSA keys for protocol v2 are created by /etc/init.d/sshd if they do not already exist, RSA1 keys for protocol v1 are not automatically created.
# Uncomment ONLY ONE of the following Protocol statements. # Only v2 (recommended) Protocol 2 # Both v1 and v2 (not recommended) #Protocol 2,1 # Only v1 (not recommended) #Protocol 1 # Listen port (the IANA registered port number for ssh is 22) Port 22 # The default listen address is all interfaces, this may need to be changed # if you wish to restrict the interfaces sshd listens on for a multi homed host. # Multiple ListenAddress entries are allowed. # IPv4 only #ListenAddress 0.0.0.0 # IPv4 & IPv6 ListenAddress :: # Port forwarding AllowTcpForwarding no # If port forwarding is enabled, specify if the server can bind to INADDR_ANY. # This allows the local port forwarding to work when connections are received # from any remote host. GatewayPorts no # X11 tunneling options X11Forwarding no X11DisplayOffset 10
# The maximum number of concurrent unauthenticated connections to sshd. # start:rate:full see sshd(1) for more information. # The default is 10 unauthenticated clients. #MaxStartups 10:30:60 # Banner to be printed before authentication starts. #Banner /etc/issue # Should sshd print the /etc/motd file and check for mail. # On Solaris it is assumed that the login shell will do these (eg /etc/profile). PrintMotd no CheckMail no # KeepAlive specifies whether keep alive messages are sent to the client. # See sshd(1) for detailed description of what this means. # Note that the client may also be sending keep alive messages to the server. KeepAlive yes # Syslog facility and level SyslogFacility auth LogLevel info # # Authentication configuration # # Host private key files # Must be on a local disk and readable only by the root user (root:sys 600). HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key # Default Encryption algorithms and Message Authentication codes Ciphers aes128-cbc,blowfish-cbc,3des-cbc MACS hmac-sha1,hmac-md5 # Length of the server key # Default 768, Minimum 512 ServerKeyBits 768 # sshd regenerates the key every KeyRegenerationInterval seconds. # The key is never stored anywhere except the memory of sshd. # The default is 1 hour (3600 seconds). KeyRegenerationInterval 3600 # Ensure secure permissions on users .ssh directory. StrictModes yes # Length of time in seconds before a client that hasn't completed # authentication is disconnected. # Default is 600 seconds. 0 means no time limit. LoginGraceTime 600
# Maximum number of retries for authentication # Default is 6. Default (if unset) for MaxAuthTriesLog is MaxAuthTries / 2 MaxAuthTries 6 MaxAuthTriesLog 3 # Are logins to accounts with empty passwords allowed. # If PermitEmptyPasswords is no, pass PAM_DISALLOW_NULL_AUTHTOK # to pam_authenticate(3PAM). PermitEmptyPasswords no # To disable tunneled clear text passwords, change PasswordAuthentication to no. PasswordAuthentication yes # Use PAM via keyboard interactive method for authentication. # Depending on the setup of pam.conf(4) this may allow tunneled clear text # passwords even when PasswordAuthentication is set to no. This is dependent # on what the individual modules request and is out of the control of sshd # or the protocol. PAMAuthenticationViaKBDInt yes # Are root logins permitted using sshd. # Note that sshd uses pam_authenticate(3PAM) so the root (or any other) user # maybe denied access by a PAM module regardless of this setting. # Valid options are yes, without-password, no. PermitRootLogin no # sftp subsystem Subsystem sftp # # # # # #
/usr/lib/ssh/sftp-server
SSH protocol v1 specific options The following options only apply to the v1 protocol and provide some form of backwards compatibility with the very weak security of /usr/bin/rsh. Their use is not recommended and the functionality will be removed when support for v1 protocol is removed.
# Should sshd use .rhosts and .shosts for password less authentication. IgnoreRhosts yes RhostsAuthentication no # Rhosts RSA Authentication # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts. # If the user on the client side is not root then this won't work on # Solaris since /usr/bin/ssh is not installed setuid. RhostsRSAAuthentication no # Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication. #IgnoreUserKnownHosts yes # Is pure RSA authentication allowed. # Default is yes RSAAuthentication yes
Lines have the format keyword arguments and are case sensitive. Table 85 lists valid keywords and their descriptions.
AllowTcpForwarding Specify whether TCP forwarding is permitted. The default is yes. Note that disabling TCP forwarding does not improve security unless users are also denied shell access, because they can always install their own forwarders. AllowUsers Follow this keyword with a space-separated list of names of users who are allowed to log in. If specified, login is allowed only for a user whose name matches one of the patterns. You can use asterisk (*) and question mark (?) as wildcards in the patterns. Only user names are valid; a numerical user ID is not recognized. By default, login is allowed regardless of the user name. Specify the ciphers allowed for protocol version 2. Comma-separate multiple ciphers. The default is 3des-cbc,blowfish-cbc,aes-128-cbc. Specify whether sshd checks for new mail for interactive logins. The default is no. You can follow this keyword with a space-separated list of group names. Users whose primary group matches one of the patterns are not allowed to log in. You can use asterisk (*) and question mark (?) as wildcards in the patterns. Only group names are valid; a numerical group ID is not recognized. By default, login is allowed regardless of the primary group. You can follow this keyword with a space-separated list of user names. Login is disallowed for user names that match one of the patterns. You can use asterisk (*) and question mark (?) as wildcards in the patterns. Only user names are valid; a numerical user ID is not recognized. By default, login is allowed regardless of the user name.
DenyUsers
DSAAuthentication Specify whether DSA authentication is allowed. The default is yes. Note that this option applies only to protocol version 2.
Keyword
Description
GatewayPorts Specify whether remote hosts are allowed to connect to ports forwarded for the client. The argument must be yes or no. The default is no. HostKey Specify the file containing the private RSA host key (default /etc/ssh_host_key) used by SSH protocols. The /etc/ssh/sshd_config file provides two HostKey lines, one for the v3 RSA key (/etc/ssh/ssh_host_rsa_key) and one for the v2 DSA key (/etc/ssh/ssh_host_dsa_key).
IgnoreRhosts Specify that .rhosts and .shosts files are not used in authentication. /etc/hosts.equiv and /etc/shosts.equiv are still used. The default is yes. IgnoreUserKnownHosts Specify whether sshd ignores the user's $HOME/.ssh/known_hosts file during RhostsRSAAuthentication. The default is no. KeepAlive Specify whether the system should send keepalive messages to the other side. If they are sent, death of the connection or crash of one of the systems is properly noticed. However, connections die if the route is down temporarily, which can be annoying. On the other hand, if keepalives are not sent, sessions can hang indefinitely on the server, leaving "ghost" users and consuming server resources. The default is yes (to send keepalives), and the server notices if the network goes down or the client host reboots. This option avoids infinitely hanging sessions. To disable keepalives, set the value to no in both the server and the client configuration files. KeyRegenerationInterval Automatically regenerate the server key after n seconds (if it has been used). Regeneration prevents decryption of captured sessions by someone later breaking into the system and stealing the keys. The key is never stored anywhere. If the value is 0, the key is never regenerated. The default is 3600 (seconds). ListenAddress Specify the local address on which sshd listens. The default is to listen to all local addresses. Multiple options of this type are permitted. Additionally, the Ports options must precede this option. LoginGraceTime Disconnect the server after n seconds if the user has not successfully logged in. If the value is 0, there is no time limit. The default is 600 (seconds). LogLevel Specify the verbosity level used when messages from sshd are logged. The possible values are QUIET, FATAL, ERROR, INFO, VERBOSE, and DEBUG. The default is INFO. Logging with level DEBUG violates the privacy of users and is not recommended. Specify the maximum number of concurrent, unauthenticated connections to the sshd daemon. Additional connections are dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10. Alternatively, you can enable random early drop by specifying the three colonseparated values start:rate:full (for example, 10:30:60). For this example,
MaxStartups
Keyword
separated values start:rate:fullDescription 10:30:60). For this example, (for example, sshd refuses connection attempts with a probability of 30 percent (rate/100) when there are currently 10 (from the start field) unauthenticated connections. The probability increases linearly and all connection attempts are refused if the number of unauthenticated connections reaches 60 (full).
PasswordAuthentication Specify whether password authentication is allowed. The default is yes. Note that this option applies to both protocol versions 1 and 2. PermitEmptyPasswords When password authentication is allowed, it specifies whether the server allows login to accounts with empty password strings. The default is no. PermitRootLogin Specify whether root can log in with ssh. The argument must be one of yes, without-password, or no. The default is no. When this options is set to withoutpassword, root can log in only through public key authentication; passwords are ignored. Note that the Secure Shell is integrated with the PAM subsystem. You can configure PAM to deny login access to root regardless of this setting. Root login with RSA authentication when the command option is specified is allowed regardless of the value of this setting. This setting might be useful for taking remote backups even if root login is normally not allowed. Port PrintMotd Specify the port number at which sshd listens. The default is 22. You can specify multiple options of this type. Specify whether sshd displays the contents of /etc/motd when a user logs in interactively. (On some systems, /etc/motd is also displayed by the shell or a shell startup file, such as /etc/profile.) The default is yes. Specify the protocol versions sshd supports. The possible values are 1 and 2. You must comma-separate multiple versions. The default is 2.
Protocol
RhostsAuthentication Specify whether authentication with rhosts or /etc/hosts.equiv files is sufficient. Normally, you should not permit this method because it is insecure. Use RhostsRSAAuthentication instead because it performs RSA-based host authentication in addition to normal rhosts or /etc/hosts.equiv authentication. The default is no. RhostsRSAAuthentication Specify whether rhosts or /etc/hosts.equiv authentication together with successful RSA host authentication is allowed. The default is no. RSAAuthentication Specify whether pure RSA authentication is allowed. The default is yes. Note that this option applies only to protocol version 1. ServerKeyBits
Keyword
Description Define the number of bits in the server key. The minimum value is 512, and the default is 768.
StrictModes
Specify whether sshd checks file modes and ownership of the user's files and home directory before accepting login. This behavior is normally desirable because novices sometimes accidentally leave their directory or files world-writable. The default is yes. Configure an external subsystem (for example, a file transfer daemon). Arguments should be a subsystem name and a command to execute on subsystem request. The command sftp-server(1M) implements the sftp file transfer subsystem. By default, no subsystems are defined. Note that this option applies only to protocol version 2.
Subsystem
SyslogFacility Give the facility code used when messages from sshd are logged. The possible values are DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, and LOCAL7. The default is AUTH. X11DisplayOffset Specify the first display number available for sshd X11 forwarding. This option prevents sshd from interfering with real X11 servers. The default is 10. X11Forwarding Specify whether X11 forwarding is permitted. The default is no. Note that disabling X11 forwarding does not improve security in any way, because users can always install their own forwarders. XAuthLocation Specify the location of the xauth(1) program. The default is /usr/openwin/bin/xauth. You determine the authentication method for a server by setting one of the following keywords to yes.
X11 Forwarding
The X Window system (also known as X11) lets you log in to a remote system, run X11 programs on
that system, and, if the X11 server program running on your local system controls the monitor at which you are working, displays the X11 program output there. If you use the Solaris rsh, rlogin, or telnet commands without SSH to log in to that remote system, you need to perform the following manual steps for this process to work properly. Before you log in to the remote system by using rsh, rlogin, or telnet, run xhost +remotesystem to give the remote system permission to send X11 datastreams from any X11 program to your local X11 server program. Once you log in to the remote system, set the DISPLAY environment variable to indicate the X11 server program to which all X11 client programs send their data streams (in this case, your X11 server program). The Secure Shell automates the X11 forwarding process and secures it by encrypting the X11 datastreams as they pass over the network. Sun disables the X11 forwarding feature by default. You must enable it for both the client and server by making the following changes to both the local and remote systems. In the /etc/ssh/ssh_config file, change
# ForwardX11 no
to
Forwardx11 yes
Be sure to remove the # comment character at the beginning of the line as well. This change takes effect the next time you run ssh. In the /etc/ssh/sshd_config file, change
X11Forwarding no
to
X11Forwarding yes
To make this change take effect, restart the Secure Shell daemon on both systems by running
You can now use ssh to log in to the remote system. Run an X11 client such as xterm to verify that X11 Forwarding works properly. If the xterm window is displayed on your local X11 display, then everything is working.
The first step in using public key authentication is to generate one or more public/private keypairs with the ssh-keygen(1) command. Refer to the ssh-keygen(1) manual page for detailed information on the different types of keypairs you can generate.
NOTE. You can have more than one keypair, and you can use each for a different purpose. For example, you can have one keypair for logging in as the root user on the Solaris systems on the manufacturing floor, and another for logging in as the backup administrator on the backup server, and so on. By default, the keypairs are stored in your $HOME/.ssh/ directory when you create them.
The following examples create several keypairs. In these examples, $HOME is /home/gmarler. The following example creates a default 1024-bit RSA keypair. This keypair is treated as your default RSA keypair for use with the SSH v2 protocol. The public key is stored at $HOME/.ssh/id_rsa.pub, and the private key is stored at $HOME/.ssh/id_rsa.
[ns3:/home/gmarler] $ ssh-keygen Enter file in which to save the key(/home/gmarler/.ssh/id_rsa): Generating public/private rsa key pair. Enter passphrase(empty for no passphrase): Enter passphrase. Enter same passphrase again: Enter passphrase again. Your identification has been saved in /home/gmarler/.ssh/id_rsa. Your public key has been saved in /home/gmarler/.ssh/id_rsa.pub. The key fingerprint is: md5 1024 d1:88:b9:5c:f1:28:0f:dd:6e:f3:fc:ea:af:3c:21:ed gmarler@ns3
The following example creates a 768-bit DSA keypair. This keypair is treated as your default DSA keypair for use with the SSH v2 protocol. The public key is stored as $HOME/.ssh/id_dsa.pub, and the private key is stored as $HOME/.ssh/id_dsa.
[ns3:/home/gmarler] $ ssh-keygen -b 768 -t dsa Enter file in which to save the key(/home/gmarler/.ssh/id_dsa): Generating public/private dsa key pair. Enter passphrase(empty for no passphrase): Enter passphrase. Enter same passphrase again: Enter passphrase again.
Your identification has been saved in /home/gmarler/.ssh/id_dsa. Your public key has been saved in /home/gmarler/.ssh/id_dsa.pub. The key fingerprint is: md5 768 1d:f0:f5:d5:bd:35:b1:ac:9a:2a:b9:7f:95:14:02:f0 gmarler@ns3
The following example creates a 512-bit RSA1 keypair (for use only with SSH protocol v1). This keypair is treated as your default RSA keypair for use with SSH v1 protocolSSH v1 supported only the use of RSA keys. The public key is stored at $HOME/.ssh/identity.pub, and the private key is stored at $HOME/.ssh/identity.
[ns3:/home/gmarler] $ ssh-keygen -b 512 -t rsa1 Enter file in which to save the key(/home/gmarler/.ssh/identity): Generating public/private rsa1 key pair. Enter passphrase(empty for no passphrase): Enter passphrase. Enter same passphrase again: Enter passphrase again. Your identification has been saved in /home/gmarler/.ssh/identity. Your public key has been saved in /home/gmarler/.ssh/identity.pub. The key fingerprint is: md5 512 bb:e2:c5:25:4d:d1:89:23:83:9e:89:51:4f:d0:5b:86 gmarler@ns3
The following example creates a 2048-bit RSA keypair for use when you log in to remote systems as the root user.
[ns3:/home/gmarler] $ ssh-keygen -b 2048 -f $HOME/.ssh/rootkey -C "Root Admin Keypair" Generating public/private rsa key pair. Enter passphrase(empty for no passphrase): Enter passphrase. Enter same passphrase again: Enter passphrase again. Your identification has been saved in /home/gmarler/.ssh/rootkey. Your public key has been saved in /home/gmarler/.ssh/rootkey.pub. The key fingerprint is: md5 2048 44:e0:26:4d:6a:93:6c:5c:88:ac:0a:87:e1:d6:ad:8b Root Admin Keypair
The following example creates a 1024-bit RSA keypair, with no passphrase, for use in automated
batch jobs to remote systems. You would use this keypair in cron jobs or scripts that use ssh.
NOTE. Because the keypair is not protected by a passphrase, it is only as secure as the permissions on the files you store it in.
[ns3:/home/gmarler] $ ssh-keygen -b 1024 -f $HOME/.ssh/nopasskey -C "Batch Jobs (no passphrase)" Generating public/private rsa key pair. Enter passphrase(empty for no passphrase): Press Return. Enter same passphrase again: Press Return. Your identification has been saved in /home/gmarler/.ssh/nopasskey. Your public key has been saved in /home/gmarler/.ssh/nopasskey.pub. The key fingerprint is: md5 1024 21:56:cb:8e:fb:1f:d1:1c:14:50:f2:88:09:f7:39:93 Batch Jobs (no passphrase)
[ns3:/home/gmarler] $ ssh-keygen -p -f $HOME/.ssh/rootkey Enter old passphrase: Enter old passphrase. Key has comment 'rsa w/o comment' Enter new passphrase(empty for no passphrase): Enter new passphrase. Enter same passphrase again: Enter new assphrase again. Your identification has been saved with the new passphrase.
The public key in each keypair is not used by the Secure Shell client. It is used by sshd on a remote host whenever you try to use ssh to log in to that remote host. But how does sshd on the remote host get access to your public key? When you use ssh to log in to a remote host, ssh on your local host contacts sshd on the remote host and tells sshd which user you want to log in as. sshd then looks into the .ssh subdirectory of that user's home directory for the authorized_keys file. If any of the public keys stored in that file match the private key you told ssh to use when logging in to the remote host, the Secure Shell grants you access to that account. The following example logs you in to a remote host as yourself with public key authentication. In this case, you're logging in as yourself, so you need to append one of your public keys into your $HOME/.ssh/authorized_keys file. For this example, assume that you are the user gmarler and use the key generated in the first example above.
Now you can try to log in to another host (that has the same home directory automounted) with the private key (specifying it with the i option to ssh) that matches the public key you appended to the authorized_keys file.
[ns3:/home/gmarler] $ ssh -i $HOME/.ssh/id_rsa ns1.gmarler.com Enter passphrase for key '/home/gmarler/.ssh/id_rsa': Enter key passphrase. Last login: Thu Oct 10 18:57:07 2002 from dhcp101.gmarler Sun Microsystems Inc. SunOS 5.8 Generic February 2000 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 Agent pid 17661 [ns1.gmarler.com:/home/gmarler] $
NOTE. The passphrase you are asked for is NOT your login password, but the passphrase entered for the private key when the keypair was created (or last changed).
The following example logs in to a remote host as the root user with public key authentication. In this case, you're trying to log in to a remote host as the root user, so you need to find some way to first log in to that host as root, then append the specific public key you want to use to that root's authorized_keys file (located at /.ssh/authorized_keys on that host). This time, use the key generated specifically for this purpose in the fourth example above.
NOTE. At this point you're already logged in to the remote host as root.
NOTE. Now you're back on your original system as the user gmarler.
[ns3:/home/gmarler] $ ssh -i $HOME/.ssh/rootkey ns1.gmarler.com -l root Enter passphrase for key '/home/gmarler/.ssh/rootkey': Enter key passphrase. Last login: Thu Oct 10 23:15:47 2002 from ns3 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 [ns1.gmarler.com:/] #
and is useless until it is decrypted. But, you have to enter a passphrase before using each private key to log in to a remote host, right? That would be true if you used each private key manually, as has been done so far. But that's where the ssh-agent program comes in.
The ssh-agent
The ssh-agent command has a simple and elegant purpose: it stores one or more of your decrypted private keys in memory so that ssh can use them without prompting you for the passphrase every time you use them. And, if you load all of your private keys into ssh-agent, ssh tries them all in sequence until it finds one that works. You don't have to specify a particular private key on the command line. How do you use ssh-agent? Each user must configure his login environment to properly start and stop this program for every shell he invokes. The following example shows the necessary changes to $HOME/.profile if you use the sh, ksh, or bash shells.
# Set up SSH-Agent if [ "$SSH_AUTH_SOCK" = "" -a -f /bin/ssh-agent ]; then eval `/bin/ssh-agent` fi # Kill the SSH-Agent when you log out... trap ' test -n "$SSH_AGENT_PID" && eval `/bin/ssh-agent -k` ' 0
The following example shows the changes needed to $HOME/.login and $HOME/.logout if you used the csh or tcsh shells.
$HOME/.login: # Start SSH-Agent eval `/bin/ssh-agent -c` $HOME/.logout: # Kill SSH-Agent if ( "$SSH_AGENT_PID" != "") then eval `/bin/ssh-agent -k` endif
Once you make these changes and log out and back in, each shell started inherits the environment variable settings that ssh-agent sets up (with the eval command) so that ssh knows how to communicate with ssh-agent. Also, the program is terminated whenever you log out, so you don't have hundreds of separate ssh-agent programs cluttering up the system. Now that ssh-agent has been set up and automatically starts every time you log in, you need to know how to decrypt and load your private keys into it.
ssh-add
You use ssh-add to decrypt and load each private key into your ssh-agent. The following example loads all the private keys you generated earlier. You can load the first three default identity keys (RSA, DSA, RSA1) just by running the ssh-add command with no arguments, as shown in the following example.
[ns3:/home/gmarler] $ ssh-add Enter passphrase for gmarler@ns3: Enter passphrase. Identity added: /home/gmarler/.ssh/identity(gmarler@ns3) Identity added: /home/gmarler/.ssh/id_rsa(/home/gmarler/.ssh/id_rsa) Identity added: /home/gmarler/.ssh/id_dsa(/home/gmarler/.ssh/id_dsa)
NOTE. This example worked this way only because the private keys all had the same passphrase. If they did not, then you would have to enter each passphrase when prompted.
[ns3:/home/gmarler] $ ssh-add $HOME/.ssh/rootkey Enter passphrase for /home/gmarler/.ssh/rootkey: Enter passphrase. Identity added: /home/gmarler/.ssh/rootkey(/home/gmarler/.ssh/rootkey)
Notice that nopasskey did not prompt for a passphrase because there is no passkey. It was simply loaded into the ssh-agent. You can see which keys are loaded into this particular ssh-agent with the ssh-add -l command.
[ns3:/home/gmarler] $ ssh-add -l md5 512 bb:e2:c5:25:4d:d1:89:23:83:9e:89:51:4f:d0:5b:86 gmarler@ns3(RSA1) md5 1024 d1:88:b9:5c:f1:28:0f:dd:6e:f3:fc:ea:af:3c:21:ed /home/gmarler/.ssh/id_rsa(RSA) md5 768 1d:f0:f5:d5:bd:35:b1:ac:9a:2a:b9:7f:95:14:02:f0 /home/gmarler/.ssh/id_dsa(DSA) md5 2048 44:e0:26:4d:6a:93:6c:5c:88:ac:0a:87:e1:d6:ad:8b /home/gmarler/.ssh/rootkey(RSA) md5 1024 21:56:cb:8e:fb:1f:d1:1c:14:50:f2:88:09:f7:39:93 /home/gmarler/.ssh/nopasskey(RSA)
You have now resolved the problem of having to manually enter the passphrase each time you use ssh. Because you now have the rootkey loaded in the ssh-agent, try logging into the remote system as root again.
[ns3:/home/gmarler] $ ssh ns1.gmarler.com -l root Last login: Thu Oct 10 23:16:11 2002 from ns3 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 [ns1.gmarler.com:/] #
Presto! No need to enter a passphrase again (except when you first log in to your account).
NOTE. The examples for these commands use public key authentication, discussed above, instead of password authentication. You won't see the commands prompting for passwords here. If you don't set up public key authentication, then you will be prompted for your account's password.
ssh
The ssh command is a secure replacement for rlogin, rsh, and telnet. It takes the same parameters as rlogin and rsh (and many more), so migration to this tool is easy. The following example logs in to a remote host as the root user.
[ns3:/home/gmarler] $ ssh ns1.gmarler.com -l root Last login: Thu Oct 10 23:51:09 2002 from ns3 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 Sun Microsystems Inc. SunOS 5.8 Generic February 2000 [ns1.gmarler.com:/] #
The following example creates a tar archive datastream of the ./src directory and transmits it to another host (by logging in to that host as the current user with ssh) to be extracted in the /tmp directory.
[ns3:/home/gmarler] $ tar cf - ./src | ssh ns1.gmarler.com "(cd /tmp; tar xf -)" [ns3:/home/gmarler] $
scp
The scp command is a secure replacement for the rcp command. It takes parameters similar to those of rcp, but is more flexible. The following examples show some ways to use the scp command. The following example copies the connect.sql file from the current directory to the /tmp directory on host ns1.gmarler.com, as the user gmarler.
49
00:00
The following example logs in to host ns1.gmarler.com as user gmarler and copies the file /tmp/connect.sql to the /tmp directory on the local system.
49
00:00
The following example recursively copies the ./bin/ directory on the local system to the /tmp/bin directory on system ns1.gmarler.com, as user gmarler.
[ns3:/home/gmarler] $ scp -r bin/ [email protected]:/tmp/bin ksh 100% |****************************| patch 100% |****************************|
1609 KB 349 KB
00:03 00:00
The following example logs in to host ns1.gmarler.com as the root user and copies the /etc/passwd file to the /tmp directory on the local system.
931
00:00
sftp
The sftp command is a secure replacement for the ftp command. It takes parameters similar to those of ftp, but is more flexible. The following example uses sftp to connect to the host ns1.gmarler.com as the current user, changes to the /tmp directory on the local system, and downloads connect.sql from that system to /tmp on the local system.
[ns3:/home/gmarler] $ sftp ns1.gmarler.com Connecting to ns1.gmarler.com... sftp > lcd /tmp sftp > lpwd Local working directory: /tmp sftp > get /home/gmarler/connect.sql sftp > quit
The following example uses sftp to connect to the host ns1.gmarler.com as the root user, changes to the /tmp directory on the local system, changes to the /etc directory on the remote system, and downloads the passwd file.
[ns3:/home/gmarler] $ sftp [email protected] Connecting to ns1.gmarler.com... sftp > lcd /tmp sftp > lpwd Local working directory: /tmp sftp > cd /etc sftp > pwd Remote working directory: /etc sftp > get passwd
[ns3:/home/gmarler] # cd /home [ns3:/home] # tar cf - gmarler | ssh ns1.gmarler.com -l root "(cd /home; tar xf -)"
PermitRootLogin yes
to
PermitRootLogin without-password
Once you have made the changes, restart the sshd daemon on each system with the following commands.
[ Team LiB ]
[ Team LiB ]
name can use a format like cn=admin, dc=xyz, dc=com. Solaris Print Manager uses the ldapclient command to determine the default LDAP server name. When more than one server is specified, the first one is automatically selected. See ldapclient(1M) for more information. Solaris Print Manager always displays printer entries from the current LDAP server. If this server is not the domain's LDAP master server, the list of printers displayed may not be the current list of printers. This mismatch can result when the LDAP replica server is out of sync with the master. Replica servers can have various update replication agreements. For example, when a change is made on the master, replica servers may be updated immediately or only once a day. When the selected LDAP server is an LDAP replica server, any updates are referred to the master server and are updated there. The printer list could be out of sync with the master until the replica is updated from the master. Although users can use the ldapadd and ldapmodify commands to update printer entries in the directory, this practice is not recommended. The printer-name attribute must be unique within the ou=printers container. If the printer name is not unique, modifications done with Solaris Print Manager or the lpset command may not be predictable. [ Team LiB ]
[ Team LiB ]
[ Team LiB ]
Package SUNWPSF
Description
The following print packages were removed from the Solaris 2.6 release. SUNWlpr LP print service (root). SUNWlpu LP print serviceClient (usr). SUNWlps LP print serviceServer (usr). Print commands from SUNWscpu have been moved into the SUNWscplp (SunSoft PrintSource Compatibility) package.
following features. Replacing the /etc/lp directory structure with a configuration database that can be stored in a user file ($HOME/.printers), a system file (/etc/printers.conf), an NIS map (printers.conf.byname), or an NIS+ FNS context. Using a more streamlined implementation that provides reduced client overhead and quicker and more accurate responses to print status requests. Using the lpset(1M) command to create the printers.conf file. Reducing the size of the package (183 Kbytes total) from previous Solaris releases. Providing interoperability with the BSD protocol available with SunOS 4.x, Solaris 2.x, HP-UX, and other systems, as described in RFC-1179.
[ Team LiB ]
NOTE. If you do not use the Solaris Print Manager to set up and manage printing, you must use some combination of the other components to completely manage printing in the Solaris Operating Environment.
Table 87 summarizes the features of the printing components, all of which are available in the Solaris 8 Operating Environment.
[ Team LiB ]
[ Team LiB ]
Starting with the Solaris 2.6 release, all the LP commands except for enable and disable have been moved from /usr/bin into /usr/sbin. The enable and disable commands are located in /usr/bin and /usr/lib/lp/local and are symbolically linked to the accept and reject commands. The lpsched daemon also schedules all local print requests, as shown in Figure 24, regardless of whether the requests are issued by users from an application or from the command line. In addition, the scheduler tracks the status of printers and filters. When a printer finishes printing a request, the scheduler schedules the next request if one is in the queue.
Each print client and print server must have only one LP scheduler running. Starting with the Solaris 9 release, the scheduler is started by the lpadmin command when a local printer is added to the system and stopped when the last local printer is removed from the system. Without rebooting the system, you can stop the scheduler with the /usr/sbin/lpshut command and restart the scheduler with the /usr/lib/lp/lpsched command. The scheduler for each system manages its own print requests. It waits for requests issued by the LP commands and then handles the requests in an appropriate manner.
be printed. In network printing, print filters process the file on the print client before it gets transmitted to the server. The LP print service uses filters to perform the following tasks. Convert a file from one data format to another so that it can be printed properly on a specific type of printer. Handle the special modes of printing that users may request with the -y option to the lp commandfor example, two-sided printing, landscape printing, draft- or letter-quality printing. Detect printer faults and notify the LP print service of them so that the print service can deliver alerts. Not every print filter can perform all these tasks. However, because each task is printer-specific, it can be implemented separately. A print filter can be as simple or as complex as needed. The Solaris Operating Environment provides print filters in the /usr/lib/lp/postscript directory to cover most PostScript printing situations in which the destination printer requires the data to be in PostScript format. You have to create and add filters to the system for non-PostScript printers.
# tail /varl/lp/logs/lpsched 06/01 14:51:50: Print services started. 06/01 16:52:27: Print services stopped. 06/02 15:43:44: build info: 01/08/00:18:06:11 06/02 15:43:44: Print services started. 06/02 17:04:25: Print services stopped. 06/04 10:34:00: build info: 01/08/00:18:06:11 06/04 10:34:00: Print services started. 06/04 16:53:05: Print services stopped. 06/05 09:34:59: build info: 01/08/00:18:06:11 06/05 09:34:59: Print services started. #
Tracking Forms
The LP print service helps you track which forms are mounted on each printer and notifies you when it cannot find the description of how to print on a form. You are responsible for creating form descriptions and mounting and unmounting the paper form in each printer, either as part of setting up a printer or in response to alerts from the LP print service. Users can specify the form on which they want a job to print. You (root) can mount a specific form and then tell the LP print service that the form is available and on which printer it is mounted. Alternatively, users can submit print requests specifying a particular form and requesting that the form be mounted. When the LP print service receives the request, it sends an alert message to the system administrator (root) requesting that the form be mounted.
completed. Users can request notification by e-mail when a job is successfully completed. Administrators are alerted to problems with printers and to requests for filters, forms, or character sets. For problems that require an administrator's attention, the LP print service default is to write an alert message to the system administrator's console window (that is, to the terminal on which root is logged in). As the system administrator, you can change the policy to receive alert messages by e-mail or a program of your choice. Or, you can choose to receive no alerts when printing problems occur. [ Team LiB ]
[ Team LiB ]
/usr/share/lib The terminfo database directory. /usr/sbin /usr/lib/lp /var/lp/logs lpsched.n /var/spool/lp requests.n[*]
[*]
The accept, reject, lpadmin, lpfilter, lpforms, lpmove, lpshut, lpsystems, and lpusers LP commands. The LP daemons, directories for binary files and PostScript filters, and the model directory (which contains the standard printer interface program). The logs for LP activities. Messages from lpsched. The spooling directory in which files are queued for printing. Information about completed print requests.
Moved from /var/lplogs starting with the Solaris 2.6 release. Note that the lpNet log was removed completely from the /var/lp/logs directory because the lpNet daemon is replaced by inetd, starting with the Solaris 2.6 release.
User Commands
The /usr/bin directory contains the lp and lpstat commands, with which users submit and monitor print requests. The directory also contains the enable and disable commands used to enable and disable printers. Users can customize their print requests by using options for the lp command, specifying forms, character sets, filters, titles, banners, and so forth. Table 89 summarizes the frequently used options for the lp command. These options can be used individually or combined in any order on the command line. When combining options, use a space between options and repeat the dash (-). For example, the following command specifies a destination printer, requests e-mail notification, and prints six copies of a file.
Destination Specify a destination printer by name. Mail Number Title Option Header Copy Write Send e-mail to the user who submitted the print request when the file has been printed successfully. Specify the number of copies to be printed. Specify a title for a print request (printed only on the banner page). Suppress printing of the banner page for an individual request. Put a header on each page of the print request. Copy the file before printing. Write a message to root's terminal when the file has printed successfully.
LP Configuration Files
The scheduler stores configuration information in LP configuration files located in the /etc/lp directory. You can check the contents of these files, but you should not edit them directly. The LP administrative commands provide input for the configuration files in the /etc/lp directory. The lpsched daemon administers and updates the configuration files. You should use the administrative commands any time you need to update any configuration file. Table 90 describes the contents of the /etc/lp directory.
Description Contains files that identify classes provided by the lpadmin c command. Contains descriptions of existing filters. Is the location in which to put files for each form. Initially, this directory is empty. Contains printer interface program files. Contains log files of printing activities. Contains the standard printer interface program. Contains directories for each (remote or local) printer setup. Each directory contains configuration information and alert files for an individual printer. Contains print wheel or cartridge files.
interfaces Directory logs model printers Link to /var/lp/logs Link to /usr/lib/lp/model Directory
pwheels
Directory
The printers directory has a subdirectory for each printer (local or remote) known to the system. The following example shows the subdirectories for the printers pinecone and sparc1.
% ls -l /etc/lp/printers drwxrwxr-x 2 lp lp 512 Jan 23 23:53 pinecone drwxrwxr-x 2 lp lp 512 Jan 11 17:50 sparc1 %
Within each of the printer-specific directories, the following files can describe the printer. alert.sh Shell to execute in response to alerts. alert.vars Alert variables. configuration Configuration file. users.deny List of users who are denied printer access. comment Printer description. The following example shows a typical configuration file for the printer pinecone, /etc/lp/printers/pinecone/configuration.
Banner: on: Always Content types: PS Device: /dev/term/b Interface: /usr/lib/lp/model/standard Printer type: PS Modules: default
Printer Definitions
The LP print service uses the terminfo database to initialize a local printer; to establish a selected page size, character pitch, line pitch, and character set; and to communicate the sequence of codes to a printer. The terminfo database directory is located in /usr/share/lib. Each printer is identified in the terminfo database with a short name. If necessary, you can add entries to the terminfo database, but it is a tedious and time-consuming process. Describing how to add entries to the terminfo database is beyond the scope of this book.
Directory Contains files for generating printing alerts, slow filters, and queue management programs. Directory Contains LP executables for the local system. Directory Contains locale information. Daemon Manage scheduling of LP print requests.
postscript Directory Contains all PostScript filter programs provided by the Solaris LP print service. These filters come with descriptor files in the /etc/lp/fd directory that tell the LP print service the characteristics of the filters and where to locate them.
LP Administrative Commands
The commands used to set up and administer the LP print service are in the /usr/sbin directory; they are listed in Table 92.
Log Files
The LP print service maintains two sets of log files: a list of current requests that are in the print queue (/var/spool/lp) and an ongoing history of print requests (/var/lp/logs/requests).
pine% ls /var/spool/lp/tmp/pine 20-0 21-0 pine% cat 21-0 C 1 D slw2 F /etc/default/login P 20 t simple U winsor s 0x1000
These files remain in their directories only as long as the print request is in the queue. Once the request is finished, the information in the files is combined and appended to the /var/lp/logs/requests file, which is described in the next section. Use the information in the /var/spool/lp logs if you need to track the status of a print request that is currently in the queue.
History Logs
The LP print service records a history of printing services in the lpsched and requests log files. These log files are located in the /var/lp/logs directory. You can use the information in these logs to diagnose and troubleshoot printing problems. The following example shows the contents of the /var/lp/logs directory.
requests.2 requests.1
The files with the .1 and .2 suffixes are copies of logs for previous days. Each day, the lp cron job cleans out the lpsched and requests log files; it keeps copies for two days. The most important log file for troubleshooting is the lpsched log, which contains information about local printing requests. The requests log contains information about print requests that have completed and are no longer in the print queue. Once a request is finished printing, the information in the /var/spool/lp log files is combined and appended to the /var/lp/logs/requests file.
The requests log has a simple structure, and you can extract data by using common UNIX shell commands. Requests are listed in the order in which they are printed and are separated by lines showing their request IDs. Each line below the separator line is marked with a single letter that identifies the kind of information contained in that line. Each letter is separated from the data by a single space. The following example shows the contents of a requests log.
# pwd /var/lp/logs # tail requests.2 = slw2-20, uid 200, gid 200, size 5123, Thu Nov 18 01:24:01 EST 2000 z slw2 C 1 D slw2 F /etc/motd P 20 t simple U irving s 0x0100 #
C D F f H
Character N
Content of Line The type of alert used when the print request was successfully completed. The type is the letter M if the user was notified by e-mail or W if the user was notified by a message to the terminal. The -o options. The priority of the print request. The list of pages printed. This single-letter line is included if the user asks for raw processing of the files (the -r option of the lp command). The character set or print wheel (or cartridge) used. The outcome of the request, shown as a combination of individual bits expressed in hexadecimal form. Although several bits are used internally by the print service, the most important bits are listed below. 0x0004 Slow filtering finished successfully. 0x0010 Printing finished successfully. 0x0040 The request was cancelled. 0x0100 The request failed filtering or printing.
O P p r S s
T t U x Y z
The title placed on the banner page. The type of content found in the file(s). The name of the user who submitted the print request. The slow filter used for the print request. The list of special modes to give to the print filters used to print the request. The printer used for the request. This printer differs from the destination (the D line) if the request was queued for any printer or a class of printers or if the request was moved to another destination.
Spooling Directories
Files queued for printing are stored in the /var/spool/lp directory until they are printed. Table 94 shows the contents of the /var/spool/lp directory.
File
Type
Description Lock file for the scheduler. Check for this file if the scheduler dies and won't restart.
SCHEDLOCK File admins bin fifos logs model requests system temp
Directory Linked to /etc/lp. Directory Linked to /usr/lib/lp/bin. Directory Contains pipes that convey networked print requests to and from the inet daemon. Link Link Linked to ../lp/logs where completed print requests are logged. Linked to /usr/lib/lp/model.
Directory Contains a directory for each configured printer where print requests are logged until printed. Users cannot access this log. Directory Contains a print status file for the system. Link Linked to /var/spool/lp/tmp/printer-name, which contains the spooled requests.
tmp
Directory Contains a directory for each configured printer where print requests are logged until printed. Changes to existing print requests are also recorded in this log.
[ Team LiB ]
[ Team LiB ]
1. It checks whether the user specified a destination printer name or printer class in one of the three valid styles. 2. If the user did not specify a printer name or class in a valid style, the command checks the user's PRINTER or LPDEST environment variable for a default printer name. 3. If neither environment variable for the default printer is defined, the command checks the .printers file in the user's home directory for the _default printer alias. 4. If the command does not find a _default printer alias in the .printers file, it then checks the SunSoft print client's /etc/printers.conf file for configuration information. 5. If the printer is not found in the /etc/printers.conf file, the command checks for any nameservice (NIS, NIS+, or LDAP). The client does not have a local print queue. The SunSoft print client sends its requests to the queue on the specified print server. The client writes the print request to a temporary spooling area only if the print server is not available or if an error occurs. This streamlined path to the server decreases the print client's use of resources, reduces the chance for printing problems, and improves performance.
add a printer in the nameservice, all SunSoft print clients on the network can access it. The SunSoft print client software locates printers by checking the following resources. Atomic, POSIX, or context-based printer name or class. User's PRINTER or LPDEST environment variable for the default printer. User's .printers file for a printer alias. SunSoft print client's /etc/printers.conf file. Nameservice (NIS, NIS+, LDAP, or NIS+ with FNS).
Print-Naming Enhancement
The Solaris 8 Operating Environment supports the printers database in the /etc/nsswitch.conf nameservice switch file. The printers database provides centralized printer configuration information to print clients on the network. With the printers database and corresponding sources of information in the nameservice switch file, print clients can automatically access printer configuration information without having it added to their own systems. Table 95 shows the default printers entry for each of the nameservice environments.
For example, if the nameservice is NIS, print client configuration information is looked up in the following order. user The $HOME/.printers file for the user. files The /etc/printers.conf file. nis The printers.conf.byname table.
If the nameservice is NIS+, print client configuration information is looked up in the following order. user The $HOME/.printers file for the user. nisplus The printers.org_dir table. files The /etc/printers.conf file. xfn The FNS printer contexts.
lp -d printer-name filename
POSIX style, which is the print command and option followed by server: printer and the file name.
Context-based style, as defined in the Federated Naming Service Guide in the Solaris Software Developer Answer Book.
1. A user submits a print request from a SunSoft print client by using a SunSoft print client command. 2. The print client command checks a hierarchy of print configuration resources to determine where to send the print request. 3. The print client command sends the print request directly to the appropriate print server. A print server can be any server that accepts the BSD printing protocol, including SVR4 (LP) print servers and BSD print servers such as the SunOS 4.x BSD print server. 4. The print server sends the print request to the appropriate printer. 5. The print request is printed. [ Team LiB ]
[ Team LiB ]
SunOS 5.0 print clients with a SunOS 5.0 print server. SunOS 5.0 and SunOS 4.1 print clients with a SunOS 5.0 print server. SunOS 5.0 and SunOS 4.1 print clients with a SunOS 4.1 print server. This section describes how to set up a Solaris print client.
LDAP. NIS. NIS+. NIS+ with Federated Naming Service (xfn ). You can use the Solaris Print Manager to manage printer configuration information in the NIS+ nameservice without the underlying xfn application layer. Eliminating the underlying xfn application layer provides better performance when accessing printer configuration information. See "Converting Printer Configuration in NIS+ (xfn) to NIS+ Format" on page 420 for more information You must be superuser or belong to a role that enables you to manage printing functions to use the Solaris Print Manager. See Chapter 6 , "Administering Rights and Roles," for more information about roles. Solaris Print Manager recognizes existing printer information on the printer servers, print clients, and in the nameservice databases. You do not need to convert print clients to use the new Solaris Print Manager as long as the print clients are running either the Solaris 2.6 release or compatible versions. Using Solaris Print Manager to perform printer-related tasks automatically updates the appropriate printer databases. Solaris Print Manager also includes a command-line console that displays the lp command line for the add, modify, and delete printer operations. Errors and warnings are also displayed when Printer Manager operations are performed. You can run Solaris Print Manager on a remote system with the display sent to the local system. See "Managing Printing Services" in System Administration Guide, Volume II , for instructions on setting the DISPLAY environment variable. See printmgr (1M) for more information.
3. Choose the appropriate nameservice from the Naming Service menu and click on the OK button. The Print Manager window is displayed, as shown in Figure 27 .
Description of the printer. Whether this printer is the default printer. Use the following steps to add access to a printer. 1. Start the Print Manager (if necessary). See "Starting Solaris Print Manager" on page 413 for more information. 2. From the Printer menu, choose Add Access to Printer, as shown in Figure 28 .
The Solaris Print Manager Add Access to Printer window is displayed, as shown in Figure 29 .
3. Type the printer name, name of the printer server, and description in the text fields. If you want
4.
3. this printer to be the default printer, click on the Default Printer check box. 4. Click on the OK button. The printer is configured, the printer information is added to the list in the Solaris Print Manager window, and the relevant files are updated. The name of the default printer is displayed at the bottom of the window, as shown in Figure 30 .
1.
printer available to the local computer. 1. Start the Print Manager (if necessary). See "Starting Solaris Print Manager" on page 413 for more information. 2. From the Print menu, choose New Attached Printer, as shown in Figure 31 .
Figure 31. Choose New Attached Printer from the Print Menu
Click on the Help button if you need help with details about values that are required for the text fields. 3. Fill in the form and click on the OK button. The printer is added to the Print Manager, and the appropriate databases and files are updated.
Protocol. Whether this printer is the default. Whether to always print banners. User access list. Use the following steps to add a new network printer. 1. Start the Print Manager (if necessary). See "Starting Solaris Print Manager" on page 413 for more information. 2. From the Printer menu, choose New Network Printer, as shown in Figure 33 .
Figure 33. Choose New Network Printer from the Printer Menu
Click on the Help button if you need help with details about values that are required for the text fields. 3. Fill in the form and click on the OK button. The printer is added to the Print Manager, and the appropriate databases and files are updated.
#!/bin/sh # # Copyright (C) 1999 by Sun Microsystems, Inc. # All Rights Reserved # PRINTER="" for LINE in `lpget -n xfn list | tr "\t " "Control A Control B?"` ; do LINE=`echo ${LINE} | tr "Control A Control B" "\t " | sed -e 's/^ \t//g'` case "${LINE}" in *:) PRINTER=`echo ${LINE} | sed -e 's/://g'` ;; *=*) lpset -n nisplus -a "${LINE}" ${PRINTER} ;; esac done
3. Type chmod 755 /tmp/convert and press Return. The script is executable. 4. Type /tmp/convert and press Return.
Printer type. The default is PostScript. File content type. The default is PostScript. Fault notification policy for this print server. The default is write to superuser. Use the following steps to set up a print server. 1. Set switches and ensure appropriate cabling. Consult the printer vendor installation documentation for information about hardware switches and cabling requirements. 2. Connect the printer to the network and turn on the power to the printer. 3. Get an IP address and select a name for the printer node. These procedures are equivalent to those for adding any new node to the network. 4. Become superuser. 5. Type lpadmin -p printer-name -v /dev/null and press Return. This step defines the printer name and the port device the printer uses. The device to use is /dev/null . 6. All on one line, type lpadmin -p printer-name -i /usr/lib/lp/model/netstandard and press Return. This step defines the interface script the printer uses. 7. All on one line, type lpadmin -p printer-name -o dest= access-name:port -o protocol= protocol -o timeout= value and press Return. This step sets the printer destination, protocol, and time-out values. 8. All on one line, type lpadmin -p printer-name- I content-type - T printer-type and press Return. This step specifies the file content type and the printer type. 9. Type cd /etc/lp/fd and press Return. The current working directory is in the filter directory. 10. Type for filter in *.fd;do and press Return. 11. At the > prompt, type name='basename $filter .fd' and press Return. 12. At the > prompt, type lpfilter -f $name -F $filter and press Return. 13. At the > prompt, type done and press Return. You have installed filters. 14. Type accept printer-name and press Return.
15.
14. The printer is able to accept requests. 15. Type enable printer-name and press Return. The printer is able to print the requests. 16. Type lpstat -p printer-name and press Return. This step verifies that the printer is configured correctly. 17. Set up any print clients that should have access to this printer. The following example sets up a print server by supplying the following information. Printer name: seachild Network printer access name: nimquat:9100 Protocol: tcp Time-out: 5 Interface: /usr/lib/lp/model/netstandard Printer type: PS Content types: postscript Device: /dev/null
# # # # # #
lpadmin -p seachild -v /dev/null lpadmin -p seachild -i /usr/lib/lp/model/netstandard lpadmin -p seachild -o dest:nimquat:9100 -o protocol=tcp -o timeout=5 lpadmin -p seachild -I postscript -T PS cd /etc/lp/fd for filter in *.fd;do > name='basename $filter .fd' > lpfilter -f $name -F $filter > done # accept castle destination ' 'castle' ' now accepting requests # enable castle printer ' 'castle' ' now enabled # lpadmin -p castle -D "PostScript printer" # lpstat -p castle printer castle is idle. enabled since Thu Sep 15 08:45 1997. available #
lpadmin -p printer -o banner or lpadmin -p printer -o banner=always Required and printed. If you are root or lp , the nobanner argument is honored. The nobanner argument is ignored for all other users. lpadmin -p printer -o nobanner lpadmin -p printer -o banner=optional On by default but can be disabled for each print request with the lp -o nobanner command. N/A. lpadmin -p printer -o banner=never Disabled. No.
1. Become superuser or lp on the print server. 2. Type lpadmin -p printer -o banner=optional and press Return. The banner page setting is entered in the /etc/lp/printers/ printer/configuration file on the print server. 3. Type lpstat -o printer -l and press Return. Review the output to verify that the Banner not printed line is displayed. The following example makes banner pages optional for the printer seachild .
seachild% su # lpadmin -p seachild -o banner=optional # lpstat -p seachild -l printer seachild is idle. enabled since Thu Jan 3 18:20:22 PST 2000. available. Content types: PS Printer types: PS Description: Users allowed: (all) Forms allowed: (none) Banner not required Character sets: (none) Default pitch: Default page size: #
3.
2.
the print server. 3. Type lpstat -o printer -l and press Return. Review the output to verify that the Banner not required line is displayed. The following example turns off banner pages for the printer seachild .
seachild% su # lpadmin -p seachild -o banner=never # lpstat -p seachild -l printer seachild is idle. enabled since Thu Jan 3 18:20:22 PST 2000. available. Content types: PS Printer types: PS Description: Users allowed: (all) Forms allowed: (none) Banner not printed Character sets: (none) Default pitch: Default page size: #
Before you start, you need superuser privileges on the print client system. You also need the name of the printer and the name of the print server system. You do not need to specify a printer type or file content type for a printer client. If no printer type is specified, the default is unknown . If no file content type is specified, the default is any , which allows both PostScript and ASCII files to be printed on a PostScript printer. Use the following steps to set up a PostScript print client. 1. Become superuser on the print client system. 2. Type lpsystem -t bsd server-system-name and press Return. The print server system is identified as a BSD (SunOS 4.x) system. 3. Type lpadmin -p printer-name -s server-system-name and press Return. The printer and the server system name are registered with the client LP print service. 4. Type cd /etc/lp/fd and press Return. 5. Type lpfilter -f download -F download.fd and press Return. 6. Type lpfilter -f dpost -F dpost.fd and press Return. 7. Type lpfilter -f postio -F postio.fd and press Return. 8. Type lpfilter -f postior -F postior.fd and press Return. 9. Type lpfilter -f postprint -F postprint.fd and press Return. 10. Type lpfilter -f postreverse -F postreverse.fd and press Return. The PostScript filters are installed. 11. Type accept printer-name and press Return. The printer is now ready to begin accepting (queuing) print requests. 12. Type enable printer-name and press Return. The printer is now ready to process print requests in the print queue. 13. (This step is optional but recommended.) Type lpadmin -d printer-name and press Return. The printer you specify is established as the default printer for the system. You should define a default printer even if only one printer is configured for a system. 14. Type lpstat -t and press Return. Check the messages displayed to verify that the printer is accepted and enabled. 15. Type lp filename and press Return. If you have not specified a default printer, type lp -d printer-name filename and press Return. The file you choose is sent to the printer.
If you want to set up Solaris print clients and print servers in addition to setting up the LP print system, you must also configure the port monitors by using the Service Access Facility. See "Understanding the Service Access Facility" on page 312 for information on how to set up the port monitors. If you use the Solaris Print Manager, the port monitors are configured for you automatically. To set up a Solaris print client, in place of step 2 in the procedure described above, type lpsystem server-system-name and press Return. The print server system is identified as a Solaris system.
[ Team LiB ]
[ Team LiB ]
If you submit a request to a printer that is not configured on your system, an informational message is displayed, as shown in the following example.
pine% lp -d thorn /etc/passwd UX:lp: ERROR: Destination "thorn" is unknown to the LP print service. pine%
Use the lpstat command to find out about the status of the LP print service. You can check on the status of your own jobs in the print queue, determine which printers are available for you to use, or determine request IDs of your jobs if you want to cancel them.
fred
1261
The lpstat command displays one line for each print job, showing the request ID followed by the name of the user who spooled the request, the output size in bytes, and the date and time of the request.
Availability of Printers
To find out which printers are configured on your system, type lpstat -s and press Return. The status of the scheduler is displayed, followed by the default destination and a list of the systems and printers that are available to you. In the following example, on the system elm, the scheduler is running, the default printer is pinecone, and two network printers are available.
elm% lpstat -s scheduler is running system default destination: pinecone system for pinecone: pine system for acorn: oak elm%
elm% lpstat -t scheduler is running system default destination: tom system for slw2: bertha system for slw1: bertha device for tom: /dev/term/b slw2 accepting requests since Thu May 11 11:01:54 EDT 2000 slw1 accepting requests since Sat May 27 16:26:38 EDT 2000 tom accepting requests since Sat Jun 3 14:25:41 EDT 2000 printer slw2 is idle. enabled since Thu May 11 11:01:55 EDT 2000. available. printer slw1 is idle. enabled since Thu May 27 16:26:38 EDT 2000. available. printer tom is idle. enabled since Sat Jun 3 14:25:41 EDT 2000. available. character set usascii character set english character set finnish character set japanese character set norwegian character set swedish character set germanic character set french character set canadian_french character set italian character set spanish character set line character set security character set ebcdic character set apl character set mosaic elm%
The -l option for lpstat, when used with one of the other options, gives you a long listing of the status of the LP print service. To display a long listing of all status information, type lpstat -tl and press Return. All available status information is displayed. In the following example for the same system, additional information is displayed. When files are spooled for printing, the status of those print requests is also displayed.
{:44} lpstat -tl scheduler is running system default destination: tom system for slw2: bertha system for slw1: bertha device for tom: /dev/term/b slw2 accepting requests since Thu May 11 11:01:54 EDT 2000 slw1 accepting requests since Sat May 27 16:26:38 EDT 2000 tom accepting requests since Sat Jun 3 14:25:41 EDT 2000 printer slw2 is idle. enabled since Thu May 11 11:01:55 EDT 2000. available. Content types: any Printer types: unknown Description: Users allowed: (all) Forms allowed: (none) Banner not required Character sets: (none) Default pitch: Default page size: printer slw1 is idle. enabled since Sat May 27 16:26:38 EDT 2000. available. Content types: simple Printer types: unknown Description: Located in ia lab Users allowed: (all) Forms allowed: (none) Banner not required Character sets: (none) Default pitch: Default page size: printer tom is idle. enabled since Sat Jun 3 14:25:41 EDT 2000. available. Form mounted: Content types: PS Printer types: la100 Description: hi Connection: direct Interface: /usr/lib/lp/model/standard After fault: continue Users allowed: (all)
Forms allowed: (none) Banner required Character sets: usascii english finnish japanese norwegian swedish germanic french canadian_french italian spanish line security ebcdic apl mosaic Default pitch: 10 CPI 6 LPI Default page size: 132 wide 66 long (More information not shown in this example)
elm% lpstat -p printer pinecone is idle. enabled since Sat Jan 1 18:20:22 PST 2000. available. printer acorn is idle. enabled since Thu Mar 2 15:53:44 PST 2000. available. elm%
To request status for an individual printer by name, type lpstat -p printer-name and press Return.
elm% lpstat -p pinecone -l printer pinecone is idle. enabled since Sat Jan 1 18:20:22 PST 2000. available. Content types: PS Printer types: PS Description: Users allowed: (all) Forms allowed: (none) Banner not required Character sets: (none) Default pitch: Default page size: elm%
Description Accept. Show whether print destinations are accepting requests. Class. Show classes and their members. Destination. Show default destination. Forms. Show forms. Output. Show status of output. Printer/description/long list. Show status of printers. Request. Request scheduler status. Show position of job in the queue. Sets. Show character sets. Status. Show status summary. User. Show requests by user. Show devices.
elm% cancel pinecone-3 pinecone-4 request "pinecone-3" cancelled request "pinecone-4" cancelled elm%
As system administrator, you can log in as root or lp and cancel the currently printing job by using the printer name as the argument for the cancel command.
[ Team LiB ]
[ Team LiB ]
[ Team LiB ]
1. Display the current search path. 2. Edit the file in which the user's path is set (.login for the C shell, .profile for the Bourne and Korn shells). Add the directory or rearrange the order of the path.
NOTE. For the C shell, always check both the .cshrc and .login files to make sure the path information is set all in one place. When you find path information in the .cshrc file, move it to the .login file. Duplicate entries can make the search path harder to troubleshoot and make search times less efficient for the user.
3. Source the file to activate the changes. See "Sourcing Bourne and Korn Shell Dot Files" and "Sourcing C Shell Dot Files" on page 437 for more information. 4. Verify that the command is found in the right place. 5. Execute the command. The tasks you use to follow this procedure are described in the following sections.
PATH=/usr/bin:/$HOME/bin:.;export PATH
The dot (.) at the end of the path specifies that the current working directory is always searched last.
$ . .profile $
The dot (.) at the end of the path specifies that the current working directory is always searched last.
oak% which openwin no openwin in . /home/ignatz /sbin /usr/sbin /usr/bin /etc/home/ignatz/bin /bin /home/bin /usr/etc oak%
The following example shows that the executable for OpenWindows is found among the directories in
If you cannot find a command, you can often look at the manual page to find its path name. For example, if you cannot find the lpsched command (the LP printer daemon), the lpsched(1M) manual page tells you the path is /usr/lib/lp/lpsched.
Executing a Command
To execute a command, type command-name and press Return. The command is executed if it is in the search path. You can always execute a command that is not in the search path by typing the full path name for the command. [ Team LiB ]
[ Team LiB ]
NOTE. You must own a file or directory (or have root permission) to be able to change its ownership. If the {_POSIX_CHOWN_RESTRICTED} configuration option is enabled (the default), you must be superuser to change ownership of a file, even if you own it. See "Changing File Ownership or Permissions (chown, chmod, chgrp)" on page 77 for more information.
1. Type ls -l filename and press Return. The owner of the file is displayed in the third column. 2. Become superuser. 3. Type chown new-owner filename and press Return. Ownership is assigned to the new owner you specify, in this case, ignatz.
oak% ls -l quest -rw-r--r-- 1 fred oak% su Password: # chown ignatz quest # ls -l quest
staff
6023 Aug
5 12:06 quest
-rw-r--r-#
1 ignatz
staff
For who, you can specify u, g, or o (for user, group, or other). You can specify a to change all operators. If you do not specify who the permissions are for, permissions are changed for all three groups. The operator is either + to add permission or to take away permission. The permissions are r, w, or x, for read, write, or execute. See the chmod(1) manual page for more information. For example, to grant read, write, and execute permissions to everyone, type chmod +wrx filename and press Return.
oak% chmod +wrx kookaburra oak% ls -l kookaburra -rwxrwxrwx 1 janice staff oak%
54
Jul 7
11:33
kookaburra
To grant read and execute permissions to everyone, type chmod +rx filename and press Return.
oak% chmod +rx kookaburra oak% ls -l kookaburra -r-xr-xr-x 1 janice staff oak%
54 Jul 7
11:34
kookaburra
Another way to change the permissions to read and execute only would be to deny write permission to everyone. Type chmod w filename and press Return.
staff
54 Jul 7
11:35
kookaburra
To change ownership for a specific group, type the letter for the group followed by the operator and the permission. In the following example, read, write, and execute permissions have been granted for the owner to the file kookaburra.
oak% chmod u+wrx kookaburra oak% ls -l kookaburra -rwxr-xr-x 1 janice staff oak%
54 Jul 7
11:36 kookaburra
To deny execute permissions to group and other, type chmod go-x filename and press Return.
oak% chmod go-x kookaburra oak% ls -l kookaburra -rwxr--r-- 1 janice staff oak%
54 Jul 7
11:37 kookaburra
With the chmod command, you can also use a numeric argument that describes the user class and permission to change as a sequence of bits. Table 98 shows the octal values for setting file permissions. You use these numbers in sets of three to set permissions for owner, group, and other. For example, the value 644 sets read/write permissions for owner and read-only permissions for group and other.
1. Type ls -l filename and press Return. The long listing shows the current permissions for the file. 2. Type chmod nnn filename and press Return. Permissions are changed according to the numbers you specify.
NOTE. You can change permissions on groups of files or on all files in a directory by using metacharacters such as * and ? in place of file names or in combination with them.
The following example changes the permissions of a file from 666 (read/write, read/write, read/write) to 644 (read/write, read-only, read-only).
oak% ls -l quest -rw-rw-rw- 1 ignatz oak% chmod 644 quest oak% ls -l quest -rw-r--r-- 1 ignatz oak%
staff
6023 Aug
5 12:06 quest
staff
6023 Aug
5 12:06 quest
$ ls -lg junk -rw-r--r-- 1 other 0 Oct 31 14:49 junk $ chgrp 10 junk $ ls -lg junk -rw-r--r-- 1 staff 0 Oct 31 14:49 junk $
The group ID is found in the group database indicated by the group entry in the /etc/nsswitch.conf Nameservice Switch configuration file or the local /etc/group file. [ Team LiB ]
[ Team LiB ]
Glossary
archive A copy of files, on secondary media, that have been removed from the system because they are no longer active.
auto_home The indirect automount map that you use to add home directories to the automounter.
automounter Software that can automatically mount several different types of file systems, for example, NFS, LOFS, HSFS, when a user changes that file system; unmounts the file system when it is no longer in use.
backing-store A bitmapped file created by the fssnap command, that contains copies of presnapshot data that has been modified since the snapshot was taken.
backup schedule The schedule you establish for a site to determine when you will regularly run the ufsdump command at different levels to back up user files and essential file systems. See full backup, incremental backup.
bang An exclamation point (!) that acts as a single-character UNIX command or as a separator
boot block An 8-Kbyte disk block that contains information used during booting. Block numbers point to the location of the boot program on that disk. The boot block directly follows the disk label.
booting The process of powering up a system, testing to determine which attached hardware devices are running, and bringing the operating system kernel into memory and operation at the run level specified by the boot command.
Bourne-Again shell A Bourne-shell-compatible language interpreter that executes commands read from the standard input or from a file. bash incorporates useful features from the Korn and C shells.
Bourne shell The default shell for the Solaris Operating Environment. The Bourne shell is a small shell for general-purpose use. It also provides a full-scale scripting language that you can use to develop shell scripts to capture frequently performed commands and procedures.
C shell A shell completely different from the Bourne and Korn shells with its own C language syntax. The most important advantages of the C shell are command history, command editing, and aliases.
cache A small, fast memory area that holds the most active part of a larger and slower memory.
CDE Common Desktop Environment is a windowing system based on the Motif graphical user interface.
core file An image of the state of a software program when it failed; used for troubleshooting. A core file can be created by any program, including the operating system kernel.
crash A situation when a system panics and dies. See also hang.
crash dump A core file image of the operating system kernel; saved in the swap partition when a system crashes. If crash dumps are enabled, the core image is written from the swap partition to a file.
cylinder group One or more consecutive disk cylinders that include inode slots for files.
cylinder group map A bitmap in a UFS file system that stores information about block use and availability within each cylinder group. The cylinder group replaces the traditional free list.
daemon A type of program that, once activated, carries out a specific task without any need for user input. Daemons typically are started when the system is started and don't die until the system shuts down. Daemons run in the background and do not generally require direct interaction with a user or system administrator. They handle day-to-day tasks for the system, such as printing (lpd), logging (syslogd), e-mail (sendmail), and serial port monitoring (ttymon).
diskette A nonvolatile storage medium used to store and access data magnetically. Solaris Operating Environment supports 3.5-inch, double-sided, high-density (DS, HD) diskettes.
diskless client A system with no local disk drive that instead relies on an NFS server for the operating system, swap space, file storage, and other basic services.
disk quotas A mechanism for controlling how much of a file system's resources any individual user can consume. Disk quotas are optional and must be configured and administered to be used.
DNS domain A hierarchical directory structure for e-mail addressing and network address naming. Within the United States, top-level domains include com for commercial organizations, edu for educational organizations, gov for governments, mil for the military, net for networking organizations, and org for other organizations. Outside the United States, top-level domains designate the country. Subdomains designate the organization and the individual system.
domain addressing Using an address contained in the Domain Naming System (DNS) to specify the destination of an e-mail message.
DS, HD Double-sided, high-density signifies the type of 3.5-inch diskettes supported by the Solaris Operating Environment.
dump
The process of copying directories, by using the ufsdump command, onto media (usually tape) for off-line storage.
DVD Digital Versatile Disc or Digital Video Disc uses the UDFS format for storing information.
dynamic reconfiguration The capability, available on certain SPARC servers, to remove and replace hot-pluggable system I/O boards in a running system, eliminating the time lost in rebooting.
e-mail Electronic mail. A set of programs that transmit mail messages from one system to another.
environment variable A system- or user-defined variable that provides information about the operating environment to the shell or a program.
file system A hierarchical arrangement of directories and files organized on a portion of a magnetic or optical disk.
Flash archive A file that contains a snapshot of all of the software on a master system. You use the Flash archive to replicate this installation configuration on clone systems of the same architecture.
Flash installation A feature that enables you to create a base configuration on a master system and then create a Flash archive file to replicate that configuration on clone systems of the same architecture.
full backup A complete, level 0 backup of a file system, done with the ufsdump command. See incremental backup.
fully qualified domain name The complete domain name that contains all the elements needed to specify one particular system in the world. See also DNS domain.
gateway A system that handles e-mail traffic between different communications networks.
GID The group identification number used by the system to control access to files and directories owned by other users.
group The sources of group account information used by Solaris. The sources are specified by the group entry in the Nameservice Switch configuration file.
hang A condition in which a system does not respond to input from the keyboard, a mouse, or the network.
home directory The part of the file system that is allocated to an individual user for private files.
hosts The sources of information used to map host names or host name aliases to IP addresses. The sources are specified by the hosts entry in the Nameservice Switch configuration file. The hosts entry in the Nameservice Switch configuration file is the only one that can specify dns in addition to the files, nis, nisplus, and ldap nameservices.
hot-plugging The ability to physically add, remove, or replace system components while a system is running. See dynamic reconfiguration.
incremental backup A partial backup of a file system that is performed by the ufsdump command. The backup includes only those files in the specified file system that have changed since a previous backup at a lower level. See full backup.
initialization files The dot files (files prefixed with .) in a user's home directory that set the path, environment variables, windowing environment, and other characteristics to enable users to use the system.
init state One of the seven initialization states, or run levels, a system can be running in. A system can run in only one init state at a time.
inode An entry in a predesignated area of a disk that describes the location of a file on that disk, the
size of the file, the time and date it was last used, and other identification information.
IP address A unique Internet protocol number that identifies each system in a network.
IPv4 Internet Protocol, version 4 is the default protocol for the Solaris 7 and earlier releases.
IPv6 Internet Protocol, version 6 adds increased address space and improves Internet functionality to the IPv4 protocol by use of a simplified header format, support for authentication and privacy, autoconfiguration of address assignments, and new quality-of-service capabilities.
kernel The master program set of Solaris software that manages all the physical resources of the computer, including file system management, virtual memory, reading and writing of files to disks and tapes, process scheduling, printing, and communications over a network.
Korn shell A shell that uses the same syntax as the Bourne shell but provides more built-in functions that can be defined directly from the shell as well as a sophisticated form of command editing.
LDAP Lightweight Directory Access Protocol is an industry-standard nameservice for accessing directory servers. LDAP is one of the nameservices provided by Solaris. Naming information is stored in containers on the LDAP server.
Live Upgrade An installation tool that enables you to create one or more duplicates of an existing boot environment. While the original system is still running, you can either upgrade or reinstall the inactive boot environment. You can also add patches to the inactive boot environment. Activate one of the duplicate boot environments and reboot. The original boot environment remains available if needed for failure recovery.
login name The name that is assigned to an individual user to control user ID access to a system.
metacharacter A symbol used in file names and extensions to represent another character or string of characters. An asterisk (*) matches any number of characters. A question mark (?) matches a single character.
monitor The program in the OpenBoot PROM that provides a limited set of commands that can be used before the kernel is available. See OpenBoot PROM.
mount point A directory in the file system hierarchy at which another file system is attached to the hierarchy.
Nameservice Switch configuration file The configuration file, /etc/nsswitch.conf, that specifies which nameservice database to search. Nameservices include files, NIS, NIS+, LDAP, and DNS.
netmask
A setting that determines how many and which bits in the host address space represent the subnet number and how many and which represent the host number. See also subnet mask.
NFS The default Solaris distributed file system that provides file sharing among systems. NFS servers can also provide kernels and swap files to diskless clients.
NFS failover The process of selecting an alternate NFS server for a particular file system from a list of servers, each of which contains an identical copy of the file system. Normally, the next NFS server in the sorted list is used unless it fails to respond.
NIS One of the nameservices provided by Sun that enables centralization of configuration information for user and group accounts, printing, e-mail aliases, the automounter subsystem, and some network security. In the process of being replaced by LDAP.
NIS+ One of the naming services supported by Solaris, intended as a replacement for NIS. Incorporates all of the features of NIS, adds better security, and fewer limitations in the size of information that can be stored, and allows delegation of administrative subdomains. Slated to be replaced by LDAP in the Solaris 10 timeframe.
OpenBoot PROM Programmable read-only memory is a chip containing permanent, nonvolatile memory and a limited set of commands used to test the system and start the boot process.
OpenWindows A windowing system based on the OPEN LOOK graphical user interface.
parse To resolve a string of characters or a series of words into component parts to determine their collective meaning. Virtually every program that accepts command input must do some sort of
parsing before the commands can be acted on. For example, the sendmail program divides an e-mail address into its component parts to decide where to send the message.
partition A discrete portion of a disk, configured with the format program. Also referred to as slice.
passwd The source of user account information used by Solaris. The sources are specified by the passwd entry in the Nameservice Switch configuration file.
path The list of directories that are searched to find an executable command.
path name A list of directory names, separated with slashes (/), that specifies the location of a particular file.
port A physical connection between a peripheral device (such as a terminal, printer, or modem) and the device controller.
port monitor A program that continuously watches for requests to log in or requests to access printers or files. The ttymon and listen port monitors are part of the Service Access Facility.
power cycling Turning off the power to a system and then turning it on again.
preen To run fsck with the -o p option, which automatically fixes any basic file system
inconsistencies normally found when a system halts abruptly but does not repair more serious errors.
remap To make use of a new server with NFS client failover. Through normal use, the clients store the path name for each active file on the remote file system. During remapping, these path names are evaluated to locate the files on the new server.
root The highest level of a hierarchical system. As a login ID, the user name of the system administrator or superuser who has responsibility for an entire system. Root has permissions for all user files and processes on the system. See also superuser.
runaway process A process that progressively uses more and more CPU time.
server A system that provides network services such as disk storage and file transfer; a program that provides such a service.
Service Access Facility (SAF) The part of the system software that is used to register and monitor port activity for modems, terminals, and printers. SAF replaces /etc/getty as a way to control logins.
shell
The command interpreter for a user, specified in the passwd database. The Solaris Operating Environment supports the Bourne (default), C, and Korn shells. The Solaris 8 Operating Environment also provides the freeware Bourne Again, TC, and Z shells.
snapshot A read-only image of a file system created by the fssnap(1M) command; can be used to back up a file system while the file system is mounted.
spooling directory A directory in which files are stored until they are processed.
spooling space The amount of space that is allocated on a print server for storing requests in the printer queue.
stand-alone system A system that has a local disk and can boot without relying on a server.
state flag A flag in the superblock that the fsck file system check program updates to record the condition of a file system. If a file system state flag is clean, the fsck program is not run on that file system.
subnet mask A setting that determines the bits in the host IP address bytes that are applied to subnet addresses and those applied to host addresses. See also netmask.
superuser A user who is granted special privileges by supplying the correct password with the su command or when logging in as root. For example, only the superuser can edit major administrative files in the /etc directory. See also root.
swap file A disk partition or file used to temporarily hold the contents of a memory area until they can be loaded back into memory.
symbolic link A file that contains a pointer to the name of another file.
system A computer with a keyboard and terminal. A system can have either local or remote disks and can have additional peripheral devices such as CD-ROM players, DVD-ROM players, tape drives, diskette drives, and printers.
tcsh An enhanced and completely compatible variation of the Berkeley UNIX C shell, csh(1); can be used as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control, and a C-like syntax.
UFS UNIX file system is the default disk-based file system for the Solaris Operating Environment.
UID The user identification number assigned to each login name. UID numbers are used by the
Universal Disc Format file system The UDFS file system is the industry-standard format for storing information on the optical media technology called DVD (Digital Versatile Disc or Digital Video Disc).
user account An account set up for an individual user in the passwd database; specifies the user's login name, UID, GID, login directory, and login shell.
user mask The setting that controls default file permissions that are assigned when a file or directory is created. The umask command controls the user mask settings.
virtual device A virtual device contains a snapshot of a file system, created by the fssnap(1M) command. The virtual device looks and acts like a real device to existing Solaris backup commands.
virtual memory A memory management technique that is used by the operating system for programs that require more space in memory than can be allotted to them. The kernel moves only pages of the program currently needed into memory; unneeded pages remain on the disk.
zombie A child process that has terminated but whose parent process has not properly reaped the child's exit status by calling one of the wait system calls (such as waitpid(1)). Zombie processes take up valuable process slot resources, and if you get enough of them, you won't be able to start any new processes. Zombie processes are removed from the process table when a system is rebooted. You can also use the preap(1) command, new in the Solaris 9 release, to
zsh A UNIX command interpreter that you can use as an interactive login shell and as a shell script command processor. The Z shell most closely resembles the Korn shell with enhancements. The Z shell provides command-line editing, built-in spelling correction, programmable command completions, shell functions (with autoloading), a history mechanism, and a host of other features.
[ Team LiB ]