Basics of System Administration on a Unix System Contents

Total Page:16

File Type:pdf, Size:1020Kb

Basics of System Administration on a Unix System Contents Basics of system administration on a Unix system Contents Introduction 3 Unix 9 User environment: the shell 10 File management: starting from / 11 Text editing 12 Package management 13 User management 14 Process management 15 Networking services 16 Web 17 Database 18 Mail 19 Users 20 Files 21 DNS 22 Printing 23 Credits 24 This is a development version of the text that should be considered a work-in-progress. Copyright © 2011 Dara Adib. This is a freely licensed work, as explained in the Definition of Free Cultural Works (freedomdefined.org). It is licensed under the Creative Commons Attribution- Share Alike 3.0 United States License. To view a copy of this license, visit: http://creativecommons.org/licenses/by-sa/3.0/ 2 Introduction What is a computer? A computer is a combination of hardware and software that can store, retrieve, and process infor- mation. Hardware Hardware is the physical electronics of a computer, which include one or more processors (“the brain”), random-access memory (“short-term memory”), disk (“long-term memory”), input/output devices (“sense/motor organs”), power supply, and complex circuitry and buses which connect components. Software Software is the conceptual instructions that run on hardware, including system programs and application programs. An operating system is an essential software component. What is an operating system? An operating system (OS) is a collection of system programs (and depending on definition, application programs) that accomplish User abstraction through hardware, file, process, and user manage- ment (and depending again on definition, by providing a user Application environment). Operating System Hardware management An operating system deals with the physical complexity of initial- Hardware izing, calibrating, polling, and resetting hardware components. It provides a uniform interface to hardware components that is in- Figure 0.1: What is an OS? dependent of physical technicalities. Hardware components can fail or have temporary (transient) errors, which an operating sys- tem should detect and account for to prevent downtime or data corruption as much as possible. 3 File management An operating system provides, with the help of a file system, a uniform interface to storing, re- trieving, and modifying programs and data with hierarchical organization (for example, files are organized in directories or folders). Most changes made by other programs in a file system are written to physical disk at intervals and journaled for recovery in the case of disk or power fail- ure. A file system may also include special files like references to other files, interfaces to running programs, and interfaces to physical or virtual devices. Process management In a modern operating system, many programs appear to be running “simultaneously”. In real- ity, each processor (for simplicity, each processing core represents a processor) is only capable of handling one thread of execution at a time. Since each running program (known as a process) represents at least one thread, an operating system must switch between running threads as opti- mal and in a way that is least disruptive to the processes. In multiprocessor systems, an operating system must also effectively distribute threads between processors. There are also security concerns, which are of special importance in a multi-user system, where users do not all trust each other. All processes are allocated space in random-access memory (RAM) where they store and manipulate data. They need to be prevented from gaining access to space reserved for other processes. Not all processes are of equal importance. For example, a typical process should not be able to terminate or kill other processes, particularly those belonging to other users. Nevertheless, processes may need to communicate with each other through signals or interfaces. User management An operating system needs to provide a way for a user to, well, use a computer. Generally this involves the user authenticating with a username and password, and having some degree of secu- rity and privacy with his1 files and processes. There may be limitations on how much disk space and processing time he can use. He might also have other privileges or restrictions depending on security policy. Modern operating systems are multi-user, which means that multiple users can co-exist and can usually time-share resources at the same time (for example, multiple user logged in). There is often an administrator or superuser who can bypass restrictions for system administration tasks. User environment A user environment (the software a user interacts with to use the computer) is often considered part of the operating system. A user environment can be graphical (GUI, for graphical user in- terface) or text-based (CLI, for command line interface, also known as terminal, command line, and command prompt). With a text-based environment, there is usually a prompt which waits for commands to be entered and after a command is entered, outputs some result and waits for the 1For the purposes of simplicity, the masculine pronoun is used in this text, but gender is not specified. 4 next command. With a graphical environment, the user is usually encouraged to point and click the mouse. Graphical environments are often called “user-friendly” because they require less knowledge to use, but text-based environments often offer more flexibility and power at the expense of some knowledge and experience. Networking Most computers today are connected to a network, over wired or wireless connections. A network can be small, such as a home network connected by a small router, medium-sized, such as a uni- versity or corporate network, or large, such as the Internet which is connected by many gateways with high bandwidth and throughput. Modern operating systems include features specifically designed for networked applications. Hardware management • communicating with other computers, gateways, and switches through a network interface like ethernet (wired or wireless) File management • networked file systems (access data over network) • distributed file systems (split data over multiple computers) Process management • computing distributed over a cluster of nodes (physically distinct machines) User management • remote user access • remote authentication mechanisms (for example, an institution may have many machines that authenticate to the same database of users) What is Unix? UNIX is an operating system originally developed in 1969 by AT&T at Bell Labs. It was re- written in 1972 in the programming language C, which allowed it to be portable, i.e. work on different hardware. For simplicity, Unix will be used to refer to the family of operating systems that have been (mostly) designed as UNIX-compatible or UNIX-compatible-compatible, which include, among many others, variants of the Berkeley Software Distribution (such as FreeBSD, NetBSD, OpenBSD, and Mac OS X), GNU/Linux (such as Debian, Ubuntu, Red Hat, Fedora, Gen- too, and Arch), and Solaris. 5 1970 1980 1990 2000 Time FreeBSD 7.2 BSD family NetBSD 5.0 OpenBSD 4.5 BSD (Berkeley Software Distribution) Bill Joy SunOS (Stanford) Solaris (SUN) 10 5/09 Darwin NextStep 3.3 MacOS X 5.7 Xenix OS Microsoft/SCO GNU/Hurd K16 GNU Project Richard Stallman GNU/Linux 2.6.30.1 Minix Linus Torvalds 3.1.3a Andrew S. Tanenbaum Unix Time-Sharing System (Bell Labs) 10 Ken Thompson Dennis Ritchie (C language) HP-UX 11i v3 AIX (IBM) 6.1 UnixWare (Univel/SCO) 7.1.4 MP4 IRIX (SGI) 6.5.30 System III & V family Figure 0.2: What is Unix? Unix is a multi-user time-sharing network operating system, making it one of the original mod- ern operating systems. According to the so-called Unix philosophy, it is implemented with: • programs that do one thing and do them well • programs that communicate well with other programs Though many user environments have been developed for Unix, both text-based and graphical, the text-based shell is strongly associated with Unix. Perhaps this is because of how well the shell allows a user to exploit the features of Unix. Even Apple, associated with hip and aestheti- cally pleasing computers, implements Mac OS X on Unix (BSD) and includes the GNU Bash shell (GNU/Linux). What is system administration? System administration is the maintenance and operation of a computer system. It usually involves installing, maintaining, and supporting servers, and responding to services outages when they occur. It can also include a broader range of associated tasks, such as planning, scripting, training, consulting, and perhaps most importantly, problem solving. A system administrator (sysadmin) must not only be technically skilled, but also responsible and trustworthy. Sysadmins need to be responsible for the availability and security of services that a computer system provides. He must also use his power wisely2. 2See The Bastard Operator From Hell (Plan Nine, ISBN 1-929462-17-4). 6 Figure 0.3: System administration What is free software / open source software? Free software is software that can be freely run, studied, modified, adapted, improved, copied, distributed, and redistributed. For both ethical and practical reasons, developers of free software give access to the software source code that determines how a program functions and release the software under liberal licenses that impose few restrictions. Free software directly contrasts with proprietary software, where copyright and contracts impose restrictions. Definition Richard Stallman, founder of the GNU Project, lists four essential freedoms that must all be present for a piece of software to be considered free. 1. The freedom to run the program, for any purpose. 2. The freedom to study how the program works, and adapt it to your needs. Access to the source code is a precondition for this. 3. The freedom to redistribute copies so you can help your neighbor. 4. The freedom to improve the program, and release your improvements (and modified ver- sions in general) to the public, so that the whole community benefits.
Recommended publications
  • Oracle Solaris: the Carrier-Grade Operating System Technical Brief
    An Oracle White Paper February 2011 Oracle Solaris: The Carrier-Grade Operating System Oracle White Paper—Oracle Solaris: The Carrier-Grade OS Executive Summary.............................................................................1 ® Powering Communication—The Oracle Solaris Ecosystem..............3 Integrated and Optimized Stack ......................................................5 End-to-End Security ........................................................................5 Unparalleled Performance and Scalability.......................................6 Increased Reliability ........................................................................7 Unmatched Flexibility ......................................................................7 SCOPE Alliance ..............................................................................7 Security................................................................................................8 Security Hardening and Monitoring .................................................8 Process and User Rights Management...........................................9 Network Security and Encrypted Communications .......................10 Virtualization ......................................................................................13 Oracle VM Server for SPARC .......................................................13 Oracle Solaris Zones .....................................................................14 Virtualized Networking...................................................................15
    [Show full text]
  • Introduction to Unix
    Introduction to Unix Rob Funk <[email protected]> University Technology Services Workstation Support http://wks.uts.ohio-state.edu/ University Technology Services Course Objectives • basic background in Unix structure • knowledge of getting started • directory navigation and control • file maintenance and display commands • shells • Unix features • text processing University Technology Services Course Objectives Useful commands • working with files • system resources • printing • vi editor University Technology Services In the Introduction to UNIX document 3 • shell programming • Unix command summary tables • short Unix bibliography (also see web site) We will not, however, be covering these topics in the lecture. Numbers on slides indicate page number in book. University Technology Services History of Unix 7–8 1960s multics project (MIT, GE, AT&T) 1970s AT&T Bell Labs 1970s/80s UC Berkeley 1980s DOS imitated many Unix ideas Commercial Unix fragmentation GNU Project 1990s Linux now Unix is widespread and available from many sources, both free and commercial University Technology Services Unix Systems 7–8 SunOS/Solaris Sun Microsystems Digital Unix (Tru64) Digital/Compaq HP-UX Hewlett Packard Irix SGI UNICOS Cray NetBSD, FreeBSD UC Berkeley / the Net Linux Linus Torvalds / the Net University Technology Services Unix Philosophy • Multiuser / Multitasking • Toolbox approach • Flexibility / Freedom • Conciseness • Everything is a file • File system has places, processes have life • Designed by programmers for programmers University Technology Services
    [Show full text]
  • KUNCI JAWABAN CHAPTER 2 CCNA-RS-ITN-SIM-1 Configuring a Network Operating System Chapter 2 Exam
    KUNCI JAWABAN CHAPTER 2 CCNA-RS-ITN-SIM-1 Configuring a Network Operating System Chapter 2 Exam Mandar 3 Oktober 2016 CCNA-RS-ITN-SIM-Ganjil-2016 MANDAR 3 OKTOBER 2016 KUNCI JAWABAN CHAPTER 2 1. Which two features are characteristics of flash memory? (Choose two.) Flash provides nonvolatile storage. The contents of flash may be overwritten. 2. A network administrator is planning an IOS upgrade on several of the head office routers and switches. Which three questions must be answered before continuing with the IOS selection and upgrade? (Choose three.) What models of routers and switches require upgrades? Do the routers and switches have enough RAM and flash memory for the proposed IOS versions? What features are required for the devices? 3. Which procedure is used to access a Cisco 2960 switch when performing an initial configuration in a secure environment? Use the console port to locally access the switch from a serial or USB interface of the PC. 4. A network administrator needs to keep the user ID, password, and session contents private when establishing remote CLI connectivity with a switch to manage it. Which access method should be chosen? SSH 5. A router has a valid operating system and a configuration stored in NVRAM. When the router boots up, which mode will display? user EXEC mode 6. Which two functions are provided to users by the context-sensitive help feature of the Cisco IOS CLI? (Choose two.) displaying a list of all available commands within the current mode determining which option, keyword, or argument is available for the entered command 7.
    [Show full text]
  • Unix/Linux Command Reference
    Unix/Linux Command Reference .com File Commands System Info ls – directory listing date – show the current date and time ls -al – formatted listing with hidden files cal – show this month's calendar cd dir - change directory to dir uptime – show current uptime cd – change to home w – display who is online pwd – show current directory whoami – who you are logged in as mkdir dir – create a directory dir finger user – display information about user rm file – delete file uname -a – show kernel information rm -r dir – delete directory dir cat /proc/cpuinfo – cpu information rm -f file – force remove file cat /proc/meminfo – memory information rm -rf dir – force remove directory dir * man command – show the manual for command cp file1 file2 – copy file1 to file2 df – show disk usage cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it du – show directory space usage doesn't exist free – show memory and swap usage mv file1 file2 – rename or move file1 to file2 whereis app – show possible locations of app if file2 is an existing directory, moves file1 into which app – show which app will be run by default directory file2 ln -s file link – create symbolic link link to file Compression touch file – create or update file tar cf file.tar files – create a tar named cat > file – places standard input into file file.tar containing files more file – output the contents of file tar xf file.tar – extract the files from file.tar head file – output the first 10 lines of file tar czf file.tar.gz files – create a tar with tail file – output the last 10 lines
    [Show full text]
  • A Ballista Retrospective
    Software Robustness Testing A Ballista Retrospective Phil Koopman [email protected] http://ballista.org With contributions from: Dan Siewiorek, Kobey DeVale John DeVale, Kim Fernsler, Dave Guttendorf, Nathan Kropp, Jiantao Pan, Charles Shelton, Ying Shi Institute for Complex Engineered Systems Overview Introduction • APIs aren’t robust (and people act as if they don’t want them to be robust!) Top 4 Reasons people give for ignoring robustness improvement • “My API is already robust, especially for easy problems” (it’s probably not) • “Robustness is impractical” (it is practical) • “Robust code will be too slow” (it need not be) • “We already know how to do it, thank you very much” (perhaps they don’t) Conclusions • The big future problem for “near-stationary” robustness isn’t technology -- it is awareness & training 2 Ballista Software Testing Overview SPECIFIED INPUT RESPONSE BEHAVIOR SPACE SPACE ROBUST SHOULD VAL I D OPERATION WORK INPUTS MO DULE REPRODUCIBLE UNDEFINED UNDER FAILURE TEST SHOULD INVALID INPUTS UNREPRODUCIBLE RETURN FAILURE ERROR Abstracts testing to the API/Data type level • Most test cases are exceptional • Test cases based on best-practice SW testing methodology 3 Ballista: Test Generation (fine grain testing) Tests developed per data type/subtype; scalable via composition 4 Initial Results: Most APIs Weren’t Robust Unix & Windows systems had poor robustness scores: • 24% to 48% of intentionally exceptional Unix tests yielded non-robust results • Found simple “system killer” programs in Unix, Win 95/98/ME, and WinCE
    [Show full text]
  • Chapter 1. Origins of Mac OS X
    1 Chapter 1. Origins of Mac OS X "Most ideas come from previous ideas." Alan Curtis Kay The Mac OS X operating system represents a rather successful coming together of paradigms, ideologies, and technologies that have often resisted each other in the past. A good example is the cordial relationship that exists between the command-line and graphical interfaces in Mac OS X. The system is a result of the trials and tribulations of Apple and NeXT, as well as their user and developer communities. Mac OS X exemplifies how a capable system can result from the direct or indirect efforts of corporations, academic and research communities, the Open Source and Free Software movements, and, of course, individuals. Apple has been around since 1976, and many accounts of its history have been told. If the story of Apple as a company is fascinating, so is the technical history of Apple's operating systems. In this chapter,[1] we will trace the history of Mac OS X, discussing several technologies whose confluence eventually led to the modern-day Apple operating system. [1] This book's accompanying web site (www.osxbook.com) provides a more detailed technical history of all of Apple's operating systems. 1 2 2 1 1.1. Apple's Quest for the[2] Operating System [2] Whereas the word "the" is used here to designate prominence and desirability, it is an interesting coincidence that "THE" was the name of a multiprogramming system described by Edsger W. Dijkstra in a 1968 paper. It was March 1988. The Macintosh had been around for four years.
    [Show full text]
  • Lecture 1: Introduction to UNIX
    The Operating System Course Overview Getting Started Lecture 1: Introduction to UNIX CS2042 - UNIX Tools September 29, 2008 Lecture 1: UNIX Intro The Operating System Description and History Course Overview UNIX Flavors Getting Started Advantages and Disadvantages Lecture Outline 1 The Operating System Description and History UNIX Flavors Advantages and Disadvantages 2 Course Overview Class Specifics 3 Getting Started Login Information Lecture 1: UNIX Intro The Operating System Description and History Course Overview UNIX Flavors Getting Started Advantages and Disadvantages What is UNIX? One of the first widely-used operating systems Basis for many modern OSes Helped set the standard for multi-tasking, multi-user systems Strictly a teaching tool (in its original form) Lecture 1: UNIX Intro The Operating System Description and History Course Overview UNIX Flavors Getting Started Advantages and Disadvantages A Brief History of UNIX Origins The first version of UNIX was created in 1969 by a group of guys working for AT&T's Bell Labs. It was one of the first big projects written in the emerging C language. It gained popularity throughout the '70s and '80s, although non-AT&T versions eventually took the lion's share of the market. Predates Microsoft's DOS by 12 years! Lecture 1: UNIX Intro The Operating System Description and History Course Overview UNIX Flavors Getting Started Advantages and Disadvantages Lecture Outline 1 The Operating System Description and History UNIX Flavors Advantages and Disadvantages 2 Course Overview Class Specifics 3
    [Show full text]
  • The Strange Birth and Long Life of Unix - IEEE Spectrum Page 1 of 6
    The Strange Birth and Long Life of Unix - IEEE Spectrum Page 1 of 6 COMPUTING / SOFTWARE FEATURE The Strange Birth and Long Life of Unix The classic operating system turns 40, and its progeny abound By WARREN TOOMEY / DECEMBER 2011 They say that when one door closes on you, another opens. People generally offer this bit of wisdom just to lend some solace after a misfortune. But sometimes it's actually true. It certainly was for Ken Thompson and the late Dennis Ritchie, two of the greats of 20th-century information technology, when they created the Unix operating system, now considered one of the most inspiring and influential pieces of software ever written. A door had slammed shut for Thompson and Ritchie in March of 1969, when their employer, the American Telephone & Telegraph Co., withdrew from a collaborative project with the Photo: Alcatel-Lucent Massachusetts Institute of KEY FIGURES: Ken Thompson [seated] types as Dennis Ritchie looks on in 1972, shortly Technology and General Electric after they and their Bell Labs colleagues invented Unix. to create an interactive time- sharing system called Multics, which stood for "Multiplexed Information and Computing Service." Time-sharing, a technique that lets multiple people use a single computer simultaneously, had been invented only a decade earlier. Multics was to combine time-sharing with other technological advances of the era, allowing users to phone a computer from remote terminals and then read e -mail, edit documents, run calculations, and so forth. It was to be a great leap forward from the way computers were mostly being used, with people tediously preparing and submitting batch jobs on punch cards to be run one by one.
    [Show full text]
  • The Strange Birth and Long Life of Unix - IEEE Spectrum
    The Strange Birth and Long Life of Unix - IEEE Spectrum http://spectrum.ieee.org/computing/software/the-strange-birth-and-long-li... COMPUTING / SOFTWARE FEATURE The Strange Birth and Long Life of Unix The classic operating system turns 40, and its progeny abound By WARREN TOOMEY / DECEMBER 2011 They say that when one door closes on you, another opens. People generally offer this bit of wisdom just to lend some solace after a misfortune. But sometimes it's actually true. It certainly was for Ken Thompson and the late Dennis Ritchie, two of the greats of 20th-century information technology, when they created the Unix operating system, now considered one of the most inspiring and influential pieces of software ever written. A door had slammed shut for Thompson and Ritchie in March of 1969, when their employer, the American Telephone & Telegraph Co., withdrew from a collaborative project with the Photo: Alcatel-Lucent Massachusetts Institute of KEY FIGURES: Ken Thompson [seated] types as Dennis Ritchie looks on in 1972, shortly Technology and General Electric after they and their Bell Labs colleagues invented Unix. to create an interactive time-sharing system called Multics, which stood for "Multiplexed Information and Computing Service." Time-sharing, a technique that lets multiple people use a single computer simultaneously, had been invented only a decade earlier. Multics was to combine time-sharing with other technological advances of the era, allowing users to phone a computer from remote terminals and then read e-mail, edit documents, run calculations, and so forth. It was to be a great leap forward from the way computers were mostly being used, with people tediously preparing and submitting batch jobs on punch cards to be run one by one.
    [Show full text]
  • Introduction to UNIX What Is UNIX? Why UNIX? Brief History of UNIX Early UNIX History UNIX Variants
    What is UNIX? A modern computer operating system Introduction to UNIX Operating system: “a program that acts as an intermediary between a user of the computer and the computer hardware” CS 2204 Software that manages your computer’s resources (files, programs, disks, network, …) Class meeting 1 e.g. Windows, MacOS Modern: features for stability, flexibility, multiple users and programs, configurability, etc. *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright 2001-2003. (C) Doug Bowman, Virginia Tech, 2001- 2 Why UNIX? Brief history of UNIX Used in many scientific and industrial settings Ken Thompson & Dennis Richie Huge number of free and well-written originally developed the earliest software programs versions of UNIX at Bell Labs for Open-source OS internal use in 1970s Internet servers and services run on UNIX Borrowed best ideas from other Oss Largely hardware-independent Meant for programmers and computer Based on standards experts Meant to run on “mini computers” (C) Doug Bowman, Virginia Tech, 2001- 3 (C) Doug Bowman, Virginia Tech, 2001- 4 Early UNIX History UNIX variants Thompson also rewrote the operating system Two main threads of development: in high level language of his own design Berkeley software distribution (BSD) which he called B. Unix System Laboratories System V Sun: SunOS, Solaris The B language lacked many features and Ritchie decided to design a successor to B GNU: Linux (many flavors) which he called C. SGI: Irix They then rewrote UNIX in the C FreeBSD programming language to aid in portability. Hewlett-Packard: HP-UX Apple: OS X (Darwin) … (C) Doug Bowman, Virginia Tech, 2001- 5 (C) Doug Bowman, Virginia Tech, 2001- 6 1 Layers in the UNIX System UNIX Structure User Interface The kernel is the core of the UNIX Library Interface Users system, controlling the system Standard Utility Programs hardware and performing various low- (shell, editors, compilers, etc.) System Interface calls User Mode level functions.
    [Show full text]
  • Absolute BSD—The Ultimate Guide to Freebsd Table of Contents Absolute BSD—The Ultimate Guide to Freebsd
    Absolute BSD—The Ultimate Guide to FreeBSD Table of Contents Absolute BSD—The Ultimate Guide to FreeBSD............................................................................1 Dedication..........................................................................................................................................3 Foreword............................................................................................................................................4 Introduction........................................................................................................................................5 What Is FreeBSD?...................................................................................................................5 How Did FreeBSD Get Here?..................................................................................................5 The BSD License: BSD Goes Public.......................................................................................6 The Birth of Modern FreeBSD.................................................................................................6 FreeBSD Development............................................................................................................7 Committers.........................................................................................................................7 Contributors........................................................................................................................8 Users..................................................................................................................................8
    [Show full text]
  • The Arcos Network Operating System
    AT-A-GLANCE The ArcOS TM Network Operating System History has repeatedly proven that large industries transition from The ArcOS Advantage vertical integration to best-in-class horizontal segmentation as the urgent business need for innovation outstrips the ability/intent of the incumbents to deliver. The networking industry is in exactly such Agile situation, but it lags the compute and, to a large extent, the storage tiers in terms of this transition. Network operations teams are hampered by inflexible, proprietary systems that are expensive to build, operate, Automated processes accelerate and manage. This model does not fit well into today’s digital business and streamline network expectations of a more agile and innovation-friendly smart infrastructure. provisioning, operations, and deployment. Built-in YANG/ Recently, there has been an explosion of networking merchant silicon OpenConfig support simplifies options in the market that continue to redefine what is possible. integration into existing Additionally, the networking hardware ecosystem continues to evolve frameworks. with a proliferation of readily available leading-edge network platforms from multiple ODMs. But the fundamental problem has been the lack of a modern, scalable, and viable software network operating system that enables the transition from a proprietary, closed approach to an open integration approach. Elastic Arrcus addresses this problem by delivering ArcOS, an independent, open, Linux-based network operating system, as a high-quality alternative Modular software on white box/ to vertically integrated OEMs, to meet and exceed the modern smart brite box network hardware network infrastructure requirements. maximizes flexibility in building a scale-out architecture for a variety of network environments A Modern Network Operating System for the Data Center, (physical, virtual, cloud).
    [Show full text]