| jun96.tar |
Questions and Answers
Bjorn Satdeva One of the questions I get asked most frequently by system administrators new to their trade is what they need to learn in order to get good at their chosen profession (or in some cases the one chosen for them by their manager). I think that they expect me to tell them that they should learn everything about NFS or Sendmail or DNS or something of the kind. Good technical skills are, of course, a must in our profession, but that is only part of the picture. To become a good system administrator, the ability to plan and to focus is also essential. We work in a high-interrupt environment, in which people and phone calls are constantly breaking our train of thought. So how do we learn these skills? For me, an essential part has been to learn good time management. The first element of time management is to plan the day ahead (i.e., what meeting do you need to go to, when is it time to do the backup, and so on). Try to set aside at least an hour of uninterrupted time each day working on strategic issues, the stuff that would make your life easier if it were done, but that you never find the time to do. It can be difficult to justify to other other people and especially to yourself, when there are a dozens fires burning all around you. Nevertheless, if you try for at least a couple of weeks to do so, you will be amazed at the results you can produce. Try also for a few weeks to carry a small notebook around with you, and make minute notes of how you spend your time. When you get interrupted, make a note. When you doze off or are just staring into nowhere for a few minutes, note it down. Keep track of how much time you spend on NetNews or browsing the Web. You may be surprised at how you actually spend (or rather waste) your time. Most system administrators are unable to keep their work week to just 40 or 45 hours a week, and some work much more than that. Wouldn't it be nice if you could cut a few hours off your work week, and maybe have a weekend now and then? So, pull out the notebook, and get to work on your work habits!
I am trying to find an easy (if there is such a thing) way to calculate what yesterday's date was from within a shell script. I'm getting hung up on trying to deal with month and year changes. I'm writing a system auditing script for novice systems administrators that will go through the system log files and pick out those entries from the previous day that might need attention. Note that this is not intended to be run on servers, but on UNIX workstations that typically have 1-3 users and very little activity.
You can get yesterday's date in Perl, with very little code. The following script illustrates what you need to do (remember that there are 86,400 seconds in a 24-hour period):
#! /usr/bin/perl require "ctime.pl"; $Yesterday = &ctime( time - 86400 ); print "$Yesterday";
The HTTPD Team at SDG at NCSA has provided a solution that is described in detail in the CERT advisory. The advisory can be found in a file named:
CA-95:04.NCSA.http.daemon.for.unix.vulnerability
You can get it from the CERT ftp server or from the system administration ftp archive at:
ftp://ftp.sysadmin.com/pub/admin/alert/cert/advisory
Anybody who runs the NCSA server should make sure that this patch is indeed applied to their sources from which the server is built.
My thought is that we could use something like TIA or SLiRP. But preventing access to other machines would require another box as a comserver that had a host entry only for the web server. Is there a cleaner way?
Your suggestion of having an extra system with only the web server in the host file will hardly stop anybody who wants to get access through that system. It is possible to build a solution to this problem using firewall technology, but unless you are accustomed to dealing with network security and Internet firewalls, this is not something to implement without a very good understanding of the issues involved. You might also discover that your customer will not trust such an implementation, and will still refuse connectivity (See my column in the May issue of Sys Admin to see a few scratches of the World Wide Web nightmare waiting to unfold.) You might need to provide an old technology-style solution to some of your customers, so they can dial-in to an old-fashioned bulletin board and get the information that way.
ftp://ftp.sysadmin.com/pub/admin/papers/bjorn
It is my plan to make them all available in my copious spare time.
The tool I am after should store all edited system files (passwd, rc.local, /etc/exports, etc.) from all hosts under a common backup directory something like /sysadm/<HOST>/<original path>/RCS/<original file> so that an edited version of /etc/exports from the host "hosta" would end up in /sysadm/hosta/etc/RCS/exports,v. This tool should also handle the cases where the input file is on an automounted filesystem, either the vendor stock automounter or amd. The tool should handle several input files on the command line, both with relative and absolute paths. Do you know if such a tool exists?
awk '/pattern/ {print $1}' pattern=parameter datafile
For people who have never used Perl, the interpreter is available from the ftp archive:
ftp://ftp.sysadmin.com/pub/admin/languages/perl4
and
ftp://ftp.sysadmin.com/pub/admin/languages/perl5
Larry Wall and friends have done an incredible amount of work to make this program compile on a very large number of machines. There are two good books on how to use Perl, Learning Perl by Randal L. Schwartz and Programming Perl by Larry Wall and Randal L. Schwartz, both from O'Reilly and Associates.
ftp.sysadmin.com:/somefile
and sometimes the World Wide Web notation:
ftp://ftp.sysadmin.com/somefile
Why are you switching between them?
About the Author
Bjorn Satdeva is the president of /sys/admin, inc., a consulting firm which specializes in large installation system administration. Bjorn is also co-founder and former president of Bay-LISA, a San Francisco Bay Area user's group for system administrators of large sites. Bjorn can be contacted at /sys/admin, inc., 2787 Moorpark Ave., San Jose, CA 95128; electronically at bjorn@sysadmin.com; or by phone at (408) 241-3111.
|