Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "1 © 2000-2002 John Urrutia. All rights reserved. Chapter 15 System Administration."— Presentation transcript:

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

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

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

4 4 © 2000-2002 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 5 © 2000-2002 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 6 © 2000-2002 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 7 © 2000-2002 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 8 © 2000-2002 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 9 © 2000-2002 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 10 © 2000-2002 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 11 © 2000-2002 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 12 © 2000-2002 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 13 © 2000-2002 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 14 © 2000-2002 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 15 © 2000-2002 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 16 © 2000-2002 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 17 © 2000-2002 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 18 © 2000-2002 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 19 © 2000-2002 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 2 - 3  X-windows– run level 5  Reboot– run level 6  Undefined– run level 4, 7 - 9

20 20 © 2000-2002 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 21 © 2000-2002 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 22 © 2000-2002 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 23 © 2000-2002 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 24 © 2000-2002 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 25 © 2000-2002 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 26 © 2000-2002 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 27 © 2000-2002 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 28 © 2000-2002 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 29 © 2000-2002 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 30 © 2000-2002 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 31 © 2000-2002 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 32 © 2000-2002 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 33 © 2000-2002 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 34 © 2000-2002 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 35 © 2000-2002 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=620 0 0 /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 36 © 2000-2002 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 37 © 2000-2002 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 38 © 2000-2002 John Urrutia. All rights reserved. System Administration (Day to Day) What to use for backups TypeSpeedCapacityCost TapeSlowHighLow CD-ROM,RWMedium Hard DrivesFastMediumHigh RemovableMediumLow

39 39 © 2000-2002 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 40 © 2000-2002 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 41 © 2000-2002 John Urrutia. All rights reserved. tar option [modifiers] [file-list]  --absolute-paths  --exclude filename  --file filename  --verbose System Administration (Day to Day)

42 42 © 2000-2002 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 43 © 2000-2002 John Urrutia. All rights reserved. System Administration Periodic Installing LINUX  Floppy  CD-ROM  Rescue Disks

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

45 45 © 2000-2002 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 46 © 2000-2002 John Urrutia. All rights reserved. Preventing & Fixing Problems System logs  /var/log  Track various events in system

47 47 © 2000-2002 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 48 © 2000-2002 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 49 © 2000-2002 John Urrutia. All rights reserved. Getting Help man pages Info pages


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

Similar presentations


Ads by Google