370 likes | 738 Views
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. What is UNIX.
E N D
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
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.
The UNIX Umbrella Hardware Vendors Linux Distributions Sun Solaris, HP HP-UX*, Compaq True 64 UNIX*, IBM AIX*, IRIX*, MAC OSX* RedHat, Mandrake†, SuSe, Debian, Caldera, Yellowdog† FreeBSD, BSDI*, NetBSD OpenBSD SCO UNIX (now Caldera/Tarantula) Other BSD Flavors * = Commercial distribution (i.e you must pay for it) † = Derivative of RedHat
Popularity vs. Maturity Popular Sun Solaris RedHat Linux RedHat Linux / Linux Mandrake FreeBSD / NetBSD / OpenBSD, etc. Debian Linux HP-UX Caldera Linux SuSe AIX Irix Compaq True 64 UNIX SCO UNIX Darwin (Mac OSX) Mature Look for more in http://www.distrowatch.com
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.
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.
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
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!
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
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
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!!
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
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
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.
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” ?
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
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
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.
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
Example script #!/bin/sh machine="sunfire" down= i=0 while [ $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" ] then echo $down | tr : '\012' | /usr/ucb/mail -s "DOWN machines" admin@ccse.kfupm.edu.sa fi exit 0
Recommended readings • “Unix system administration handbook”by Evi Nemeth, et. all. • “Automating Unix and Linux administration”by Bauer, Kirk