UNIX Unleashed, System Administrator's Edition Table of Contents Introduction● Part I - Introduction to UNIX Chapter 1 - The UNIX Operating System● Chapter 2 - Getting Started: Basic Tutorial● Chapter 3 - Additional UNIX Resources● Chapter 4 - The UNIX File System● Chapter 5 - General Commands● Chapter 6 - Getting Around the Network● Chapter 7 - Communicating with Others● Part II - UNIX Shells Chapter 8 - What Is a Shell?● Chapter 9 - The Bourne Shell● Chapter 10 - The Bourne Again Shell● Chapter 11 - The Korn Shell● Chapter 12 - The C Shell● Chapter 13 - Shell Comparison● Part III - System Administration Chapter 14 - What Is System Administration● Chapter 15 - UNIX Installation Basics● Chapter 16 - Starting Up and Shutting Down● Chapter 17 - User Administration● Chapter 18 - File System and Disk Administration● Chapter 19 - Kernel Configuration● Chapter 20 - Networking● Chapter 21 - System Accounting● Chapter 22 - Performance and Tuning● Chapter 23 - Device Administration● Chapter 24 - Mail Administration● Chapter 25 - News Administration● Chapter 26 - UUCP Administration● Chapter 27 - FTP Administration● Chapter 28 - Backing Up and Restoring Your System● Glossary● ©Copyright, Macmillan Computer Publishing. All rights reserved. UNIX® Unleashed, System Administrator's Edition Robin Burk and David B. Horvath, CCP, et al Dedication To Stephen P. Kowalchuk, who provided an IS manager and practicing network administrator's point of view. Robin Burk This edition is dedicated to my parents and grandparents. Education and doing one's best was always important to them. David B. Horvath Acknowledgments Special thanks to Roger for support and grocery shopping. Also to the Laurelwood English Cockers, who intuitively understand how to negotiate a communications session (beg), allocate resources (if it's on the counter, it's ours!), and travel in encapsulated cells (show crates) over broadband highway networks. Robin Burk As with all the other projects I get involved with, my wife and muse, Mary, has been tremendously supportive. Even when I spent my evenings and weekends at the keyboard. Of course, she filled her time by shopping (she said this, not me). My parents, brothers, and the rest of family, who always wondered about the time I spent with computers, are now seeing the concrete results of it all. I've been involved with this project for close to a year now. The development staff were very helpful and have certainly kept it interesting. I want to thank them and the other authors (especially those that I talked into helping out). This certainly turned out to be a bigger project (and resulting book) than any of us expected. I hope and expect that people will be looking at these two volumes as the definitive reference! After I take a short rest, I will be looking for the next project. Although these things are really tiring, especially with the effort this one entailed, I miss them when I'm not working on one. David B. Horvath About the Authors Robin Burk has over 25 years' experience in advanced software, computer, and data communications technologies. She has provided technical and managerial leadership for the development of language tools, communications software, operating systems, and multimedia applications. A successful executive in entrepreneurial companies, she consults on software product development and the use of the Internet for business success. Robin's undergraduate degree is in physics and math. She also holds an MBA in finance and operations. Robin's other passion is breeding, training, and showing dogs. She moderates an e-mail list for English Cocker Spaniel fanciers and can be reached at robink@wizard.net. David B. Horvath, CCP, is a Senior Consultant with CGI Systems, Inc., an IBM Company, in the Philadelphia, Pennsylvania area. He has been a consultant for over twelve years and is also a part-time Adjunct Professor at local colleges teaching topics that include C Programming, UNIX, and Database Techniques. He is currently pursuing an M.S. degree in Dynamics of Organization at the University of Pennsylvania. He has provided seminars and workshops to professional societies and corporations on an international basis. David is the author of "UNIX for the Mainframer" and numerous magazine articles. When not at the keyboard, he can be found working in the garden or soaking in the hot tub. He has been married for over ten years and has several dogs and cats. David can be reached at unx2@cobs.com for questions related to this book. No Spam please! Fred Trimble holds a master's degree in computer science from Villanova University. In his nine years with Unisys Corporation, he held many positions, including UNIX system administrator, C programmer, and Oracle database administrator. Currently, he is a senior consultant and instructor with Actium Corporation in Conshohocken, Pennsylvania, specializing in C++, Java, and the Brio data warehousing product line. He is currently pursuing a master's degree in software engineering from Drexel University. Sanjiv Guha has 14 years of experience in managing and developing financial and other application systems. He specializes in C, UNIX, C++, Windows, and COBOL. Sanjiv holds a Master of Technology Degree from Indian Institute of Technology, New Delhi, India. William A. Farra's computer career started in the summer of 1978, working in a time sharing shop on a IBM 365. It had 768 KB, 8 disk packs totaling 125 MB and a cost of 10 million dollars. That fall, Mr. Farra went to the University of Delaware for electrical engineering and worked part time at Radio Shack playing with the trash 80's. He continued to work for the Shack until he met a bright guy who was writing custom programs for the larger computers the Shack sold. Bill took a full time job with him in September of 1983, working on Microsoft's first versions of UNIX (called Xenix at the time) and writing BASIC and C code. In 1985, Bill went out on his own for six years, writing UNIX-based data processing systems for various clients in the Philadelphia area including "Dan Peter Kopple and Associates," the architects who renovated 30th Station. Since 1991, Bill has returned to employment, developing and/or enhancing various systems including "Fraud Detection Delivery System" for MBNA and Settlement systems for EPS "MAC card ATM processor." Recently he got away from the "Big Cities" and is living at the Jersey Shore. He is a lead developer for National Freight Industries, working with various UNIX based systems including real-time tracking of vehicles using national transportation satellite and ground-based networks. Always keeping an eye on the future, Bill is just having more fun doing it now. Richard E. Rummel, CDP, is the president of ASM Computing, Jacksonville, Florida, which specializes in UNIX software development and end user training. He has been actively employed in the computer industry for over 20 years. Married for 25 years, he is the father of two children, a dog, and a cat. Sriranga Veeraraghavan is earning his B.E. from UC Berkeley in 1997. He is a GUI designer on UNIX, and currently uses Java for multiple Web-based applications. He is currently working at Cisco Systems. Sriranga amuses himself with Perl, Marathon and MacsBugs. Christopher Johnson is currently studying at Sheffield Hallam University in the UK for a degree in Electronic and Information Engineering. He is mostly self taught in the computer field, with experience being gained from helping other students, people on Usenet, and colleagues at work. He is part of a team that administers a Linux server on the university's network, and administers a web server on it. When not working, his interests include cycling and music, and he enjoys traveling. John Valley lives in Richmond, Virginia with his wife Terri and his Labrador retriever, Brandon. Mr. Valley currently operates a small practice as an independent consultant for UNIX and Windows tools and applications. With more than 20 years of experience in the computer industry, his background ranges from Cobol business applications and mainframe operating system development to UNIX tools and Windows programming. He teaches courses in C/C++ programming and UNIX fundamentals. Mr. Valley has published three books on UNIX topics and was a contributing author for the first edition of UNIX Unleashed. Sydney S. Weinstein, CDP, CCP, is a consultant, columnist, lecturer, author, professor, and president of Myxa Corporation, an Open Systems technology company specializing in helping companies move to and work with Open Systems. He has 20 years experience with UNIX dating all the way back to Version 6. Sean Drew is a distributed object software developer, working primarily with UNIX, C++, and CORBA. Sean is married to his college sweetheart Sheri and together they have two children, Dylan Thomas and Terran Caitlin. At the time of this writing a third child is on the way, and depending on the gender will probably be named Erin Nichole, Brenna Nichole, or Ryan Patrick. When Sean is not busy with his family or church, he likes to brew beer. Anybody up for a nice imperial stout? Sean can be reached at ninkasi@worldnet.att.net. Eric Goebelbecker has been working with market data and trading room systems in the New York City area for the past six years. He is currently the Director for Systems Development with MXNet Inc, a subsidiary of the Sherwood Group in Jersey City, New Jersey, where he is responsible for developing new market data and transaction distribution systems. Ron Rose is an international management consultant with over 20 years of data processing management experience. He has led large-scale data processing installations in Asia, Europe, and the United States, and he has managed several software product start-up efforts. He completed a master's in information systems from Georgia Institute of Technology after completing undergraduate work at Tulane University and the University of Aberdeen, Scotland. Lance Cavener is co-founder of Senarius. His function is to provide support to employers in Eastern Canada. Tasks such as payroll, work force deployment, and more are part of his business. He is also the President and Senior Network Administrator of ASCIO Communications, a subsidiary of Senarius. He provides the public and businesses with Internet related services. Lance has been actively involved in UNIX since 1990, as an administrator for corporate networks at various companies in Eastern Canada. His work includes working with BIND/DNS, Sendmail, Usenet setup, web servers, and UNIX security. He has also written various programs for SunOS, MS-DOS, MS-Windows, and VMS. David Gumkowski currently is a senior systems analyst for Digital Systems Group, Inc., Warminster, PA. Nineteen years ago, he emerged from his computing womb at Purdue University and cut his system administration teeth using Control Data and Texas Instruments machines. For the last 11 years, he developed his UNIX skills prodding Sun, Hewlett Packard, Digital Equipment and Silicon Graphics machines to behave for approximately 3,000 users. He would publicly like to thank his wife and children for their support when trying new things like writing chapters for this book. John Semencar is a senior software analyst for Thomas Jefferson University, Philadelphia, PA. Beginning system administration on Control Data legacy systems 10 years ago, and with a background that also includes DEC and SGI, he presently surrounds himself with Hewlett Packard 9000 servers running HP-UX v10.x. He would like to thank his wife Georgia and little Buster for their support. Steve Shah is a systems administrator for the Center of Environmental Research and Technology at the University of California, Riverside. He received his B.S. in Computer Science with a minor in Creative Writing from UCR and is currently working on his M.S. there as well. In his copious spare time, he enjoys writing fiction, DJing, and spending time with his friends, family, and sweet, Heidi. Daniel Wilson currently performs UNIX Systems Administration and Database Administration work for the Defense Finance and Accounting Services Financial Systems Organization, which is a financial organization within the Department of Defense. William D. Wood currently works at Software Artistry, Inc as a support specialist on UNIX systems. He supports the Expert Advisor software it runs on SUN OS, HP-UX and IBM AIX. He has specialized in multi-systems and remote systems support since 1985, when he started work at the Pentagon. He has solely supported infrastructures that span the world and just the U.S. He has also supported up to 80 UNIX machines at one time. William G. Pierce currently performs UNIX Systems Administration and is the Technical Lead for the MidTier Management Operation at the Defense Finance and Accounting Services, Financial Services Organization, Indianapolis, Indiana. Salim M. Douba (Salim_Douba@ott.usconnect.com) is a senior computer network consultant mainly specializing in UNIX, NetWare, and mainframe connectivity. He also designs and implements TCP/IP-based networks and enterprise network management solutions. Salim holds a master's degree in electrical engineering from the American University of Beirut. His experience and main career interests have primarily been in internetworking, multiplatform integration, and network analysis and management. Chris Byers is a systems administrator for a financial securities firm in Philadelphia. As a former consultant and disaster recovery specialist, he has many years of experience in the UNIX world with its many different variants. He lives in South Jersey with his wife, his son, and his cat. He can be reached at southst@voicenet.com. Jeff Smith is a psychology major who took a wrong turn and ended up working with computers. Jeff has worked with UNIX systems since 1982 as a programmer and systems administrator. He has administered mail, news, security, and the domain name system on several varieties of UNIX including 2.9 BSD, 4.3 BSD, Dynix, SunOS, and AIX. James C. Armstrong, Jr. is a software engineer with more than ten years of industry experience with UNIX and C. James Edwards (jamedwards@deloitte.ca) is an IT professional experienced in data communications, network integration, and systems design in both North America and Europe. He holds an M.S. in information technology from the University of London and a B.A. (Hons) from Middlesex University, both in the United Kingdom. James currently resides in Toronto, Canada, where he is employed as a manager with the Deloitte & Touche Consulting Group. His spare time is taken up with his girls, Denise, Lauren, and Poppy. Tell Us What You Think! As a reader, you are the most important critic and commentator of our books. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way. You can help us make strong books that meet your needs and give you the computer guidance you require. Do you have access to the World Wide Web? Then check out our site at http://www.mcp.com. NOTE: If you have a technical question about this book, call the technical support line at 317-581-3833 or send e-mail to support@mcp.com. As the team leader of the group that created this book, I welcome your comments. You can fax, e-mail, or write me directly to let me know what you did or didn't like about this book as well as what we can do to make our books stronger. Here's the information: Fax: 317-581-4669 E-mail: opsys_mgr@sams.mcp.com Mail: Dean Miller Comments Department Sams Publishing 201 W. 103rd Street Indianapolis, IN 46290 Introduction by Robin Burk and David B. Horvath, CCP Welcome to UNIX Unleashed, System Administrator's Edition. Who Should Read This Book Our highly popular first edition brought comprehensive, up-to-date information on UNIX to a wide audience. That original edition was already 1,600 pages. The new topics covered in this edition have obliged us to split the second edition into two volumes, namely, the System Administrator's Edition and the Internet Edition, which we'll refer to jointly as "the new" or the second edition. Though each volume can stand alone and may be read independently of the other, they form a complementary set with frequent cross-references. This new edition is written for: People new to UNIX● Anyone using UNIX who wants to learn more about the system and its utilities● Programmers looking for a tutorial and reference guide to C, C++, Perl, awk, and the UNIX shells ● System administrators concerned about security and performance on their machines● Webmasters and Internet server administrators● Programmers who want to write Web pages and implement gateways to server databases● Anyone who wants to bring his or her UNIX skills and knowledge base up-to-date● A lot has happened in the UNIX world since the first edition of UNIX Unleashed was released in 1994. Perhaps the most important change is the tremendous growth of the Internet and the World Wide Web. Much of the public Internet depends on UNIX-based servers. In addition, many corporations of all sizes have turned to UNIX as the environment for network and data servers. As UNIX fans have long known, the original open operating system is ideal for connecting heterogeneous computers and networks into a seamless whole. What's New in UNIX Unleashed, Second Edition This edition of UNIX Unleashed includes a substantial amount of new information describing Internet and World Wide Web technologies in UNIX. New topics include: Programming Web pages with HTML● Object-oriented programming in C++● Programming Common Gateway Interfaces (CGI) using Perl, C/C++, HTML, and the UNIX shells ● MIME, the Multipurpose Internet Mail Extension● HTTP, the HyperText Transfer Protocol● Web servers and server performance● As UNIX becomes the platform of choice for critical network and data applications, UNIX vendors have placed increased emphasis on system maturity, ease-of-use, and security capabilities. Even with the growth of Microsoft Windows NT, UNIX still has a place in the industry. It is more mature, more stable, more scaleable, and has a wider array of applications than NT. Many people claim that NT is the open operating system of the future; that may be true (I have my own personal opinion), but for now, UNIX holds that place. We've also updated this edition of UNIX Unleashed to bring you current information regarding: Frequently Asked Questions (FAQs) about the most popular variants of UNIX● Security issues and the technologies you can use to protect your system and its information against intruders and malicious users ● The most popular Graphical User Interfaces (GUIs)● As with the original edition, we set out to bring users the most comprehensive, useful, and up-to-date UNIX guide. To meet this goal, we've added nearly two dozen new chapters and have revised much of the original material in the book. The resulting book is so large that it is now divided into two volumes. The System Administrator's Edition introduces UNIX and contains much of the information required for basic users and for systems administrators. The Internet Edition includes advanced information for programmers, Internet/Web developers, and those who need detailed information regarding specific UNIX flavors. Coverage of Popular UNIX Variants Based on input from some of the experts, application developers, consultants, and system administrators working in industry, we have provided information about a number of the UNIX variants. We split the variants into two categories: major and minor. This is not a comment on the quality or capabilities of the variant, but on the penetration in the marketplace (popularity). We consider AIX, HP-UX, Solaris, and SVR4 to be major and BSD, IRIX, Linux, and SunOS to be minor players in the marketplace. There are other variants; the next edition may cover them as they become more popular. You can identify where something specific to a variant is discussed by the icon next to it: AIX major IBM's version that runs on the RS/6000 series of RISC systems and mainframes. Over 500,000 RS/6000 systems have been sold! ● BSD minor This version has a lesser presence in the marketplace. Although many variants can trace their heritage to BSD, it is not that popular as a product. ● HP-UX major Hewlett Packard's (HP) version with a strong hardware presence in the marketplace and a strong future growth path. ● IRIX minor While the Silicon Graphics (SGI) machines are wonderful for graphics, they● have not found wide acceptance in business environments. Linux minor Although this is a very nice and free variant, it has little commercial presence in the marketplace (probably because corporations do not want to run their mission-critical applications without a vendor they can sue when there is a problem). See the SAMS Linux Unleashed series books (Red Hat and Slackware) for detailed information. ● Solaris major Sun Microsystems' version with a strong hardware presence in the marketplace and a strong future growth path. ● SunOs minor Largely being superseded by Solaris installations. A good variant, but it is difficult for a company to support two versions of UNIX at a time. ● SVR4 major This version has a strong presence in the marketplace. In addition, many variants can trace their heritage to System V Release 4. ● CD-ROM Contents We've also enhanced our CD-ROM with a C compiler, the most popular Web server software, and megabytes of other useful tools and information. The CD-ROM packaged with each volume contains exactly the same software and materials. Here are some of the noteworthy inclusions: The entire text of both volumes in HTML format● Listings and code examples from various chapters in the volume● FreeBSD 2.2.5, full binary release● Linux RedHat 4.2, full binary release [x86 platform only]● BASH, sources and documentation.● sendmail version 8.7● RFCs 821, 822, 1425, 1123, 976, 977, 1036● latest version of INN source code● GNU findutils 4.1● GNU fileutils 3.16● xv-3.10a● disktool (v2.0)● tcl/tk● screen● xarchie● xrn● SATAN● Crack (or equivalent)● Perl 5.x● LaTeX● Lynx● elm and pine● pico● [...]... count all the words in all the files, you would type wc * and get output like that in Listing 1. 1 Listing 1. 1 Using a simple command $ wc * 3 51 2 514 10 11 5982 13 62 8496 $ 17 0 21 minix-faq 4 213 9 minix-info 5 916 0 total Commands Connected Through Pipes To turn the simple, orthogonal commands into a powerful toolset, UNIX enables the user to use the output of one command as the input to another This connection... detail The majority of UNIX users need to be familiar with the interface and need not understand the internal workings of UNIX The UNIX system is actually more than strictly an operating system UNIX includes the traditional operating system components In addition, a standard UNIX system includes a set of libraries and a set of applications Figure 1. 2 shows the components and layers of UNIX Sitting above... universities for educational use By 19 77, commercial licenses for UNIX were being granted, and the first UNIX vendor, Interactive Systems Corporation, began selling UNIX systems for office automation Later versions developed at AT&T (or its successor, Unix System Laboratories, now owned by Novell) included System III and several releases of System V The two most recent releases of System V, Release 3 (SVR3.2)... For information, address Macmillan Publishing, 2 01 West 10 3rd Street, Indianapolis, IN 46290 This material is provided "as is" without any warranty of any kind UNIX Unleashed, System Administrator's Edition -1The UNIX Operating System by Rachel and Robert Sartin, and Robin Burk Welcome to the world of UNIX Once the domain of wizards and gurus, today UNIX has spread beyond the university and laboratory... Coverage of Popular UNIX Variants sections also provide a quick means of referencing information How the System Administrator's Edition Is Organized The first volume, UNIX Unleashed, Systems Administrator Edition, consists of three major sections or parts The general focus is getting you started using UNIX, working with the shells, and then administering the system Part I, Introduction to UNIX, is designed... -h Header) For example, to print on pages with 16 lines each all the lines in the file minix-info that mention Tanenbaum, you would enter wc minix-info | pr -l 16 and get output like that in Listing 1. 3 Listing 1. 3 Using options in a pipeline $ grep Tanenbaum minix-info | pr -l 16 Feb 14 16 :02 19 94 Page 1 [From Andy Tanenbaum 28 August 19 93] The author of MINIX, Andrew S Tanenbaum, has... your command is as follows: ls -a -l $ ls visible $ ls -a .hidden visible $ ls -l total 0 -rw-rw-rw1 sartin uu 0 Mar 5 12 :58 visible $ ls -a -l total 16 drwxrwxrwx 2 sartin uu 10 24 Mar 5 13 :03 drwxr-xr-x 37 sartin uu 3072 Mar 5 13 :03 -rw-rw-rw1 sartin uu 0 Mar 5 12 :58 hidden -rw-rw-rw1 sartin uu 0 Mar 5 12 :58 visible $ A command developer often tries to choose option letters that are meaningful Regarding... NT operating systems Introduction to the UNIX Philosophy As described in the section "The History of UNIX, " UNIX has its roots in a system that was intended to be small and supply orthogonal common pieces Although most UNIX systems have grown to be fairly large, and monolithic applications are not uncommon, the original philosophy still lives in the core commands available on all UNIX systems There... give to your boss) In case you are working on a brand-new UNIX system, the basics of UNIX installation are covered Other topics covered in this section include: starting and stopping UNIX, user administration, file system and disk administration, configuring the kernel (core of the operating system) , networking UNIX systems, accounting for system usage, device (add-on hardware) administration, mail... initial design for a file system that later evolved into the UNIX file system An early version of the system was developed to take advantage of a PDP-7 computer that was available to the group An early project that helped lead to the success of UNIX was its deployment to do text processing for the patent department at AT&T This project moved UNIX to the PDP -11 and resulted in a system known for its small . UNIX Unleashed, System Administrator's Edition Table of Contents Introduction● Part I - Introduction to UNIX Chapter 1 - The UNIX Operating System Chapter 2 - Getting. Chapter 10 - The Bourne Again Shell● Chapter 11 - The Korn Shell● Chapter 12 - The C Shell● Chapter 13 - Shell Comparison● Part III - System Administration Chapter 14 - What Is System Administration●. documentation.● sendmail version 8.7● RFCs 8 21, 822, 14 25, 11 23, 976, 977, 10 36● latest version of INN source code● GNU findutils 4 .1 GNU fileutils 3 .16 ● xv-3 .10 a● disktool (v2.0)● tcl/tk● screen●