unix system administration - home -brookdale...
TRANSCRIPT
Linux System Administration Linux Introduction
1
Unix System Administration
Introduction
Linux Introduction Linux System Administration 2
Course Objectives• The purpose of this course is to teach the student
– how to install and configure the Linux or UNIX operating system– how to perform the duties of a system administrator
• This course is the first of a two sequence course in Linux System and Network Administration.– In this course we will focus on System Administration
• Installation and configuration of basic Linux operation– In the next course we will focus on Network Administration
• Installation and configuration of daemons• The student will achieve these objectives by attending the
lecture, reading and research, class demonstrations, laboratory exercises, and the successful completion of the course project
Linux System Administration Linux Introduction
2
Linux Introduction Linux System Administration 3
Module Objectives• At the conclusion of this module, the student will be able to:
– List the duties of the System Administrator – Define what UNIX is– Give a brief history of UNIX and Linux– Perform preinstallation tasks related to hardware compatibility– Define the difference between a server and a workstation– List and briefly explain the features of Linux and UNIX– List and briefly explain the three main parts of Linux and Unix– Define what an Operating System is– Find Linux and UNIX information and documentation on the Internet
Linux Introduction Linux System Administration 4
What is the System Administrator• a person who uses super-user or root status • performs important maintenance procedures on
UNIX systems• the basic roles of UNIX administration include:
– booting up and shutting down– managing user accounts
• create new accounts and delete old accounts• assign initial password • set default file ownership and permissions • set user parameters
– establish the appropriate .profile or .login files for the user – assign the default CPU priority for use with the nice command– set other parameters as required, such as number of login attempts,
password change intervals, and auditing information
Linux System Administration Linux Introduction
3
Linux Introduction Linux System Administration 5
What is UNIXUNIX• an operating system created at Bell Labs circa 1969• is a trademark
– often used as a generic term to describe a UNIX-like operating system just as Xerox is a generic term often used to describe copying documents
• a multi-user, multi-tasking, time-sharing operating system• There are many different flavors of UNIX
– all utilize similar UNIX operating system concepts– may have different features or run on different hardware– all generally adhere to some type of standards– standards allow for portability of software across multiple UNIX
distributions
Linux Introduction Linux System Administration 6
History of UNIX• 1969
– UNIX developed at AT&T Bell Labs– Source code distributed to universities.
• As a result, several versions of UNIX developed over time.• 1979
– AT&T announced they wanted to charge for Unix licenses for theirversion known a System V
– University of California at Berkeley created BSD Unix• early commercial versions (SunOS) were based on BSD
• 1987– Sun and AT&T began to create an industry standard for UNIX
• Attempted to combine the best features of AT&T’s System V and BSD’s Release 4
• enables software to be developed for UNIX without concern as to version
Linux System Administration Linux Introduction
4
Linux Introduction Linux System Administration 7
History of UNIX• 1990
– System V Release 4 (SVR4) was released and became the basis for:• Solaris - Sun Microsystems• UNIX - AT&T• AIX - IBM• HP-UX - Hewlett-Packard
• 1991– Linux
• Linus Torvalds began developing the Linux kernel• Version 1.0 released 1994.
• Now– Several BSD variants still popular
• FreeBSD• OpenBSD• NetBSD
– New arrivals to the UNIX world• BeOS• Apple Mac OS X
Linux Introduction Linux System Administration 8
Linux Background• initially developed in the early 1990s by Linus Torvolds• a copyright free version of UNIX, based loosely on SV with
some BSD UNIX added• originally designed to run on a PC but versions now exist for
many different platforms including Palm• developed as a cooperative effort of many thousands of
programmers using the Internet as a backbone for communications and sharing code
• kernel is its distinguishing feature – there is one main kernel for the Linux OS, but many different
implementations of the support packages and bundles• distributed under a GNU General Public License
– most versions of Linux use the same set of core utilities but add extra features or windowing packages
– major updates to Linux are posted about once a year with minor updates for bug fixes more often
Linux System Administration Linux Introduction
5
Linux Introduction Linux System Administration 9
Major Vendors of Linux• Caldera OpenLinux• Corel• Debian Linux• FreeBSD• Linux Pro• Mandrake• RedHat• SuSE Linux• TurboLinux• Walnut Creek Slackware
Linux Introduction Linux System Administration 10
Why Use Linux/UNIX• Very mature operating system
– Over 35 years of development and improvement• Very stable
– UNIX systems running for many months w/out reboot• Performance
– Efficient, can do more with less hardware
Linux System Administration Linux Introduction
6
Linux Introduction Linux System Administration 11
Why Use Linux• Linux has matured greatly
– one of the most flexible UNIX distributions– may be run on low-end, generally available hardware
• (may require Pentium to run X)– lots of software available flexible– the same Linux distribution used by a hobbyist on low
end hardware can be used by an enterprise on high-end hardware
• some flavors have versions based on number of processors or number of users
– administration skill sets transfer easily to and from other UNIX flavors
– is easily obtainable– Many versions are free or very low cost (for CD’s only)
Linux Introduction Linux System Administration 12
Planning for Your Linux System• Prior to installation of Linux or UNIX, the system
administrator must determine:– if your hardware supported– to install a workstation or a server
• which machines get which installation– are there special services that we need run (web server,
email server, DNS server, etc.)– the need to schedule backups of user and/or application
data
Linux System Administration Linux Introduction
7
Linux Introduction Linux System Administration 13
Checking Hardware Compatibility• It’s very important that you make sure the hardware is
fully supported by your UNIX/Linux distribution– Hardware Compatibility Lists (HCLs) contain the hardware
supported by your OS vendor– can be obtained at the vendor’s website
• Find out the specifics about the hardware that will be used– Processor– amount of system RAM– Manufacturer and compatibility of interfaces
• video card - brand and chipset• NIC • hard drive – size and interface• sound card• MODEM Can be a problem if hardware designed for use with
Windows See http://www.linmodems.org/• Some vendors have hardware compatibility database
– RedHat: http://www.redhat.com/support/hardware/
Linux Introduction Linux System Administration 14
Hardware Requirements• Barebones Linux setup:
– 80486 CPU– 16MB RAM– 400MB disk space
• Typical workstation setup:– Pentium (slow is fine)– 32MB RAM– 1GB hard disk
• Server configuration:– Pentium II/III– 64MB RAM (more for heavy user loads)– 6GB hard drive (more for user file storage)
Linux System Administration Linux Introduction
8
Linux Introduction Linux System Administration 15
Linux Server vs. Workstation• Servers
– provide access to multiple users– run daemons and services, DNS, firewall or gateway
software, share files with users, application server software, and other group-accessible applications
• Workstations– tend to be dedicated to one user
• Server and workstation configurations of Linux are exactly the same as far as the kernel is concerned– the difference is the software installed and functionality – configurations of some kernel parameters can be tweaked
for server use, but the changes are minimal
Linux Introduction Linux System Administration 16
Popular Uses of UNIX• Servers
– Web– Database– File transfer/ftp– DNS (Domain Name System)– E-mail (sendmail and POP3)– File Server Workstations
• Workstations– Applications
• Scientific / Engineering/ simulation• Office software (word processing, spreadsheet, presentations)• Financial• graphics and imaging
Linux System Administration Linux Introduction
9
Linux Introduction Linux System Administration 17
Example of Popular Server Software• Web Server Platforms June 2004
– UNIX/Apache is the platform used on 67% of Internet web servers.
– Microsoft OSs used on 21.5% of web servers.– Sun – 3.3%– Zeus – 1.5%– Other – 6%– Source:
http://news.netcraft.com/archives/2004/06/06/june_2004_web_server_survey.html
Linux Introduction Linux System Administration 18
What is Required to Install UNIX• You need a CD media containing the UNIX
distribution or a network connection– If you set your computer to boot directly from the CD-
ROM it will start the install program.– If your computer cannot boot directly from the CD-
ROM, you must create a boot floppy disk• it will boot the computer, mount the CD-ROM drive, and start
the installation program from CD-ROM
Linux System Administration Linux Introduction
10
Operating System Overview
Linux Introduction Linux System Administration 20
What is an Operating System• A set of programs
– manages all computer operations – provides a link between the user and system resources– processes commands or requests that come from an input
device (keyboard, mouse, remote connection) – send results to an output device (display, printer, remote
connection)
Linux System Administration Linux Introduction
11
Linux Introduction Linux System Administration 21
Linux/UNIX Operating System Features• Multitasking
• Enables more than one tool or application to be used• Enables the kernel to track several processes simultaneously
• Multi-user• allows more than one user to access the same system resources• time sharing
• different from multiple users access to the same document on a file server• Protected Memory
• each process allocated its own memory space• if a process crashes it is not likely to impact other processes
• Distributed Processing• Enables the use of resources across a network.• Multiple UNIX systems can cooperate on processing a job
Linux Introduction Linux System Administration 22
Linux/UNIX Operating System Features• Scalable
• can accommodate more than one CPU• maximum number varies by distribution• Red Hat Enterprise has different versions based on the number of CPUs
and the number of users• symmetric multiprocessing distributes processes across multiple CPUs
• Portable• Linux/UNIX may be compiled and run on numerous CPUs
• Intel/AMD/Cyrix• Sun Sparc• IBM/Motorola PowerPC• DEC Alpha
• Security• login and password required for system access• Owner and group permissions may be set on files and directories• users restricted from modifying system parameters other than their own
Linux System Administration Linux Introduction
12
Linux Introduction Linux System Administration 23
Three Main Parts of the UNIX Operating System
• kernel– core program of UNIX /Linux– manages devices– manages real and virtual memory – manages user processes and daemons (system processes)– controls the functions between programs and hardware
• Shell– interface between the user and the kernel– performs the function of an interpreter or translator
• receives commands from the user• interprets user input, and requests execution of the program
– execution is performed by the kernel
Linux Introduction Linux System Administration 24
Shell• The most common shells used in the UNIX
environment• Bourne shell (indicated by the $ prompt)
• Original default UNIX; no aliasing or history capabilities• Bourne Again Shell (indicated by the $ prompt)
• Descended from the Bourne Shell• Usually default shell today• Has aliasing and history capabilities
• Korn shell (indicated by the $ prompt)• A superset of Bourne with aliasing and history
• C shell (indicated by the % prompt)• Also has aliasing and history; C-like syntax
Linux System Administration Linux Introduction
13
Linux Introduction Linux System Administration 25
Three Main Parts of the UNIX Operating System
• File System– A hierarchy of directories, subdirectories, and files
• usually organized or grouped together for a specific purpose• devices are treated like files in /dev
– UNIX uses UFS, the Unix File System– Sun developed NFS, the Network File System, for systems
to access data stored on other systems– NTFS is a high-performance and self-healing file system
proprietary to Windows XP/ 2000/ NT
Linux Introduction Linux System Administration 26
Sources of Information• http://www.linux.org/info/gnu.html GNU License
information • http://www.kernel.org/ - The primary site for the Linux
kernel source• http://www.tldp.org – The Linux Documentation Project is a
repository of Guides, HOWTOs, man (manual) pages, and FAQs
• http://sourceforge.net/index.php - the largest repository of Open Source code and applications available on the Internet.
• http://sourceforge.net/softwaremap/trove_list.php - links to the source code and applications grouped by functions.
• Also, review http://www.tucows.com/ http://rpmfind.net/and http://freshrpms.net/
• http://winscp.sourceforge.net/eng/ a free ssh Windows client
Linux System Administration Linux Introduction
14
Linux System Administration
Linux/UNIX File System
Linux Introduction Linux System Administration 28
File Structure• A hierarchy of directories, subdirectories, and files
that are usually organized or grouped together for a specific purpose.
• Data are organized in the file system's hierarchical structure of directories in a way similar to how information is stored in a file cabinet.
Linux System Administration Linux Introduction
15
Linux Introduction Linux System Administration 29
File Structure
Linux Introduction Linux System Administration 30
Directory Terminology• Root directory
• The topmost directory in the file system hierarchy.• Required for the operating system to function and contains
critical system files (such as the kernel)• Subdirectory
• Any directory below another directory• May also be known as a child
• Parent Directory• The directory immediately above a subdirectory• Each subdirectory has only one parent, although a parent
directory can have many subdirectories• The root has no parent
Linux System Administration Linux Introduction
16
Linux Introduction Linux System Administration 31
Directory Terminology• Root /
• Top level of the file system.• Current Directory .
• The directory you are in.• Parent Directory ..
• The directory above the one you are currently in
• Home Directory ~• User’s default login directory
Linux Introduction Linux System Administration 32
Directory Terminology• Absolute Pathname
• Path to a file or directory starting from root• Example: /home/andrewjr/mail
• Relative Pathname• Path to a file or directory relative to the starting point• Example: ./mail
Linux System Administration Linux Introduction
17
Linux Introduction Linux System Administration 33
Directory Terminology• Pathname
• uniquely identifies a particular file or directory by specifying its location.
• Pathnames in UNIX use forward slashes (/) as the delimiter between object names.
• Example: /home/andrewjr/file.txt
Linux Introduction Linux System Administration 34
Accessing a UNIX system• Logging in identifies you to the system.• You must have a user account on the system to log in.• Systems Administrators are responsible for creating
and maintaining user accounts.
Linux System Administration Linux Introduction
18
Linux Introduction Linux System Administration 35
Logging In• You will be presented with a prompt similar to the
following:Login:Password:
Linux Introduction Linux System Administration 36
Logging In• Type your username (login ID) at the prompt and
press Enter.• Then type your password at the prompt, and press
Enter.• Note that your password will not appear as you type it for
security reasons.• UNIX is CaSe-SeNsItIvE… however, most objects
are lowercase for ease of typing.• If your login is successful, you will be greeted with a
shell prompt ($).
Linux System Administration Linux Introduction
19
Linux Introduction Linux System Administration 37
UNIX network configuration files• /etc/hosts
• Lists IP address and hostname of the system• Can include IPs and names of other systems• First is the loopback (localhost) address• Next is the real IP address of the system127.0.0.1 localhost192.168.5.6 cocoa192.168.5.45 coffee
Linux Introduction Linux System Administration 38
UNIX network configuration files• /etc/resolv.conf
• Lists Domain Name Service (DNS) resolution information• First is the domain the system is in• Next are the nameservers it usersdomain brookdalecc.netserver 128.118.25.3server 128.118.141.32
Linux System Administration Linux Introduction
20
Linux Introduction Linux System Administration 39
UNIX network configuration files• /etc/defaultrouter
• Lists the default network gateway for the system• 192.168.5.1
• /etc/netmasks• Lists the network and subnet mask192.168.0.0 255.255.255.0
Linux Introduction Linux System Administration 40
Working with Directories• Determine what directory you’re in:pwd (print working directory)Example:$ pwd/home/andrewjr
• Change to another directory:cdExample:$ cd /home/andrewjr/mail
Linux System Administration Linux Introduction
21
Linux Introduction Linux System Administration 41
Working with Directories• cd command with an absolute pathname$ cd /home/andrewjr/mail
• cd command with a relative pathname(if already in /home/andrewjr)$ cd mail
• Change to the parent directory$ cd ..
Linux Introduction Linux System Administration 42
Displaying Files and Directories• List files and directories.$ lsdir1 file1.txt file2 pong
• List all files and directories, including hidden files (files beginning with a ‘ . ‘ )$ ls –a.kshrc dir1 file1.txt file2 pong
Linux System Administration Linux Introduction
22
Linux Introduction Linux System Administration 43
Displaying Files and Directories• File types and permissions• Number of hard links to other files• Owner• Group• Size of file in bytes• Last modification time• Filename
Linux Introduction Linux System Administration 44
Displaying Files and Directories• Displaying detailed information.$ ls -l
drwx------ 2 jsmith users 512 Feb 28 19:28 dir1-rw-rw-r-- 1 jsmith users 27 Feb 28 19:29 file1.txtlrwxrwxrwx 1 jsmith users 9 Feb 28 19:29 file2 -> file1.txt-rwx------ 1 jsmith users 23 Feb 28 19:29 pong