1 © 2000-2002 John Urrutia. All rights reserved. Chapter 15 System Administration.

Slides:



Advertisements
Similar presentations
Basic Unix system administration
Advertisements

Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Introduction to Unix (CA263) File System
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 12.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Guide To UNIX Using Linux Third Edition
System Startup and Shutdown
Linux+ Guide to Linux Certification, Second Edition
Laksh mi.  fdisk is an interactive utility to manipulate disk partitions.  Use fdisk –l to review the disks and partitions on the system.  Use fdisk.
1. This presentation covers :  User Interface Administration  Files System and Services Management 2.
File System and Directory Structure in Linux. What is File System In a computer, a file system is the way in which files are named and where they are.
Linux Filesystem Management
Linux+ Guide to Linux Certification Chapter Three Linux Installation and Usage.
Manage Directories and Files in Linux
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
CIS 218 Advanced UNIX 1 User and System Information CIS 218.
System Startup & Shutdown Objectives –to interpret the Unix startup and shutdown configuration files –to be able to create a customised run level Contents.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Managing User Accounts. Module 2 – Creating and Managing Users ♦ Overview ► One should log into a Linux system with a valid user name and password granted.
Linux Operations and Administration
Chapter 6: Linux Filesystem Administration
Linux+ Guide to Linux Certification, Third Edition
Chapter Two Exploring the UNIX File System and File Security.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
1 Objectives Manage and install new file systems.
The Linux Operating System Lecture 3: Becoming the Superuser and Users and Groups The Tonga Institute of Higher Education.
Linux Administration. Pre-Install Different distributions –Redhat, Caldera, mandrake, SuSE, FreeBSD Redhat Server Install –Check HCL –Significant issues.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
System Startup & Shutdown
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 9: Basic Linux Administration Chapter 11: System Administration: Core Concepts Chapter 16:
Introduction to System Admin Sirak Kaewjamnong. 2 The system administration’s job  Adding a new user  Doing backup and restoring files from backups.
1 LINUX SECURITY. 2 Outline Introduction Introduction - UNIX file permission - UNIX file permission - SUID / SGID - SUID / SGID - File attributes - File.
Linux+ Guide to Linux Certification, Third Edition
Fall 2011 Nassau Community College ITE153 – Operating Systems Session 21 Administering User Accounts and Groups 1.
1 © 2001 John Urrutia. All rights reserved. Chapter 4 The LINUX Filesystem.
System Administration – Part 2. Devices in UNIX are files: A device can be accessed with different file names All device files are stored in /dev or its.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Linux Commands C151 Multi-User Operating Systems.
The Saigon CTT Chapter 10 Managing Users. The Saigon CTT  Objectives  Define the requirements for user accounts  Explain group and group accounts 
System Administration. Logging in as System Administrator System Admin login (aka superuser, aka root) –login id: root –Default PS1 prompt: # –Home directory:
Filesystem Management and Backups. 2 Section Overview Devices and Files Filesystem Management Network Filesystems Backups.
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
Managing Users CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Lecture 4 & 5: System Architecture  File systems  Devices  File system permissions  Review of Linux runlevels  In-class exercise.
Basic UNIX system administration CS 2204 Class meeting 14 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
Materi managing user & groups, file system Managing Software Packages and File Systems The Complete Guide to Linux System Administration Chapter 10.
Red Hat ® I NTERNET S YS A DMIN Introduction to Linux.
Memory management. Linux Memory Management Total memory available for processes = real memory + paging space - 1MB. First megabyte of real memory is used.
Linux Filesystem Administration
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
Getting Started with Linux
SYSTEM ADMINISTRATION PART I by İlker Korkmaz and Kaya Oğuz
Filesystem Management and Backups
...looking a bit closer under the hood
System Programming and administration CS 308
Chapter 6 File Systems CSNB113 SYSTEM ADMINISTRATION
Basic Commands ls cp ls –l (in detail format) echo ls –a
Chapter 11: Managing Users
Hands On UNIX AfNOG 2010 Kigali, Rwanda
Chapter 2: System Structures
Hands On UNIX AfNOG X Cairo, Egypt
Adding New Users, Storage, File System
Module 13 System and User Security
Presentation transcript:

