overview of unix system administration bambang a.b. sarif unix system administrator ccse, kfupm

23
Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Upload: ross-harrington

Post on 31-Dec-2015

227 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Overview of Unix System Administration

Bambang A.B. SarifUnix System Administrator

CCSE, KFUPM

Page 2: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Agenda

What is Unix/Linux What is system administration Things you must have Rules of thumb Good habits to develop In solving problems Automating unix system administration

Page 3: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

What is UNIX

UNIX is an operating system that originated at Bell Labs (NJ) in 1969.

UNIX is actually a trademark, but often used as a generic term to describe “UNIX-like” operating systems.

There are numerous different flavors of UNIX – all of which utilize similar UNIX operating system concepts, but may have different features or run on different hardware.

Page 4: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

The UNIX Umbrella

RedHat, Mandrake†, SuSe, Debian, Caldera,

Yellowdog†

FreeBSD, BSDI*, NetBSD OpenBSD

Sun Solaris, HP HP-UX*, Compaq True 64 UNIX*,

IBM AIX*, IRIX*, MAC OSX*

SCO UNIX (now Caldera/Tarantula)

Hardware Vendors

BSD Flavors

Linux Distributions

Other

* = Commercial distribution (i.e you must pay for it)

† = Derivative of RedHat

Page 5: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Popularity vs. Maturity

Popular

Mature

Sun Solaris

HP-UX

Compaq True 64 UNIX

RedHat Linux / Linux Mandrake

Debian Linux

SuSe

Caldera Linux

FreeBSD / NetBSD / OpenBSD, etc.

SCO UNIX

RedHat Linux

AIX

IrixDarwin (Mac OSX)

Look for more in http://www.distrowatch.com

Page 6: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

What makes UNIX Unique?

UNIX is a multi-user, time-sharing operating system: every user gets a piece of the CPU.

UNIX flavors generally adhere to some types of standards (I.e. POSIX)

UNIX standards allow for portability of software across multiple UNIX distributions.

Page 7: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

What is Linux?

A Unix-like operating system initially developed in the early 1990s by Linus Torvald.

Initially developed to run on PC hardware but has been ported to other architectures as well.

Distributed under a GNU General Public License – “free” software.

Kernel is its distinguishing feature.

Generally packaged in various distributions.

Page 8: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Linux Distributions

Vary according to included software packages, package management systems, installation process, and Window Managers.

Distributions Red Hat Enterprise Linux Fedora Core Mandriva Ubuntu OpenSuSE TurboLinux Debian GNU/Linux Slackware

Page 9: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Why Linux?

Linux has matured greatly over the past 5 years and has positioned itself as the most flexible UNIX distribution today.

It can be run on very low-end, generally available hardware. 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. It’s the first UNIX flavor to hit retail store shelves and is easily

obtainable across the world. Administration skill sets transfer easily to and from other UNIX

flavors. It’s free!

Page 10: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

What is system administration To keep, maintain and troubleshoot the system (unix network)

247 job

Roles: Installation and upgrade of system/applications Installation and upgrade services Manage users Restoring and backing up files Monitoring and performance tuning

Page 11: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

User/System Policy

Policy has to be created before services are provided No policy means you kill yourself

Some policies: User account/password Access Quotas Services

Page 12: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Things you must have

Independent learning skill

Analytical skills You don’t need to know everything about unix

There is manual page, books You can consult your uncle: Google

Ability to analyze the problem and look for solutions is more important Make log files your friend

Many big problems only need a little tweaking or workaround

Troubleshooting skills, troubleshooting skills, troubleshooting skills,…

Experience It can be developed Write it down!!

Page 13: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Things you should have

Programming/Scripting skills Installation new services may require you to compile or even

debug the application You have to master the shell scripting skill

Ability to understand man pages, log files

Ability to use unix tools Unix provide many tools to help you in admin job

Basic: cd, ls, cat, head, tail Search: which, locate, find Text: cat, head, tail, grep, sed, awk, vi, emacs Process: ps, uptime, top, sar Network: tcpdump, snoop, netstat, ifconfig Disk: du, df, quota, format, fsck

Page 14: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Rules of Thumb

Never restart the system unless you really have to. You can restart some services without restarting the system

Don’t use the graphical interface if you are a true admin!!! Most of configuration files, script, services are in text files Faster as compared to graphical interface You will not confused if you are managing systems with different

unix/linux distribution

Page 15: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Good habits to develop

Write down all your experience, you may need it in the future

Backup important files before you do some modifications. You can do it periodically if you want

You can connect with more than 1 root connections to the system you are administering. In case you messed up with one connection, you can fix it with

the other right away.

Page 16: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

In solving problems

You need all information Username Hostname The way you connect to that hostname The application you were using The error messages The time when you got the error

Can you solve the problem if a user come to you and just said “my account is not working”, “Opnet is not working” ?

Page 17: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Log files

On linux, you can go to /var/log Depends on the application Information shown in log files depend on the debug level you

defined

Page 18: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Check list

Before you begin solving a user problem, you have to check few things: Is it hardware problem Is it network connection problem Is it network problem Is it a specific machine problem Does it happen only to a specific user Etc

Page 19: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Common “User” problem

Forgot the password

Doesn’t have permission

Doesn’t have required environment variables such as PATH

Mistakenly delete some files/folder

Quota exceeded.

Page 20: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Automating Unix Administration You don’t want to spend the whole day making sure that all

servers/workstations and its services are fine

Use monitoring tools that can alert you for any problem in the network mon, nagios, cacti, angel

Create scripts to check the status of servers/services and use cron to run it periodically Mail the result to admin

Page 21: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Example script#!/bin/shmachine="sunfire"down=i=0while [ $i -le 15 ]do sun=$machine"$i" /usr/sbin/ping $sun > /dev/null if [ $? -ne 0 ] then down="$down:$sun" fi i=`echo "$i+1" | bc -l`done

if [ -n "$down" ]thenecho $down | tr : '\012' | /usr/ucb/mail -s "DOWN machines" [email protected]

exit 0

Page 22: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Recommended readings

“Unix system administration handbook” by Evi Nemeth, et. all.

“Automating Unix and Linux administration” by Bauer, Kirk

Page 23: Overview of Unix System Administration Bambang A.B. Sarif Unix System Administrator CCSE, KFUPM

Thank You