Linux System, Network, and X Administration

System Administration

Directory Tree

System Startup and Processes

File Systems and Memory Monitoring

System log

Managing Users

New users: /etc/{passwd,group,shadow} and /etc/skel/*
  • skel: contains default scripts for setting session environment.

    Backup

    Rule of thumb: back up all the configuration files (under /etc) before making any updates.

    Network Administration

    This section primarily focuses on the Internet services related to two major TCP/IP transport protocols: TCP and UDP which uses abstract destination points called ports as communication end points. For establishing a small network, refer to this page regarding fast Ethernet.

    Netcfg: is a shell script, which invokes /usr/lib/rhs/netcfg/netcfg.py with GUI interface for hostname, hosts file network interface card and routing configuration. Networking configuration files include: (/etc/hosts, /etc/sysconfig/{network,static-routes},/etc/network-scripts/*)

     
     # ifconfig eth0 10.10.10.1 netmask 255.0.0.0 up     #Host connected to the ISP
     # ifconfig eth0 10.10.10.2 netmask 255.0.0.0 up     #Host not connected to ISP 
     # route add default gw 10.10.10.1 eth0		     #Use the host connected to
                                                          ISP as the gateway
     # ifconfig eth0:1 192.168.30.128 netmask 255.255.255.0
     # route add -net 192.168.1.0 netmask 255.255.255.0 eth0
    
          ----------------------------------------------------------
          | Network | Netmask       | Network Addresses            |
          | Class   |               |                              |
          ----------------------------------------------------------
          |    A    | 255.0.0.0     | 0.0.0.0    - 127.255.255.255 |
          |    B    | 255.255.0.0   | 128.0.0.0  - 191.255.255.255 |
          |    C    | 255.255.255.0 | 192.0.0.0  - 223.255.255.255 |
          | D,E,F   | 240.0.0.0     | 224.0.0.0  - 239.255.255.255 |
          ----------------------------------------------------------
    

    Subnet addressing is used by system administrators in order to further subdivide an Internet address within an organization. This will increase the number of subnets with the cost of reducing number of hosts.

    Classless Interdomain Routing: CIDR provides the mechanisms for breaking networks into "subnets", and combining networks into "supernets". It uses < prefix, length > notation. E.g. 172.16.2.0/23
    Broadcast address refers to all hosts on the network. Traditionally all Host ID with all 1s is used as broadcast address. All 0s refers to "this".
    • Class A: comprises networks 1.0.0.0 through 127.0.0.0. The network number is contained in the first octet. This provides for a 24 bit host part, allowing roughly 1.6 million hosts.
    • Class B: contains networks 128.0.0.0 through 191.255.0.0; the network number is in the first two octets. This allows for 16384 (16320) nets with 65534 (65024) hosts each. Lost 2. Note: 1 class B = 256 class C nets.
      Host ID and subnet masks of all 0s and all 1s are used for broadcasts. So you will lost 2 host addresses. Class B uses the 3_d byte for for subnet mask. Two subnets are lost and each has 255. Therefore 510 host addresses are lost.
    • Class C: networks range from 192.0.0.0 through 223.255.255.0, with the network number being contained in the first three octets. This allows for nearly 2 million networks with up to 254 hosts. Lost 2. (all 1s and 0s)
    • Classes D, E, and F: addresses falling into the range of 224.0.0.0 through 254.0.0.0 are either experimental, or are reserved for future use such as multicast and don't specify any network.
        -----------------------------------------------------------
        |         RESERVED PRIVATE NETWORK ALLOCATIONS            |
        -----------------------------------------------------------
        | Network | Netmask       | Network Addresses             |
        | Class   |               |                               |
        -----------------------------------------------------------
        |    A    | 255.0.0.0     | 10.0.0.0    - 10.255.255.255  |
        |    B    | 255.255.0.0   | 172.16.0.0  - 172.31.255.255  |
        |    C    | 255.255.255.0 | 192.168.0.0 - 192.168.255.255 |
        -----------------------------------------------------------
    

    Services

    • DNS server and client. The most popular DNS server is BIND (Berkeley Internet Name Domain) implemented by Internet Software Consortium

      To configure a dns client, you only have to update two files:
      /etc/resolv.conf & /etc/nsswitch.conf

         domain       origin.com
         nameserver   10.10.10.5
         
         hosts:      files dns
      

      To install and configure a dns server, see this readme for details.

    • NFS: /usr/sbin/exportfs, /etc/exports
      /opt    h1.origin.com(ro)       h2.origin.com(ro)
      
    • Samba: implements CIFS protocol to provide file and print services for Windows clients. You may also refer to the integration of Samba into MS-Win world.
    • Sendmail server [25]: the most popular mail transfer agent. The latest version may be found under this site. Configuration files: /etc/{sendmail.cf,sendmail.cw,aliases}
      # file containing names of hosts for which we receive email
      Fw/etc/mail/sendmail.cw
      
      # my official domain name
      # ... define this only if sendmail cannot automatically determine your domain
      Dj$w.origin.com
      
    • Pop3 server [110]: Qpopper supports POP3 protocol for downloading Internet e-mail using software clients. Qpopper does not include a message transfer agent or SMTP support.
      pop3         110/tcp                # Post Office in services file
      pop3 stream tcp nowait root /sbin/qpopper qpopper -s # inetd.conf
      
    • IMAP [143]: similar to POP3 except IMAP allows allow users to maintain mail folders on the server.
    • LDAP server [389]: Lightweight Directory Access Protocol is a protocol for accessing online directory services. Both Ldap 3.3 and OpenLDAP 1.2.7 provide client libraries to support LDAP feature in sendmail. Netscape has ported DS4.11 to Linux.
    • Mailing list server: majordomo is a full-blown free mailing list server that is written in Perl and relatively easy to set-up, it supports moderated lists as well.
    • Wu-ftp server [21]: the most popular free file transfer protocol server. Be sure that all the files under the $HOME of ftp are owned by root. Two configuration files ( /etc/{shells,ftpusers}) are for determining which shells and which users are allowed to invoke ftp command. Make sure that $HOME/ftp/etc/passwd's password entry contains "*".
    • Apache [80]: the most popular Web server. See Enterprise Integration Servers for details. In the November 1999 survey, Netcraft received responses from 8,844,573 sites.

      Market Share for Top Servers Across All Domains August 1995 - November 1999

      DeveloperOctober 1999PercentNovember 1999PercentChange
      Apache435565853.67484799254.811.14
      Microsoft202359124.93214546124.26-0.67
      Netscape6275717.736538007.39-0.34

    X Window System

    Traditionally, all the X Window System files are stored under /usr/X11R6/{bin,lib,man,doc,include}. Configuration information are detailed under this link.

    Miscellaneous

    • Gnome control-center: to bring up Gnome control-center window, click on the footprint icon. You may select Settings -> Multimedia -> Sound to enable sound service. You may have to reconfigure your kernel to recognize the sound card on your system. To paly CD, bring up xplaycd under graphics mode (i.e. X11).
    • control-panel: GUI tool for general system management such as lilo, system clock, printer, sound, network, kernel, SW packages installation and uninstallation. Note: For configuring parallel port printer, make sure that the kernel is configured properly. dmesg |grep -i lp should show which lp port is configured. If no text displayed, remake kernel with parallel port printer support under the menu of character device.
      If you are running Gnome, click on the foot print of Gnome panel. Select AnotherLevel -> Adminstration -> Printer Tool. Click 'ignore' about when an error message appears. Select 'Add' -> Local Printer -> OK -> OK -> Select Input Filter -> OK -> OK.

      For printing different file formats (such as postscript) under Unix, you need to install apsfilter. Apsfilter contains a SETUP shell script for install and configuring printcap file based upon a wide selection of different printers. CUPS is a web tool for configuring printers including unsupported printers. Software may be found here

      For HP printers, check this web site. Apsfilter does not come with a GUI tool for installation and configuration. Apsfilter will create a printcap file which is a cryptic text configuration for printer.

    • Zip driver also works well under Linux.
      Be sure to select built-in in the following items when making a new kernel (get 2.2.14+):
      General Setup -> Parallel port support
      SCSI support -> SCSI low-level -> IOMEGA parallel port (ppa - older drives)
                                        IOMEGA parallel port (imm - newer drives)
                                        ppa/imm option - Use slow (but safe) EPP-16
                                        ppa/imm option - Assume slow parport control register
      
    • Webmin: Web interface for general system management regarding tweaking DNS, sendmail and system reboot.
    • Reset system clock: /usr/bin/date -> /sbin/hwclock --systohc [--utc]
      One may also use rdate and xntpd to set date from remote host.
    • modem: avoid PCI winmodem.
    • xminicom -s: Modmem configuration
    • ppp (point-to-point protocol): for exchanging IP frames (and others) over a serial link; which is the standard protocol for connecting to ISPs. The kernel has to be configured with ppp module or loaded via "insmod" if you don't want to recompile the kernel. Refer to this how to for PPP hook up. For ADSL connection, you need install PPPoe client. For connecting to worldNet with linux, refer to this page. There are many other free ppp tools to make life easier. There are casese that you may have to use the latest version of ppp daemon.
    • rpm -qa | grep ppp
    • PPP server configured with CHAP
      /usr/sbin/pppd name "webdev" -d connect '/usr/sbin/chat -v -f /etc/ppp/chat-ppp\0' /dev/modem 57600 noipdefault debug modem defaultroute crtscts
      
        where /etc/ppp/chat-ppp0 is something like:
        (Be sure to replace 3331112222 to the modem phone number as well and
         replacing joe blow to your login name and password.)
      
      'ABORT' 'BUSY'
      'ABORT' 'ERROR'
      'ABORT' 'NO CARRIER'
      'ABORT' 'NO DIALTONE'
      'ABORT' 'Invalid Login'
      'ABORT' 'Login incorrect'
      '' 'ATZ'
      'OK' 'ATDT3331112222'
      'CONNECT' ''
      'ogin:' 'joe'
      'ord:' 'blow'
      'TIMEOUT' '5'
      '~--' ''
      
      /etc/ppp/options: 
      
      lock
      crtscts
      defaultroute
      noauth
      asyncmap 0xa0000
      default-asyncmap
      
      
    • RedHat PPP
    • sh gnomeppp or kppp: included in Gnome or Kde desktop
    • wget: is a neat tool web pages download. For retrieving a whole web site, you may enter "wget -r http://www.some.com". The "r" option stands for recursive retrieval. You may also specify what type of files should be rejected (such as "gif" files.). Once your system connects to an ISP, you may kick of wget as a batch job without running X server at all. The next day, you may start up X and netscape to surf web pages retrieved overnight.
    • IP Masquerading is a way to share one single phone line (or DSL/Modem Cable) to the Internet. You need to set up a private network with a hub/switch (or two modems) and designate a Linux box running as the gateway which connects to the Internet via ISP. On the rest of the systems, you need to configure a default gateway with the IP address of the Linux. This can be accomplished by using the 'network' icon under Win/NT or Win98 to configure default gateway. For other linux boxes, add an entry such as GATEWAY=IP_ADDRES_OF_THE_LINUX_BOX into /etc/sysconfig/network or use netcfg to define default gateway. You then run this script or this one on the gatway (the Linux box connected to the ISP. You have to adjust). the IP address in the script.)
    • rdist: for maintaining same copies of files on multiple hosts.
      r host -l remuser rdistd -S
      rdist -P /usr/local/bin/ssh -f myDistfile
      A sample rdistFile:
      HOSTS = ( herHost root@hisHost ) FILES = ( /usr/games /usr/lib ) EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab sendmail.cf ) (${FILES}) -> (${HOSTS}) install -oremove,chknfs ; except /usr/lib/${EXLIB} ; ${FILES} :: /usr/local/lib/timestamp notify me@workOnly;

    References:
    FAQs
    T/TCP: TCP for Transactions
    NTFS
    Linux Docs
    Linux HowTo
    Basic Administration Network Linux System Administration links Printers Samba and networking at home Printer Printing Summit LinuxPR IDE CD-Write Linux & NT Admin Remote Administration Starters for Linux Journaling Filesystems JFS Sendmail on a Firewall Lpr PPPoe Samba Tripwire Samba 2.2 DNS DVD Samba Xine ProcMail for mail filtering Configuration files XOSL Samba Amanda KmyFirewal