1 © John Urrutia. All rights reserved. Chapter 15 System Administration

2 © John Urrutia. All rights reserved. Chapter 15 ( Topics ) Background The System Administrator & SuperUser Types of Files Description of System Operations Important Files & Directories

3 © John Urrutia. All rights reserved. Chapter 15 ( Topics ) System Administration  Day-to-day  Periodic Preventing & Fixing Problems Useful Utilities Getting Help

4 © John Urrutia. All rights reserved. Background Because of Linux’s flexibility to operate on many platforms with a large diversity of hardware this chapter offers an overview of fundamentals that apply to all Linux Systems We look at some tools used in administration Kernel construction and re-configuration Disaster Recovery

5 © John Urrutia. All rights reserved. The System Administrator Responsible for:  The care and feeding of Linux.  Addition, Deletion and updates to all system resources.  Disaster Recovery.  Users

6 © John Urrutia. All rights reserved. The System Administrator root aka The SuperUser  Has total and complete access to all system functions and data. SuperUser Login from:  system console or any terminal by using Substitute User (su) command sudo allows specific command privileges to normal users.

7 © John Urrutia. All rights reserved. The System Administrator When you use su to login as root generally your command line prompt will show a pound sign (#) instead of a dollar sign ($) To return to a normal user type exit or Ctrl+d

8 © John Urrutia. All rights reserved. The System Administrator Most System Administration tools are located in these directories  /sbin  /usr/sbin When executing these tools specify the absolute pathname! Don’t rely on the $PATH because of security considerations.

9 © John Urrutia. All rights reserved. Types of Files Ordinary files contain all types of user data  text, programs, scripts, etc. Directory files contain information about all files (as outlined on next slide) Special files primarily for devices, named pipes, and sockets

10 © John Urrutia. All rights reserved. Types of Files Directory files contain information about all files  Type, Permissions, Links, Owner, Group, Size, Name  Date & Time of: - creation, update, access  Inode: internal number that the file is known as to the system. Owner, size, where located, link count & other attributes.

11 © John Urrutia. All rights reserved. Types of Files Special files  By convention are stored in /dev directory and represent devices.  Each device file is identified in the directory by a type indicator:  b – block  c – character  d – directory  l – link  p – named pipe  s – socket

12 © John Urrutia. All rights reserved. Types of Files Special files  By convention are stored in /dev directory and represent devices.  fifo special files ( aka Named Pipes )  f irst i n f irst o ut  Allows any two processes to exchange info and are treated just like files.  sockets – basis of networking facility

13 © John Urrutia. All rights reserved. Types of Files Character and Block Special files  block and character devices fall into categories identified by a device number  Major device number – Identify the category of hardware represented by the device  Minor device number – Identify a specific device of that category  Created by mknod

14 © John Urrutia. All rights reserved. Types of Files Character and Block Special files  The standard block devices on a Linux system are disk drives.  Anything that is not a block device is considered a character device.  Printers, terminal, keyboards, modems.  Data can be read:  in raw mode one character at a time  By the “line”

15 © John Urrutia. All rights reserved. System Operation Description of operation  Booting the system  System operating modes  Logging In, Running and Logging Out  Bringing the system down

16 © John Urrutia. All rights reserved. System Operation Booting the system  Process of initializing the hardware, loading the operating system and allowing users access in normal operation mode.  Power-up  Hardware self-checks  BIOS execution  Boot loader (lilo – linux loader)

17 © John Urrutia. All rights reserved. System Operation Boot loader (what St. Nicholas of Myra does)  Master Boot Record  First block(s) of data on the hardware specified start-up disk.  lilo is the initial program used to locate, load, and run the operating system kernel.

18 © John Urrutia. All rights reserved. System Operation Boot loader (Continued)  Six phases to nirvana  Loading and initialize the kernel  Device detection and configuration  Creation of spontaneous system processes  Operator intervention ( Manual Boot Only )  Execution of system startup scripts  Multi-user operations

19 © John Urrutia. All rights reserved. System Operation System operating modes  System Halt– run level 0  Single-User– run level 1 - S  Multi-User – run level  X-windows– run level 5  Reboot– run level 6  Undefined– run level 4, 7 - 9

20 © John Urrutia. All rights reserved. System Operation Single User Mode  This mode is generally used for maintenance or problem solving.  During the boot process this mode is used:  To do file system integrity checks.  Start the init process and run inittab, rc.M

21 © John Urrutia. All rights reserved. System Operation Multi User operations  Logging In  init spawns mingetty to capture the terminal login and display the login message, mingetty identifies the terminal type at login and overlays itself with the login process, validates password, initializes your environment

22 © John Urrutia. All rights reserved. System Operation Multi User operations  Running  Enter command or exit / logout  Logging Out  Kills your login shell process  init receives the signal and cleans-up

23 © John Urrutia. All rights reserved. System Operation Bringing the system down  shutdown brings the system down in an orderly fashion. And it can:  Change the mode of system operation.  Schedule the time to shutdown  Warns users before shutdown

24 © John Urrutia. All rights reserved. System Operation Normal shutdown does the following  wall – warns users to logout  /etc/nologin created to prevent new logins  kill – issued for all processes  sync; sync – finish writing buffers  umount -a – dismount all filesystems  telinit -s – set single user mode

25 © John Urrutia. All rights reserved. System Operation Abnormal shutdown or crashes  System halts without cleanup  Status of system is unpredictable  May have one or more core dumps System must be restarted with caution

26 © John Urrutia. All rights reserved. System Operation System re-start after a crash  fsck utiltity checks and repairs the following errors:  Inodes, blocks, and sizes  Directory structure  Directory connectivity  Reference counts Note: filesystems must not be mounted or mounted as readonly If file integrity is okay – normal startup will follow

27 © John Urrutia. All rights reserved. System Operation If errors are detected and fixed  Notify file users to beware of missing or inaccurate data. Restore files from backups

28 © John Urrutia. All rights reserved. Important Files & Directories /dev/null – the bit bucket /var – frequently changed system files  System logs /var/spool/cron – controls what interval jobs are executed.

29 © John Urrutia. All rights reserved. Important Files & Directories /etc/group – contains the user groups allowing members to share data files.  newgrp – spawns shell under new group  id – will show uid, current gid and groups /etc/mtab – list of all mounted devices  Controlled by mount and umount utility

30 © John Urrutia. All rights reserved. Important Files & Directories /etc/passwd – identifies system users  login-name: – your login id (ie. jurrutia)  password: – the encrypted password  user id number: – the internal UID  group id number: – the default GID  comment: – whatever you want  directory: – absolute pathname to home  program – default login program to run (bash)

31 © John Urrutia. All rights reserved. Important Files & Directories /etc/passwd – example root:x:0:0:Root of all:/:/bin/sh mpress:x:521:0:M Press:/home/mpress:/bin/bash who:x:1000:1000:Ex who & leave:/usr:/usr/bin/who /etc/profile – the shell login script  First script your shell runs after login

32 © John Urrutia. All rights reserved. Important Files & Directories /etc/shadow – stores encrypted passwords and other user info. Only accessible by root.  login-name: – your login id (ie. jurrutia)  password: – the encrypted password  last modified: – modification date (days since 1/1/70)  min: – min. # of day before password can be changed  max: – max. # of day before password must change  warn: – days to warn of password expiration  inactive: – set acct. inactive after password expires  expire: – days since 1/1/70 when acct will expire  flag: – reserved for future use

33 © John Urrutia. All rights reserved. Important Files & Directories Don’t try (modifying) this at home! /etc/shadow – is modified by:  passwd – change password  useradd – add a new user  usermod – change existing user  userdel – delete a user

34 © John Urrutia. All rights reserved. Important Files & Directories /etc/fstab – file system table identifies all the file systems available to the system. It contains 6 fields ( white space delimited ):  Block device name  Mount point  Filesystem or device type  Mounting option  Filesystem backup (when to run dump utility)  fsck order to check

35 © John Urrutia. All rights reserved. Important Files & Directories #Device Mountpoint FS Type Options Dump Pass# LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 LABEL=/home /home ext3 defaults 1 1 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 none /proc proc defaults 0 0 none /dev/shm tmpfs defaults 0 0 none /dev/pts devpts gid=5,mode= /dev/hda6 swap swap defaults 0 0 /dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0 /home/SWAP swap swap defaults 0 0

36 © John Urrutia. All rights reserved. Important Files & Directories /vmlinuz – The LINUX system kernel  The z indicates the kernel is in a compressed format. Generally the last character is x. /sbin/shutdown – Shutdown Program  Program to bring the system down

37 © John Urrutia. All rights reserved. Backing Up Files – why bother  System malfunctions -  User indiscriminate deletions – What to consider  How much work are you willing to lose?  How often are you willing to back-up files?  Time, storage media  Partial vs full backups System Administration (Day to Day)

38 © John Urrutia. All rights reserved. System Administration (Day to Day) What to use for backups TypeSpeedCapacityCost TapeSlowHighLow CD-ROM,RWMedium Hard DrivesFastMediumHigh RemovableMediumLow

39 © John Urrutia. All rights reserved. Programs to use for backups  tar – tape archive utility  cpio – copy in and Out directory trees to archive (antiquated)  afio – Copy and restore directory trees to archival files  taper – A user friendly backup and restore utility System Administration (Day to Day)

40 © John Urrutia. All rights reserved. tar – tape archive utility  Create an archive file  Add to an archive file  List archive file  Retrieve from archive file tar option [modifiers] [file-list]  --create--append--update  --list--  --extract--get System Administration (Day to Day)

41 © John Urrutia. All rights reserved. tar option [modifiers] [file-list]  --absolute-paths  --exclude filename  --file filename  --verbose System Administration (Day to Day)

42 © John Urrutia. All rights reserved. crontab – Creates a list of scheduled tasks  The cron table created contains 6 fields  Minutes  0 thru 59  Hours  0 thru 23  Day of Month  1 thru 31  Month of year  1 thru 12  Day of week  0 thru 6 System Administration (Day to Day) The values can be combinations of absolutes and ranges. Each field is IFS delimited. All cron files are stored in the /var/spool/cron/crontabs Directory.

43 © John Urrutia. All rights reserved. System Administration Periodic Installing LINUX  Floppy  CD-ROM  Rescue Disks

44 © John Urrutia. All rights reserved. System Administration Re-building the kernel  make config  make dep; make clean  make zlilo

45 © John Urrutia. All rights reserved. Preventing & Fixing Problems When a User Cannot Log In  useradd  userdel  Usermod Suspect files  /etc/passwd .profile –.login –.bashrc  /etc/inittab

46 © John Urrutia. All rights reserved. Preventing & Fixing Problems System logs  /var/log  Track various events in system

47 © John Urrutia. All rights reserved. Useful Utilities Simple commands  du – disk usage  df – display filesystems  chsh – change your shell  mount – attaches a device to the system  Relies on the etc/fstab file for information about the device to mount

48 © John Urrutia. All rights reserved. Useful Utilities mount –t msdos /dev/fd0 /mnt  Mounts the floppy drive as a MSDOS device with its root at the /mnt directory

49 © John Urrutia. All rights reserved. Getting Help man pages Info pages