home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Mammon_ / LinuxTale.txt < prev    next >
Text File  |  2000-05-25  |  72KB  |  1,425 lines

  1.                       Mammon_'s Tales to  Tux's Grandson
  2.                     Scalable Demand-Paged World Domination
  3.  
  4.  
  5. It should be a fair assumption that any person reading this will have some concept
  6. of what the Linux operating system is, and what its installation and operation in 
  7. general entail. The purpose of this document is not to provide a quick how-to for 
  8. installation of the various linux distributions, nor to fully document the 
  9. countless networking and programming utilities that are shipped with a standard 
  10. linux product; rather, this document is intended to demonstrate the degree of 
  11. control which the user/admin will have over all aspects of the linux environment, 
  12. and to provide an encapsulated "post-installation guide" detailing the changes that 
  13. must be made to the typical linux installation in order to make the OS more usable, 
  14. secure, and efficient than the default installation will provide.
  15.  
  16. This document was prepared while installing Slackware 4.0 on a Dell Latitude 
  17. connected to a 5-node LAN; however an attempt has been made to strip all 
  18. machine- and distribution-specific changes from what follows.
  19.  
  20.  
  21.  
  22.  
  23. Kernel Compilation
  24. ------------------
  25. This should be the very first thing you do. Compiling the kernel sounds complex 
  26. and intimidating; in reality it is a simple process requiring about 4 commands, 
  27. a lot of help file perusing, a LILO MBR update, and a reboot. Compiling the 
  28. kernel is the only way to get the majority of linux's optional features [and a 
  29. large number of 'nonstandard' devices] to work; it is required in order to get 
  30. any degree of processor optimization in the kernel; and since it is done some-
  31. what frequently, it has become a very simple, very streamlined process.
  32.  
  33. To begin with, change to the kernel source code directory:
  34.  root@local>cd /usr/src/linux
  35. This should be a link to /usr/src/linux-[version#], although occasionally one 
  36. will come across a linux distribution [Caldera] that neglects this standard.
  37.  root@local>make menuconfig
  38. This will launch an ncurses menu-based kernel configuration utility; note that 
  39. one can use 'make config' for a pure text-based version, or 'make xconfig' for 
  40. an X-windows version of the same utility. The options chosen here depend largely 
  41. on machine hardware and administrator preference, but here are some general 
  42. guidelines:
  43.  Code Maturity: Defaults are OK.
  44.  Processor Type: set this to the appropriate Intel version number; also, enable 
  45.                 MTRR support in this section.
  46.  Loadable Module Support: Enable these and the kernel module loader
  47.  General Setup: Enable APM if your motherboard supports it; the rest of the 
  48.                defaults should suffice.
  49.  Plug an Play Support: Defaults are OK.
  50.  Block devices: Remove unused devices [RAID, XT drive support, etc], even if 
  51.                they are modules, in order to save compile time.
  52.  Network Options: Enable syn cookies. If you plan to use your box as a firewall 
  53.                  then read up on the various networking options. For general 
  54.          internet dialup firewalling, enable the IP:firewalling option 
  55.          and select the packet netlink device.
  56.  SCSI and Network Devices: Remove all unused devices. 
  57.  Amateur Radio Support: Disable everything.
  58.  IrDA: Configure these for infrared port devices.
  59.  ISDN, Old CD-ROM: Disable unless necessary.
  60.  Character Devices: Make sure virtual terminals are enabled; most of the dumb 
  61.                    terminal options can be disabled. The nvram and enhanced RTC 
  62.            options [access to the CMOS and Realtime Clock] are good for 
  63.            system programmers; the video capture ["video for linux"], 
  64.            joystick, and floppy tape drivers may be configured if 
  65.            necessary.
  66.  File Systems: Enable Quotas, FAT/VFAT/NTFS support [if needed], and ISO9660 
  67.               filesystems -- the rest of the file systems and code pages can be 
  68.           added to taste.
  69.  Console Drivers: Remove Frame Buffer Support.
  70.  Sound: Configure as needed.
  71.  
  72. A few general notes: Always implement devices as modules if possible; the kernel 
  73. should be kept small [exceptions being the primary NIC driver and any fundamental 
  74. SCSI/CDROM drivers needed to boot the system]. Also, during the configuration 
  75. always be sure to check the 'help' text on unfamiliar or unclear kernel options 
  76. to be certain whether or not to enable them.
  77.  
  78. At this point the kernel and modules can be compiled using the following commands:
  79.  root@local>make dep
  80.  root@local>make zImage
  81.  root@local>make modules
  82.  root@local>make modules_install
  83. or they can be combined into one line:
  84.  root@local>make dep; make zImage; make modules; make modules_install
  85. This will put the kernel in /usr/src/linux/arch/i386/boot/zImage; the kernel 
  86. should be copied to /boot and a new LILO entry added [edit /etc/lilo.conf and 
  87. run lilo -v to add the new kernel entry] -- it is good to keep the kernel created 
  88. by the distribution install as a "backup" kernel. Note that each time the kernel 
  89. is compiled, LILO should be run to update the bootsector. It should also be noted 
  90. that the modules will be stored in /lib/modules/[version#]; since some distrib-
  91. utions [Slackware] probe existing modules at startup, this directiry should be 
  92. renamed to /lib/modules/old before the 'make modules_install' command is run.
  93.  
  94. Reboot the machine to test LILO and the kernel. Once logged in, use
  95.  root@local>dmesg
  96. to check if there were any errors during startup, and to make sure all devices 
  97. were detected.
  98.  
  99. Kernel Modules
  100. Loadable kernel modules are akin to device drivers or VxDs in the Win32 environ-
  101. ment; they exist to keep the base kernel as small in size as possible, and to 
  102. allow dynamic loading and unloading of device drivers. As an example, one could 
  103. compile support for Iomega Zip drives as a module so that a Zip drive can be 
  104. connected to an already-booted system and the driver for that drive loaded with 
  105. a simple 'insmod ppa' command.
  106.  
  107. Kernel modules are loaded with the 'insmod' or 'modprobe' utilities; insmod loads 
  108. a single module [*.o file in /lib/modules/version#], while modprobe loads a 
  109. module and every module it depends on [useful for sound cards which have 4-5 
  110. modules for the various midi/wave/synth devices] and requires a table created by 
  111. depmod to determine dependencies. Depmod is often called by the rc scripts 
  112. provided with the distribution; it is good practice to invoke it after a kernel 
  113. compilation to ensure that dependencies are generated for all new modules:
  114.  root@local>depmod -a
  115. A list of the currently loaded modules can be printed with the following command:
  116.  root@local>cat /proc/modules
  117. Loaded modules can be unloaded with the 'rmmod' utility.
  118.  
  119. Usually the sound card is the toughest thing to get running; however, since most 
  120. PC sound cards are to some extent SoundBlaster compatible, and since Sound
  121. Blaster cards default to specific IRQ and I/O Address values, the following line 
  122. will in most cases enable sound on a PC:
  123.  root@local>modprobe sb io=0x220 irq=5 dma=3 dma16=5 mpu_io=0x300
  124. Note that this works without 'sndcfg' or similar utilties, and requires that the 
  125. 'soundblaster' modules be compiled in the kernel [it is advisable to compile the 
  126. various sound card child modules such as the UART, FM, and OPL devices in case 
  127. the card does not use the Sound Blaster default versions].
  128.  
  129. Different distributions handle modules differently; some load every module under 
  130. /lib/modules/version#, some use a startup script to determine which modules 
  131. should be loaded, and some place the modprobe commands directly in the runlevel 
  132. change [rc] files. Slackware, for example, has an rc.modules script that loads 
  133. specific modules; Debian loads every module specified in /etc/modules; Caldera 
  134. maimtains a similar list of modules in /etc/modules/version#/defaults. Be certain 
  135. to keep all compiled modules in /lib/modules/version# in order for modprobe and 
  136. depmod to find them.
  137.  
  138.  
  139.  
  140. FileSystems
  141. -----------
  142. In Unix, a partition is termed a 'filesystem'; a disk can be partitioned to hold
  143. multiple filesystems of various types [EXT2, NTFS, FAT, UFS, etc]. Support for 
  144. various file system types can be compiled into the linux kernel or loaded as 
  145. kernel modules; additional filesystems can be mounted relative to the root [/] 
  146. or boot filesystem. In order to do this, mount points [empty directories] must 
  147. be created at the point in the root directory tree; filesystems can then be 
  148. mounted and unmounted using the following commands:
  149.  root@local>mount [device] [fs type] [mount point]
  150.  root@local>umount [mount point]
  151. Assuming one's root partition is on /dev/hda1, swap is on /dev/hdb1, a DOS 
  152. partiion is on /dev/hdb2, a linux partition containing the /usr directory tree 
  153. is on hdc1, and a cdrom is on /dev/hdd, one would need the following mount 
  154. commands:
  155.  root@local>mount  /dev/hdc1 -t ext2 /usr
  156.  root@local>mount /dev/hdb2 -t msdos /home/msdos
  157.  root@local>mount /dev/hdd -t iso9660 /cdrom
  158. These partitions can be pre-configured or even mounted automatically by adding 
  159. them to the file /etc/fstab, which contains filesystem definitions. An fstab 
  160. file for this setup might appear as follows:
  161.  
  162. #/etc/fstab
  163. #__Device_____Mount_Point__FS_Type____Options___________________Dump_Pass_
  164. /dev/hda1     /            ext2       defaults,errors=remount-ro  0    1
  165. /dev/hdb1     none         swap       sw                          0    0
  166. proc          /proc        proc       defaults                    0    0
  167. /dev/hdc1     /usr         ext2       defaults,errors=remount-ro  0    2
  168. /dev/hdb2     /home/msdos  msdos      defaults                    0    0
  169. /dev/hdd      /cdrom       iso9660    ro,user,noauto              0    0
  170. /dev/fd0      /floppy      msdos      defaults,user,noauto        0    0
  171. #---------------------------------------------------------------------EOF
  172. Note that the root, swap, and /proc filesystems are configured in the fstab 
  173. already. The important column in fstab is 'options'; it allows the partition to 
  174. be auto-mounted ['defaults'] or not ['noauto'], to be mounted by a user ['user'],
  175. to be mounted read-only ['ro'], and to be remounted as read-only in case of file 
  176. system errors. The 'Dump' column is used to determine which filesystems will be 
  177. backed up using the Unix 'dump' command, and 'Pass' refers to the order in which 
  178. fsck will repair the systems in case of error [root should be given a value of 
  179. 1, all other ext2 partitions should have a value of 2, and partitions that are 
  180. to be ignored by fsck should have a value of 0]. 
  181.  
  182. The file /etc/mtab contains a list of currently mounted filesystems; it can be 
  183. viewed with an editor or by using the command 'mount' with no parameters.
  184.  
  185. The Unix directory tree structure seems to cause its share of confusion to non-
  186. unixers; as such it could do with a some explaining. In general, a Unix file-
  187. system tree contains the following structure:
  188.     /bin           binary [program] files 
  189.     /etc           configuration information
  190.     /incl        header files [for development]
  191.     /lib        shared libraries 
  192.         /lost+found    files recovered from FS errors
  193.     /man        manual [help] pages
  194.     /sbin        administration programs, daemons
  195.     /share        shared data, applets, gifs, etc
  196. This basic structure will be repeated in further subdirectories, usually to 
  197. represent installed programs and data that are required for system boot and 
  198. recovery [/], that are identical for all machines on that site [/usr], or that 
  199. are specific to the local machine [/usr/local] -- the idea being that / is on 
  200. its own parition so that FS crashes on /usr do not take it out, that /usr is 
  201. more or less static and can easily be recreated from a CD image, and that /local 
  202. contains data or programs that constantly change.
  203.  
  204. That said, there is not a lot of regulation to linux filesystem structure; a 
  205. common setup will look like this:
  206.  /
  207.  _/bin            binaries required for boot/recovery
  208.  _/boot            kernel images
  209.  _/dev            device files
  210.  _/etc            system configuration
  211.  _/home            user data directories
  212.  ___/[user]        data files for [user]
  213.  ___/ftp        ftp root directory
  214.  _____/pub        public-access files
  215.  ___/http        www root directory
  216.  _____/cgi-bin        CGI scripts
  217.  _____/www        WWW pages
  218.  ___/root        data files/home directory for superuser
  219.  _/lib            basic required libraries
  220.  _/lost+found        recovered files under /
  221.  _/mnt            mount points
  222.  ___/cdrom        mount point for cdrom
  223.  ___/floppy        mount point for floppy
  224.  ___/msdos        mount point for msdos file system
  225.  ___/tmp        temporary mount point
  226.  _/opt            commercial [licensed] software
  227.  _/proc            proc "live" file system
  228.  ___/[PID#]        stats for program [PID]
  229.  ___/bus        PCI/PnP/PCMCIA bus stats
  230.  ___/fs            fs stats
  231.  ___/ide        ide bus stats
  232.  ___/net        network stats
  233.  ___/parport        LPT stats
  234.  ___/scsi        SCSI bus stats
  235.  ___/sys        system stats, kernel tables/variables
  236.  ___/tty        tty driver stats
  237.  _/sbin            required administration programs, daemons
  238.  _/tmp            temporary/scratch directory
  239.  _/usr            site-specific directory tree
  240.  ___/X11R6        X Windows subsystem
  241.  _____/bin        X binaries
  242.  _____/include        X header files [development]
  243.  _____/lib        X libraries, shared files, and configuration
  244.  _____/man        X manual pages
  245.  _____/share        X shared data, images, etc
  246.  ___/bin        Site-specific applications and utilities, compilers
  247.  ___/doc        Application/Distribution documentation, READMEs
  248.  ___/etc        Application configuration
  249.  ___/games        Business productivity tools
  250.  ___/include        Library/standard header files
  251.  ___/info        Help system [alternative to man pages]
  252.  ___/lib        Shared libraries
  253.  ___/local          Machine-specific directory tree
  254.  _____/bin        Downloaded share/freeware [freshmeat mirror ;) ]
  255.  _____/etc        User application configuration
  256.  _____/include        Header files for downloaded libraries
  257.  _____/lib        Shared libraries for downloaded software
  258.  _____/man        Manual pages for downloaded software
  259.  _____/share          Shared data, images for downloaded software
  260.  ___/lost+found        Recovered files from /usr
  261.  ___/man        Manual pages for applications
  262.  ___/sbin        Administrator utilities
  263.  ___/share        Shared data, images, etc
  264.  ___/src        Kernel source, application source trees
  265.  ___/tmp        Temporary [scratch] directory
  266.  _/var            Variable-size files
  267.  ___/adm        System log files
  268.  ___/lock        Lock files
  269.  ___/log        Application log files
  270.  ___/news        Downloaded news
  271.  ___/run        Temp files containing PIDs referenced by programs
  272.  ___/spool        Mail and print queues
  273.  ___/tmp        Temporary files [again]
  274.  
  275. And that's the short-short version...
  276.  
  277. It is evident that there is a lot of redundancy --not to mention confusion-- in 
  278. the standard linux directory tree. This is primarily due to differing views 
  279. among software and distribution authors regarding where specific files should be 
  280. loated; it is also a means of breaking up the thousands of files shipped with 
  281. linux into more manageable subsets. Some of the breakup is intended to be for 
  282. hard drive layouts designed to minimize damage and prevent growing filesystems 
  283. such as /var from filling up the root filesystem; it is often recommended to 
  284. partition one's hard drive with this in mind:
  285. _Mount_Point_______Size___
  286.   /                 200  MB
  287.   /home             50   MB/user
  288.   /opt              N/A  [symlink to /usr/opt]
  289.   /usr              500+ MB
  290.   /usr/local        500+ MB
  291.   swap              ??   [2x RAM]
  292.   /var              25   MB
  293.  
  294. With workstations this is not strictly necessary; however it does make install-
  295. ing and managing multiple workstations a lot easier.
  296.  
  297.  
  298.  
  299. Config Files
  300. ------------
  301. Most programs and shells have configuration or "rc" files to determine program 
  302. behavior; the system-wide rc files are stored in /etc, while user-specific rc 
  303. files are stored in the home directory [~/] of the user. To configure shells or 
  304. software, copy the appropriate rc file from the /etc directory to the home 
  305. directory, and precede it with a period -- e.g. for bash one would copy 
  306. /etc/bashrc to ~/.bashrc and modify it to provide shell startup commands. Common 
  307. files that the user will want to override include /etc/bashrc, /etc/vimrc, and 
  308. /usr/X11R6/lib/X11/xinit/xinitrc.
  309.  
  310. The ~/.bashrc file is essentially a shell script that is executed every time 
  311. the bash shell is run [e.g., in an x-terminal, by typing 'bash', or by using 
  312. su to change users] -- note that when bash is run as a 'login shell' [i.e., 
  313. invoked by 'login', or in an xterm invoked with the -ls parameter] the file 
  314. ~/.profile is used instead of ~/.bashrc; in general, it is a good idea to put
  315. commands common to both files into ~/.bashrc only, then source ~/.bashrc from
  316. within .profile [ lit, '. ~/.bashrc' ].  Any standard shell commands in the 
  317. startup file will be executed by bash; this includes variable assignments 
  318. [such as $PATH changes] and aliases. A standard ~/.bashrc might look as 
  319. follows:
  320.   #----------------------------~/.bashrc
  321.   export PATH=$PATH:/usr/local/bin
  322.   alias BB='xinit /usr/X11R6/bin/blackbox'
  323.   alias vi='/usr/bin/vim'
  324.   TTY=`tty | sed 's/.*tty/tty/'`
  325.   export PS1='$PWD[$TTY]>'
  326.   #----------------------------------EOF
  327. This does not contain too many surprises. The first line sets the PATH variable 
  328. and makes it available to child shells with the 'export' command; the second 
  329. lines sets an alias which allows X-Windows to be called with a specific window
  330. manager, overriding the ~/.xinitrc file. The standard 'vi' command is overridden 
  331. and forced to invoke vim in the third line. The fourth line sets the variable TTY to 
  332. the output of the tty utility [this returns the current tty device, which is 
  333. then stripped of the '/dev/'prefix via a quick sed call]; notice how commands can
  334. be executed by using backticks [` instead of ']. The final line sets the prompt 
  335. [PS1; see the bash man page] to reflect the current working directory and the 
  336. terminal number. Those used to job control shells may want to set the PS1 in 
  337. their ~/.profile  [or ~/.bashrc, for non-login shells] to
  338.    PS1='$PWD[$HISTCMD]>'
  339. to reflect the 'history' number of the current command. Further ideas for Bash
  340. prompt configuration can be found in the LDP Bash-Prompt HOWTO.
  341.  
  342. There are two versions of the standard Unix editor 'vi' shipped with linux: elvis 
  343. [the dull one], and vim ['vi improved' -- the good one]. When the 'vi' command is 
  344. aliased or symlinked to vim, and when the ~/.vimrc file is set up correctly, vi 
  345. becomes a powerful editting too. Consider the following ~/.vimrc:
  346.   "----------------------------------------------.vimrc
  347.   syntax on         "use cool colors
  348.   set ruler         "show line/col in statusbar
  349.   set autoindent    "follow previous indentation
  350.   set cindent       "indent at }'s
  351.   set noerrorbells  "don't beep
  352.   set showmode      "show mode in statusbar
  353.   set showcmd       "show commands in statusbar
  354.   set smartindent   "follow }'s
  355.   set smarttab      "follow tabs
  356.   set softtabstop=3 "god uses 3 tabs!!
  357.   set tabstop=3     "rational tab spacing
  358.   set nowrap        "no 80-col wrap
  359.   "-----------------------------------------------EOF
  360.   [note that vim uses " instead of # for comments]
  361. The typical vim installation includes syntax highlighting files for common languages 
  362. [HTML, asm, C, perl, Tcl, sh, etc] in /usr/share/vim/syntax. The line 'syntax on' 
  363. enables syntax highlighting based on file extension; note that the terminal type 
  364. must be 'linux' or something similar for this to work effectively. Following this 
  365. line are a number of useful settings for programming in vim -- a ruler [line and 
  366. column# displayed at the bottom of the screen], C-style "smart" autoindenting, 3
  367. space tabs, and no 80-column line wrapping. Further options can be found in the 
  368. vim online help which is access by typing ":help" when in command [not insert] 
  369. mode; help can be exitted using the standard ":q" command.
  370.  
  371. Another interesting vim trick involves a change to the ~/.bashrc. Add this series 
  372. of lines to ~/.profile or ~/.bashrc [whichever is applicable]:
  373.   #------------------------------------------------------------------StartInsert
  374.   function dump () {
  375.         objdump -d -C -r -t $1 | vim - -c so/usr/share/vim/syntax/asm.vim +/main
  376.   }
  377.   export dump
  378.   #--------------------------------------------------------------------------EOF
  379. This will create a command called 'dump' which will send a file [e.g. 'dump 
  380. /opt/vmware-distrib/vmware'] to objdump, and the resulting disassembly will be 
  381. piped to vim --which can create a file from text sent via STDIN-- with the .asm
  382. syntax file preloaded. 
  383.  
  384. The final configuration file that most users will modify is the xinitrc file. In 
  385. most distributions, this calls a host of other files to determine specific X 
  386. settings; in general, however, it need only contain the name of a single file to 
  387. execute [usually the window manager]:
  388.   #-----------------------.xinitrc
  389.   /usr/local/bin/enlightenment
  390.   #----------------------------EOF
  391. Additional programs can be added to this file --such as xterms, clocks, WM dock
  392. modules-- so that they can be run automatically after the window manager has 
  393. started; when this is the case, every program name must be followed by a "&" to 
  394. start it in the background, with the exception of the last program listed, which 
  395. should be started in the foreground:
  396.   #-----------------------.xinitrc
  397.   /usr/local/bin/enlightenment &
  398.   /usr/local/bin/Eterm &
  399.   /usr/local/bin/wmapm &
  400.   /usr/local/bin/wmtop &
  401.   /usr/local/bin/wmmon &
  402.   /usr/local/bin/xmatrix
  403. #------------------------------EOF
  404. The X options defined in ~/.xinitrc determine the behavior of X when it is 
  405. launched with the 'startx' command; these options can be overridden when the 
  406. 'xinit' command is called directly.
  407.  
  408.  
  409.  
  410. Virtual Consoles
  411. -----------------
  412. One of the most endearing features of linux is its use of virtual consoles -- 
  413. enabling the user to start a new console [and a new login session] at any time, 
  414. and to switch between consoles using Alt and Function key combinations [e.g., 
  415. Alt-F1 for console 1, Alt-F2 for console 2, etc]. In most distributions only 4-6 
  416. of these consoles are enabled; while this is enough for most users, there are 
  417. occasions [such as when writing a linux configuration guide while brushing up 
  418. on Perl CGIs and developing some linux asm examples] when more virtual consoles 
  419. may be needed.
  420.  
  421. The virtual consoles are represented by the /dev/tty# files; /dev/tty1 is the 
  422. first virtual console, /dev/tty2 is the second, etc. The current tty device can 
  423. be identified by typing 'tty' at the command line.
  424.  
  425. The main system initialization file is /etc/inittab; it describes the system run 
  426. level changes and any initialization that is common across run levels -- such as 
  427. virtual consoles. In the /etc/inittab file, there will be a few lines similar to: 
  428.   c1:1235:respawn:/sbin/agetty 38400 tty1 linux
  429. The first field ['c1'] is simply a label that must be unique for each line; the 
  430. second and third define the run levels affected and how to run the program. The 
  431. fourth field, '/sbin/agetty' contains the program to run and it parameters; in 
  432. the case of virtual consoles the program is 'agetty' and takes the following 
  433. form:
  434.     /sbin/agetty [baud] [device] [terminal type]
  435. For adding virtual terminals, the only thing that must be changed is the device 
  436. parameter; every additional device added will be available after the next run 
  437. level change. Usually 8-10 virtual consoles are enough, while leaving one 
  438. virtual console for X-Windows and one more "just in case"; this would result in 
  439. an inittab section as follows: 
  440.   c1:1235:respawn:/sbin/agetty 38400 tty1 linux
  441.   c2:1235:respawn:/sbin/agetty 38400 tty3 linux
  442.   c3:1235:respawn:/sbin/agetty 38400 tty3 linux
  443.   c4:1235:respawn:/sbin/agetty 38400 tty4 linux
  444.   c5:1235:respawn:/sbin/agetty 38400 tty5 linux
  445.   c6:1235:respawn:/sbin/agetty 38400 tty6 linux
  446.   c7:1235:respawn:/sbin/agetty 38400 tty7 linux
  447.   c8:1235:respawn:/sbin/agetty 38400 tty8 linux
  448. Note that 'terminal type' refers to the value that will be assigned to the $TERM
  449. variable for the login shell on that device; to take advantage of the color 
  450. capabilities of the linux console [e.g. using 'vi', 'ls', and ncurses programs]
  451. this should be set to 'linux' [advanced terminal emulators such as Eterm, Aterm, 
  452. and Rxvt can also use this to provide colored terminals in X-Windows].
  453.  
  454. Knowing the virtual console type and device number can be very useful for 
  455. communication between consoles. Each virtual console has a tty device that can 
  456. be written to, and a vcs device that can be read from. To send a message to 
  457. the second virtual console, one could type
  458.  root@local>echo Message >> /dev/tty2
  459. The contents of the second virtual console could be read with the command
  460.  root@local>cat /dev/vcs2
  461. This has limited use in the command line, but it does enable the contents of 
  462. consoles to be read from X-Windows without switching back to console mode. If 
  463. one configures the syslog daemon to send output to virtual consoles --especially 
  464. ones numbered greater than 12, which can be configured to have no login shell 
  465. and no means of switching via Alt-F# key combinations [although one can still 
  466. cycle through the allocated console with ALT+left/right arrow-- then the log output 
  467. can be checked simply by cat'ing the vcs file. An example of writing to and reading 
  468. from 'inaccessible' tty devices proves it is quite simple:
  469.  root@local>cat /etc/passwd >> /dev/tty20
  470.  root@local>cat /dev/vcs20 | more
  471. Configuring virtual terminals and log files correctly allows one to set up xterm 
  472. windows tailing with constant update each console ['tail -f /dev/vcs20'], thus 
  473. allowing realtime system monitoring without tying up potentially useful virtual 
  474. console numbers.
  475.  
  476. Virtual console displays can be manipulated more extensively using escape sequences 
  477. in conjunction with 'echo -e'; see the man pages for 'console', 'console_codes', 
  478. and 'charsets' for more information.
  479.  
  480.  
  481.  
  482. Log Files
  483. ---------
  484. The linux system logging daemon is named 'syslogd' and is configured by the file 
  485. /etc/sylog.conf; detailed information can be found via 'man sysklogd' and 'man 
  486. syslog.conf'. The syslog facility contains support for complex log setups, 
  487. including the ability to log to and from remote hosts via network sockets. As with 
  488. most daemons, it can be restarted with 'kill -HUP [pid]' in order to make it 
  489. re-read its configuration file.
  490.  
  491. The typical linux workstation does not need very extensive logging facilities; in 
  492. fact, most of the log messages can be ignored in favor of saving hard drive space. 
  493. The /etc/syslog.conf file provides a way of determine which types of messages get 
  494. logged, and where they got logged to.
  495.  
  496. The syslog.conf file groups messages by 'facility' [source of the message] and 
  497. 'priority' [type of message], then routes messages based on what 'action' [where
  498. to write the message] is associated with a specific facility and priority. The 
  499. general syntax is
  500.   [facility].[priority]                [action]
  501. where wildcards are supported; thus the line
  502.   *.*                                        /dev/null
  503. would cause all messages to be ignored.
  504.  
  505. The facilities available for logging are auth, authpriv, cron, daemon, kern,
  506. lpr, mail, mark, news, syslog, user, uucp, and local0-local7; these reflect
  507. the system service or daemon responsible for generating the message. The message 
  508. priority can be [in order of increasing severity] debug, info, notice, warning,
  509. err, crit, alert, and emerg. 
  510.  
  511. Multiple facilities with the same priority can be specified by comma-delimiting
  512. the priorties, such that 'kern,daemon.emerg' will match all kernel and daemon 
  513. messages of emergency priority. Wildcards can be used as well, so that '*.emerg'
  514. would match emergency priority for all facilities, and 'kern.*' would match all 
  515. kernel messages. Exclamation points may be used to exclude ["NOT"] priorities, and 
  516. the equal sign can be used to match only the stated priority [otherwise the stated 
  517. priority and above are matched].
  518.  
  519. The action can be a file or a device name to which the messages will be written.
  520. The default setup for syslog.conf is usually as follows:
  521.   #------------------------------------syslog.conf
  522.   *.=info;*.=notice    /usr/adm/messages
  523.   *.=debug             /usr/adm/debug
  524.   *.err                /usr/adm/syslog
  525.   #--------------------------------------------EOF
  526. Linux, however, allows for much more sophisticated logging. Assume that virtual 
  527. consoles from 20 up are going to be free for logging purposes; they can be 
  528. assigned aliases in ~/.bashrc or ~/.profile to fit their intended purpose:
  529.   alias KernelLog='tail /dev/vcs20'
  530.   alias DebugLog='tail /dev/vcs21'
  531.   alias CronLog='tail /dev/vcs22'
  532.   alias DaemonLog='tail /dev/vcs23'
  533.   alias AuthLog='tail /dev/vcs24'
  534.   alias Misc='tail /dev/vcs25'
  535. Now, the associated ttys can be written to by reconfiguring the syslog.conf:
  536.   kern.err                                /dev/tty20
  537.   *.debug                                /dev/tty21
  538.   cron.err                                /dev/tty22
  539.   daemon.err                            /dev/tty23
  540.   auth.warn;authpriv.warn            /dev/tty24
  541.   user.warn; mail.warn                /dev/tty25
  542. Of course this is by no means a complete syslog.conf file; these are simply logs
  543. that are available for 'online viewing' using the provided aliases. A possible 
  544. setup for permanent logfiles might be as follows:
  545. mail.none;news.none;*.=info;*.=notice             /usr/adm/messages
  546.   *.=debug                                        /usr/adm/debug
  547.   *.=alert;*.=emerg                               root
  548.   auth,authpriv.*                                 /usr/adm/authlog
  549.   cron,daemon,kern,syslog,user.err                /usr/adm/syslog
  550.   daemon.info;daemon.notice                       /usr/adm/daemonlog
  551.   mail.info;mail.notice                           /usr/adm/maillog
  552. This will split the logged messages into manageable files and will email the 
  553. superuser for any serious problems.
  554.  
  555. In addition to the log files created by the syslog daemon, linux maintains in 
  556. the /var/adm directory the files lastlog [logs each user's last login time], 
  557. sulog [log of 'su' command usage], and wtmp [user logins & logouts, system 
  558. starup & shutdown]. Note that the utility 'last' can be used to view the 
  559. information contained in the wtmp file.
  560.  
  561. Various log colorizing/browsing utilities are available for linux, such as 
  562. ACL and logcolorise.pl . The latter program is particularly useful out of 
  563. the box; one can route colored log output to an unused tty by placing a 
  564. command such as "tail -f /var/adm/messages | logcolurize.pl > /dev/tty10 &" 
  565. into one's startup scripts; thus, a quick perusal of the log files is just
  566. an Alt-F10 away.
  567.  
  568.  
  569.  
  570. Network Setup
  571. -------------
  572. The configuration files for the network are located in the /etc directory. Many 
  573. of them can be left in the default configuration, however they should be 
  574. explained in case further configuration is necessary:
  575.   aliases -- Sendmail email aliases
  576.   inetd.conf -- Inet [TCP/IP] daemon configuration
  577.   dhcpd.conf -- DHCP configuration
  578.   exports -- Exported NFS shares
  579.   ftpaccess -- FTP configuration
  580.   ftpgroups --Define FTP access groups 
  581.   ftpusers -- Users that are not allowed FTP access
  582.   gateways  -- Specify system gateways
  583.   HOSTNAME -- Specify system machine name
  584.   host.conf -- Hostname lookup order 
  585.   hosts -- Static [local] hostname to IP mapping
  586.   hosts.allow -- List of hosts allowed to use INET services 
  587.   hosts.deny -- List of hosts not allowed to use INET services 
  588.   login.access -- Permission file for local logins
  589.   mail.rc -- Configuration for 'mail' email program
  590.   mailcap -- Email support for MIME types`
  591.   named.conf -- BIND configuration file
  592.   networks -- Networks the machine belongs to
  593.   nntpserver -- Specify NNTP [news] server.
  594.   protocols -- List of protocols provided by the TCP/IP suite
  595.   resolv.conf -- DNS serverconfiguration file 
  596.   rpc -- Configuration file for portmap [IPC to TCP/IP port # mapping] 
  597.   sendmail.cf -- Sendmail configuration file
  598.   services -- List of the services assigned to each port
  599.   
  600.  
  601. Inetd
  602. In general, the rule for inetd configuration is to disable everything that you 
  603. do not explicitly plan to use. For a workstation, it is usually good to disable 
  604. everything except telnet and ftp. The format of the inet.conf file is pretty 
  605. straightforward and is documented in the file itself:
  606. # <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
  607. ...where the # will disable the line. Note that most modern linux distributions 
  608. will come with TCP wrappers installed for extra security, so that instead of 
  609. seeing
  610.   ftp     stream  tcp     nowait  root    /usr/sbin/wu.ftpd -l -i -a
  611. for the ftp daemon, one would see
  612.   ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  wu.ftpd -l -i -a
  613. The TCP wrappers allow use of the hosts.allow and hosts.deny restriction files. 
  614. A default security model would automatically deny access to any daemon for all 
  615. connections, or for all connections whose IP addresses do not respond to IDENT 
  616. requests [i.e. spoofed IP addresses]:
  617.  root@local>vi /etc/hosts.deny
  618. ALL:ALL
  619. ALL:PARANOID
  620.  
  621. Connections from the local network can then be allowed for specific daemons:
  622.  root@local>vi /etc/hosts.allow
  623. wu.ftpd: LOCAL
  624. in.telnet.d: LOCAL
  625.  
  626. A configuration such as this allows local network access only to FTP and telnet 
  627. services; access can be granted to specific non-local addresses in order to 
  628. retain tight security. Note that separate network daemons can be executed 
  629. depending on whether the connection is local or non-local, so that local users 
  630. could access finger while remote users would receive a less functional 'safe 
  631. finger' program -- see the host_access man page [host_access(5)] for details.
  632.  
  633.  
  634. Logins
  635. Login perferences such as delay after bad login, checking of mail on login, 
  636. default PATH, etc are stored in /etc/login.defs; usually this file is set up 
  637. correctly by default. By default, the /etc/issue file displays before the login 
  638. prompt, and the MOTD file displays afterwards. The /etc/environment file contains 
  639. the default starting environment [variables such as PATH, MANDIR, etc] for 
  640. logins. On a typical linux workstation, the /etc/securetty contains the only 
  641. terminals on which root can log in -- by default this is set to only the virtual 
  642. terminals. Combining this with an /etc/nologin file [which prevents non-root 
  643. logins] will create a machine which can only be logged in to via root access to 
  644. the local virtual terminals.
  645.  
  646.  
  647. Kernel Devices
  648. A number of kernel network monitoring devices must be configured before they 
  649. can be used. 
  650. Routing messages:
  651.  root@local>mknod /dev/route c 36 0
  652. IP Forwarding:
  653.  root@local>vi ~/.bashrc
  654.   echo 1 > /proc/sys/net/ipv4/ip_forward
  655. Firewall Netlink:
  656.  root@local>mknod /dev/netlink c 36 3
  657. Syn Cookies:
  658.  root@local>vi ~/.bashrc
  659.   echo 1 > /proc/sys/net/ipv4/tcp_syncookies
  660. Ethertap:
  661.  root@local>mknod /dev/tap0 c 36 16
  662. Nvram:
  663.  root@local>mknod /dev/nvram c 10 144
  664.  
  665.  
  666. IPChains
  667. Firewalling: this is why one switches to linux. When IPChains are configured in 
  668. the kernel and the latest ipchains package is compiled, some serious network 
  669. protection is available for the linux box. IPChains consists of 'chains' of 
  670. rules that are used to filter packets passing through the machine; the most 
  671. useful chain for workstation firewalling is "input", though there are "output" 
  672. and "forward" chains as well. The main concept behind IPChains is that rules 
  673. are applied to packets when the packets reach any of these chains; if the packet 
  674. matches the rules, then the action specified in the rule is taken. For example, 
  675. if the first rule in the input chain specifies that ICMP packets from 
  676. 100.100.100.0 will be dropped, then a ping from 100.100.100.15 would fail, while 
  677. a ping from 101.101.101.0 would succeed. The focus for this text is on work-
  678. station, not server, implementations of linux; therefore only the input chain 
  679. will be discussed. Further information can be found in the IPChains How-To.
  680.  
  681. Rules are added to a chain by invoking the 'ipchains' utility. The typical 
  682. symtax is
  683.    ipchains -[AD] chain rule action
  684. where A is 'add rule', D is 'delete rule', chain refers to the chain of rules 
  685. being modified [e.g. 'input'], rule is the criteria which the packet must match, 
  686. and action is the what happens to the packet [ACCEPT, DENY, REJECT, RETURN, 
  687. REDIRECT]. Of these options, the 'rule' option is naturally the most important.
  688.  
  689. Chain rules can consist of a number of further switches:
  690.    -p protocol [can be a #, or 'TCP','UDP', 'ICMP'; '!' OK]
  691.    -s source address/host [IP or hostname '!' OK]
  692.    -d destination address/host [IP/hostname; '!' OK]
  693.    -i interface [ '!' OK]
  694.    -l [log packet if matched]
  695. Note that when sppecifying an address, '0/0' will match any IP address, and a 
  696. group of IP addresses can be specified with the format 'IPaddr/netmask' -- such 
  697. that '201.201.201.0/255.255.255.0' would match addresses 201.201.201.0 to 
  698. 201.201.201.255. Addresses can be matched in a "NOT EQUAL" manner by inserting 
  699. a "!" before the address; thus, the rule '-s ! 201.201.201.0/255.255.255.0" 
  700. would match any address except the ones between 201.201.201.0 and 
  701. 201.201.201.255.
  702.  
  703. When the TCP or UDP protocol is selected, the source and destination addresses 
  704. can contain port numbers in order to allow or deny access to a specific port or 
  705. a range of ports. Ports may be specified by name or by number; a range or ports 
  706. consists of a lower and upper number joined by a colon [e.g. 80:8000], where a 
  707. blank lower number [e.g. :8000] implies '0' as the lower and a blank upper 
  708. number [e.g. 80:] implies 65535 as the upper. As an example, to drop all packets 
  709. except http requests from non-local addresses:
  710.  root@local>ipchains -A input -p TCP -s ! localhost -d 0/0 ! 80 -j DENY 
  711. Note that ICMP rules allow ICMP code to be specified in place of port number.
  712.  
  713. Chain actions are specified with the -j switch. The j switch is considered a 
  714. "jump", and the default actions [DENY, ACCEPT, REJECT, MASQ, REDIRECT, RETURN] 
  715. are aliases. The default actions can be replaced with the name of a new chain 
  716. [the chains can be added by usinf the -N flag followed by the new chain name, 
  717. e.f. 'ipchains -N mychain'] that the packet will be sent to if it matches the 
  718. current rule. 
  719.  
  720. The author of the IPChains How-To provides some interesting chains using IP 
  721. header values to prioritize different types of network traffic. The value in 
  722. question is the Type-Of-Service bit, which can be set to Minimum Delay, Maximum 
  723. Throughput, Maximum Reliability, or Minimum Cost [numeric values are 0x01 0x10, 
  724. 0x01 0x08, 0x01 0x04, and 0x01 0x02 respectively]. The chains in question look 
  725. as follows:
  726.        ipchains -A output -p tcp -d 0.0.0.0/0 telnet -t 0x01 0x10
  727.        ipchains -A output -p tcp -d 0.0.0.0/0 ftp -t 0x01 0x10
  728.        ipchains -A output -p tcp -s 0.0.0.0/0 ftp-data -t 0x01 0x08
  729. It should be noted that this is intended for a router configuration in order to 
  730. maximize the network traffic efficiency for the connected workstations.
  731.  
  732. At this point it is perhaps best to include the examples from the how-to, which 
  733. demonstrate the author's setup on his PPP-dialup workstation:
  734. #!/bin/sh
  735.         ipchains -P input DENY                                     #---------1
  736.         ipchains -A input -i lo -j ACCEPT                          #---------2
  737.          ipchains -N ppp-in                                         #---------4
  738.         ipchains -A input -i ppp0 -j ppp-in                        #---------2 
  739.         ipchains -A ppp-in -s 192.168.1.0/24 -l -j DENY            #---------3
  740.          ipchains -N ppp-out                                        #---------4
  741.         ipchains -A output -i ppp0 -j ppp-out                      
  742.         #-------------------------------------------------------optimize traffic
  743.          ipchains -A ppp-out -p TCP -d proxy.server 8080 -t 0x01 0x10
  744.         ipchains -A ppp-out -p TCP -d 0.0.0.0 telnet -t 0x01 0x10
  745.          ipchains -A ppp-out -p TCP -d 0.0.0.0/0 ftp-data -t 0x01 0x02
  746.         ipchains -A ppp-out -p TCP -d 0.0.0.0/0 nntp -t 0x01 0x02
  747.         ipchains -A ppp-out -p TCP -d 0.0.0.0/0 pop-3 -t 0x01 0x02
  748.         #-------------------------------------------------allow ftp cpnnections
  749.          ipchains -A ppp-in -p TCP -s 0.0.0.0/0 ftp-data -d $LOCALIP 1024:5999 -j ACCEPT
  750.         ipchains -A ppp-in -p TCP -s 0.0.0.0/0 ftp-data -d $LOCALIP 6010: -j ACCEPT
  751.         ipchains -A ppp-in -p TCP -d $LOCALIP ftp -j ACCEPT
  752. #---------------------------------------------------------------------------EOF
  753. Note how these chains provide the following:
  754. *Deny all input requests by default [1]
  755. *Allow input from ppp0 and local network connections [2]
  756. *Prevent IP address spoofing from ppp0 [3]
  757. *Create ppp-in and ppp-out chains [4]
  758. These chains can be modified to suit the local machine [e.g. by adding a few ICMP 
  759. rules] and placed in a shell script in the rc.d directories.
  760.  
  761.  
  762. Apache
  763. The Apache webserver installs by default in most linux installations; its 
  764. configuration file is either /etc/httpd.conf or, in later incarnations, 
  765. /usr/local/apache/conf/httpd.conf or /var/lib/apache/conf/httpd.conf . Running 
  766. 'lynx 127.0.0.1' will quickly determine whether or not Apache is set up 
  767. correctly.
  768.  
  769. The Apache server comes optimized for a midsize server setup and thus has 
  770. settings that are inappropriate, if not wasteful, for a workstation. Part of 
  771. this has to do with resource allocation and the anticipated number of web client 
  772. connections; in addition, many superfluous options which do not impact system 
  773. performance [such as virtual hosting] can be removed from the configuration.
  774.  
  775. A basic Apache setup for a linux workstation might look as follows:
  776.   #httpd.conf
  777.   #_______Basic Server Configuration______
  778.   ServerType standalone        #use inetd if you want wrappers
  779.   ServerRoot "/var/lib/apache" #do not change from preconfigured value!
  780.   PidFile /var/run/httpd.pid
  781.   ScoreBoardFile /var/run/httpd.scoreboard
  782.   Timeout 90
  783.   KeepAlive On
  784.   MaxKeepAliveRequests 20
  785.   KeepAliveTimeout 15
  786.   MinSpareServers 2            #each spare server consumes CPU resources
  787.   MaxSpareServers 10
  788.   StartServers 1
  789.   MaxClients 20
  790.   MaxRequestsPerChild 30
  791.  
  792.   #_______Apache_Loadable_Modules__________
  793.   #[...this can be left as pre-configured...]
  794.  
  795.   #________Server_Setup____________________
  796.   ExtendedStatus On            #Give detailed infor in status page
  797.   Port 80                      #Listen on port 80
  798.   User nobody                  #Run as user nobody
  799.   Group nogroup
  800.   ServerAdmin root@gaap.pandemonium.com
  801.   #__HTML_Pages_Setup__
  802.   DocumentRoot "/home/www/pages"       #Dir where web pages are stored
  803.   <Directory />                        #Default directory settings
  804.     Options FollowSymLinks
  805.     AllowOverride None
  806.   </Directory>
  807.   <Directory "/home/www/pages">        #DocumentRoot options
  808.     Options Indexes FollowSymLinks
  809.     AllowOverride None
  810.     Order allow,deny
  811.     Allow from all
  812.   </Directory>
  813.   DirectoryIndex index.html            #Default page to load
  814.   AccessFileName .htaccess             #Directory access restriction file
  815.   <Files .htaccess>
  816.     Order allow,deny
  817.     Deny from all
  818.   </Files>
  819.   UseCanonicalName On
  820.   #__MIME_Junk__
  821.   TypesConfig /var/lib/apache/conf/mime.types
  822.   DefaultType text/plain
  823.   <IfModule mod_mime_magic.c>
  824.     MIMEMagicFile /var/lib/apache/conf/magic
  825.   </IfModule>
  826.  
  827.   #__CGI_Script_Setup__
  828.   ScriptAlias /cgi-bin/ "/home/www/cgi-bin/"
  829.   <Directory "/home/www/cgi-bin">      #Directory where CGI scripts are stored
  830.     AllowOverride None               #ScriptAlias means "execute docs in here"
  831.     Options None                     #Be sure to 'chmod 711' it!
  832.     Order allow,deny
  833.     Allow from all
  834.   </Directory>
  835.  
  836.   #__Online_Status_and_Config_Pages__
  837.   <Location /server-status>    #http://127.0.0.1/server-status
  838.     SetHandler server-status
  839.     Order deny,allow
  840.     Deny from all
  841.     Allow from .pandemonium.com
  842.   </Location>
  843.   <Location /server-info>
  844.     SetHandler server-info   #http://127.0.0.1/server-info
  845.     Order deny,allow
  846.     Deny from all
  847.     Allow from .pandemonium.com
  848.   </Location>
  849.  
  850.   #_______Log_File_Setup___________________
  851.   HostnameLookups Off          #Don't waste time getting hostnames
  852.   ErrorLog /var/log/httpd-error.log
  853.   LogLevel warn            #debug, info, notice, warn, error, crit, alert, emerg
  854.   Format "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  855.   CustomLog /var/log/httpd-access.log combined
  856.  
  857.   #_______Final_Options____________________
  858.   ServerSignature Off
  859.   ReadmeName README
  860.   HeaderName HEADER
  861.   IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
  862.   AddEncoding x-compress Z
  863.   AddEncoding x-gzip gz
  864.   AddType text/html .shtml
  865.   AddHandler server-parsed .shtml
  866.   AddHandler imap-file map
  867.  
  868.  
  869. FTP
  870. In addition to the security offered by tcp wrappers and the firewall, the ftp 
  871. daemon contains it own authentication process. When a user logs into the ftp port,
  872. the ftp daemon checks the /etc/passwd file to validate the user login; if the user 
  873. 'ftp' is present in the passwd file, users may log in with the name 'ftp' or 'anonymous' 
  874. and any password. The /etc/ftpusers file is used to deny specific users [usually 
  875. root] ftp access; any username appearing in this file is automatically denied ftp 
  876. access.
  877.  
  878. Anonymous ftp logins are restricted to the home directory of the ftp user [usually 
  879. /home/ftp]; in order to minimize the access granted an anonymous login, the 
  880. following file permissions should be set for the ftp home directory:
  881.  root@local> chown root ~ftp; chmod 555 ~ftp
  882.  root@local> chown root ~ftp/bin; chmod 111 ~ftp/bin
  883.  root@local> cp /bin/ls ~/ftp/bin; chmod 111 ~/ftp/bin/ls
  884.  root@local> chown root ~ftp/etc; chmod 111 ~ftp/etc
  885.  root@local> cp /etc/passwd /etc/group ~ftp/etc; chmod 444 ~/ftp/etc/*
  886.  
  887. The ftp daemon can be further configured via the /etc/ftpaccess file. The 'class' 
  888. keyword is used to define access types; it has the following syntax:
  889.   class [classname] [user types] [address]
  890. where 'classname' is an arbitrary name for the class, 'user types' is any combination 
  891. of the keywords 'anonymous', 'guest', and 'real', and where 'address' is a hostname 
  892. or IP address [wildcards allowed] from which the login is taking place. Note that 
  893. use of the 'real' keyword allows users in /etc/passwd to log in using their 
  894. standard username and password.  
  895.  
  896. Classes are used to provide types for other keywords. The 'limit' keyword determines
  897. how many user from a specific class are allowed to log in at any one time:
  898.   class localusers     guest                    101.100.0.0
  899.   class remoteusers    guest, anonymous  *
  900.   class admins            real                     101.100.101.0    
  901.   limit localusers   100     MoTuWeThFr0700-1900   /etc/ftpmsg.local
  902.   limit remoteusers    25     Any            /etc/ftpmsg.remote
  903.   limit admins       -1     Any        
  904. In this example, logins from the local domain [101.100.0.0] are allowed 100 at a
  905. time, and are only allowed guest access -- these are assumed to be on-site workers. 
  906. These on-site logins are allowed only during working hours [Monday-Friday, 7am to 
  907. 7pm; the file /etc/ftpmsg.local is displayed when time or #users prevents access.
  908. Logins from any address [*] are assumed to be remote workers or anonymous FTP logins;
  909. they are limited to 25 at a time, at any time of day. Logins from the subnet where 
  910. the admins are located [101.100.101.0] are allowed 'real' access, at any time of day 
  911. and of unlimited numbers [-1]. In addition to the 'limit' keyword, further controls 
  912. exist that allow the number of files downloaded, number of bytes downloaded, maximum 
  913. time permitted for a connection, nice value of the process, and tcp window size to 
  914. be configure for each class of user.
  915.  
  916. FTP users can further be typed into 'guest' users and 'real' users. Any user names 
  917. [wildcards accepted] defined as 'guestuser' will be logged in as if they were the 
  918. user 'guest' [this must be set up in /etc/passwd]; 'real' users are defined in order 
  919. to provide exceptions to the guest rule. For example, the lines
  920.   guestuser *
  921.   realuser mammon
  922. would cause all ftp access to be treated as a guest account, except for the user
  923. 'mammon'.
  924.  
  925. Addresses can be denied ftp access outright using the 'deny' keyword. The following 
  926. line will deny access to addresses from the domain 205.200.0.0 and will display the 
  927. 'abuse' message :
  928.   deny    205.200.0.0        /etc/ftpmsg.abuse
  929.  
  930. Ftp permissions are set by permission type; the keywords 'chmod', 'delete', 'over-
  931. write', 'rename', and 'umask' are allowed or disallowed using the 'yes' or 'no' 
  932. keywords, followed by the user types which are to be effected:
  933.   chmod        no anonymous, guest
  934.   delete        no anonymous
  935.   overwrite    no    anonymous
  936.   rename        no    anonymous
  937. Note that 'yes' is assumed for all login types by default; thus the 'real' group 
  938. in the above setup would have access to all ftp commands.
  939.  
  940. Upload permissions can be configured using the 'upload' keyword, which has the 
  941. following syntax:
  942.   upload  [root] [directory] [yes/no] [dirs/nodirs]
  943. where 'root' is the root directory [usually /home/ftp], 'directory' is the name 
  944. of the directory being configured [wildcards allowed], 'yes' and 'no' allow and deny 
  945. upload access,  and 'dirs' will allow subdirectories to be created. A typical 
  946. setup might look as follows:
  947.   upload /home/ftp *                            no
  948.   upload /home/ftp/incoming                yes    nodirs
  949.   upload /home/ftp/pub                        yes    dirs
  950.   upload class=admin /home/ftp/admin     yes    dirs
  951. Note that class restrictions can be applied to the upload specifications.
  952.  
  953. The ftp daemon also contains a log command which allows file transfers, attempts 
  954. to violate security rules [e.g. attempting a retrieval when permissions forbid it], 
  955. and individual ftp commands to be logged. The syntax for these three logging 
  956. options are
  957.           log transfers [anonymous/guest/real] [inbound/outbound]
  958.           log security [anonymous/guest/real]
  959.           log command [anonymous/guest/real] 
  960. Note that there is no control over specific files or commands, which can cause the 
  961. log file to get somewhat lengthy on a high-traffic server.
  962.  
  963. Various other options exist, including the displaying of banners, readme files, and 
  964. displaying the hostname and email address of the admin; see the ftpaccess man page 
  965. for more details.
  966.  
  967.  
  968. EMail
  969. All linux distributions install Sendmail by default, along with several other 
  970. email processing utilities. Sendmail is a Mail Transfer Agent, or MTA; it handles 
  971. routing of internal and outgoing mail. When teamed up with a delivery agent such 
  972. as Fetchmail, it makes for a powerful POP3/SMTP package.
  973.  
  974. To begin with, Fetchmail must be configured to pull email from a POP server and 
  975. route it to Sendmail. Fetchmail uses the file ~/.fetchmailrc to determine its 
  976. behavior; this file has the following format:
  977.   poll [mailserver] protocol POP3 username [user] password [pwd] mda [program]
  978. An example configuration for retrieving mail from the server popd.server.com for 
  979. the user "mammon" with password "YeahRight", and routing the mail to sendmail, 
  980. would look as follows:
  981.  
  982.   poll popd.server.com protocol pop3 username "mammon" password "YeahRight" 
  983.   mda "/usr/sbin/sendmail"
  984.  
  985. Mail can now be retrieved from the server by typing 'fetchmail' at the command 
  986. prompt. Note that all 'test' attempts should use 'fetchmail -k' to avoid 
  987. deleting mail from the server.
  988.  
  989. At this point Sendmail must be configured, and the eventful tour of the 
  990. /etc/sendmail.cf file can begin. The .cf file contains four main sections:
  991.    1. Local Definitions -- definitions & parameters for the local machine
  992.    2. Foreign Systems -- servers with which sendmail will communicate
  993.    3. Delivery Agents -- additional mail transport programs
  994.    4. Mail Headers --format of email headers generated by sendmail
  995.  
  996. The Local Definitions are a series of cryptic abbreviations, usually preceded 
  997. by a D [sendmail macro/variable, like #define], C [sendmail Class, a list of 1+ 
  998. values], O [sendmail Options], or F [a class definition specified in a file]. 
  999. The usual defintions in this section are as follows:
  1000.     Dw -- define local hostname
  1001.     DD -- define local domain
  1002.     Cw -- other names/aliases for the local host
  1003.     Cd -- other names/aliases for the local domain
  1004.     CS -- list of remote servers to exchange mail with
  1005.     DF -- name of forwarder [email unhandled locally] server
  1006.     CF -- other names/aliases for forwarder
  1007.     DR -- name of relay [email destined beyond local host] server
  1008.     CV -- name of external forwarding server [defined on forwarder server]
  1009.     DW -- uucp name of local host
  1010.     DM -- method of sending email out of local domain
  1011.     OA -- location of aliases file
  1012.     OQ -- location of mail spool
  1013. The pattern behind these definitions is this: the first letter is the type of 
  1014. definition [define, class, option, or file] and the second letter is the actual 
  1015. macro name. Thus, one will commonly see the following macros in sendmail.cf 
  1016. files:
  1017.   $f sender's email address
  1018.   $g sender's return address
  1019.   $j official hostname [usually $w.$m]
  1020.   $m official domain name
  1021.   $n name for error-messages
  1022.   $p sendmail PID
  1023.   $r protocol used
  1024.   $s sender's hostname
  1025.   $u recipient's username
  1026.   $w machine name of host
  1027.   $z recipient's home directory [if local]
  1028.   $E names to be exposed as from this host
  1029.   $L names to always deliver as local
  1030.   $M hosts to masquerade as
  1031.   $S 'Smart relay' host
  1032.  
  1033. For the most part, sendmail will work as installed -- usually using procmail to 
  1034. handle placing local mail in the correct queues. For workstations connecting to 
  1035. an ISP, however, the following macros will have to be modified:
  1036.   Cwlocalhost,gaap
  1037.   Dmpandemonium.com
  1038.   Djsmtp.isp.com
  1039.   DR
  1040.   CL root,mammon
  1041.   #CE root
  1042.   DMsmtp.isp.com
  1043. These settings will cause the following: set local hostname, set local domain, 
  1044. 'from' machine name, handle unqualified names locally [DR -- make sure it is 
  1045. blank], deliver all email to addresses 'root' and 'mammon' locally, do not 
  1046. expose root's username on send, and masquerade as smtp.isp.com. Combined with 
  1047. fetchmail and procmail's local mailbox routing, this shoudl serve as a basic 
  1048. email platform.
  1049.  
  1050.  
  1051. PPP
  1052. One of the greatest sources of trouble for linux initiates is the setup of a 
  1053. PPP connection to an ISP. The available tutorials and how-to's provide laborious 
  1054. instructions detailing arcane setup options, while most distributions ship with 
  1055. an /etc/ppp directory loaded with convoluted connection scripts. In reality, PPP 
  1056. is not all that difficult.
  1057.  
  1058. The linux PPP package consists of the pppd daemon and a few scripts in the 
  1059. /etc/ppp directory; for the purpose of this example it is best to save off the 
  1060. /etc/ppp tree as /etc/ppp.factory and start with an empty directory.
  1061.  
  1062. The basic setup is to have an options file in /etc/ppp/peers for each ISP; the 
  1063. options file contains basic connection information and refers to a 'chat script' 
  1064. which is responsible for the login process.
  1065.  
  1066. A typical options file would look as follows:
  1067.   #/etc/ppp/peers/MajorISP
  1068.   lock
  1069.   defaultroute
  1070.   noipdefault
  1071.   modem
  1072.   ttyS1 
  1073.   57600
  1074.   crtscts
  1075.   connect '/usr/sbin/chat -v -f /etc/ppp/ISP.chat'
  1076.   #--------------------------------------------EOF
  1077. Note the PPPD options [lock, defaultroute, noipdefault, modem] which are 
  1078. detailed in the pppd man page, and the connection options [ttyS1 for the device 
  1079. and 57600 for the line speed] which are provided. The last line in the script is 
  1080. simply a command to execute on connection.
  1081.  
  1082. The referenced chat script would contain the local half of the dialog that is to 
  1083. take place during login:
  1084.   #/etc/ppp/ISP.chat
  1085.   TIMEOUT 60
  1086.   ABORT ERROR
  1087.   ABORT BUSY
  1088.   ABORT "NO CARRIER"
  1089.   ABORT "NO DIALTONE"
  1090.   "" "AT&FH0"
  1091.   OK "atdt5551212"
  1092.   CONNECT ""
  1093.   ogin: mammon
  1094.   assword: yeahright
  1095.   #--------------------EOF
  1096. Here can be seen the modem control codes, the ABORT error messages to be sent to 
  1097. the console in case of error, and the login name and password. Note that the 
  1098. last two lines represent an EXPECT/SEND script; the chat program waits until the 
  1099. characters "ogin:" are recieved [a Login: or login: prompt] and sends the 
  1100. username "mammon", then waits until the characters "assword:" are received and 
  1101. sends the unencrypted password "yeahright".
  1102.  
  1103. Once this is set up, the ISP can be connected to with the command
  1104.  root@local>pppd call MajorISP
  1105. The connection is terminated by the command
  1106.  root@local>pppd-off
  1107.  
  1108. This should handle general ISP connections. Further options exist, such as 
  1109. specifying "nodetach" to keep pppd occupying the console/xterm instead of 
  1110. becoming a background process, as well as specifying PAP/CHAP options, scripts 
  1111. to run on connect/disconnect, etc.
  1112.  
  1113. One final topic that should be addressed is name servers. On some ISPs the DNS 
  1114. server information cannot be retrieved from the ISP on connect; for these the 
  1115. servers must be added to resolv.conf on connect. The pppd program automatically 
  1116. runs /etc/ppp/ip-up and /etc/ppp/ip-down on connection and disconnection; it is 
  1117. a simple matter to create these scripts to add and remove name servers from the 
  1118. /etc/resolv.conf file:
  1119.   #/etc/ppp/ip-up
  1120.   #!/bin/sh
  1121.   echo "nameserver 127.0.0.1 #Temporary PPP --primary DNS" >> /etc/resolv.conf
  1122.   echo "nameserver 127.0.0.0 #Temporary PPP --secondary DNS" >> /etc/resolv.conf
  1123.   #---------------------------------------------------------------EOF
  1124.  
  1125.   #/etc/ppp/ip-down
  1126.   #!/bin/sh
  1127.   sed -e '/Temporary PPP/d' /etc/resolv.conf > /etc/resolv.new
  1128.   mv /etc/resolv.new /etc/resolv.conf
  1129.   #---------------------------------------------------------------EOF
  1130.  
  1131. These scripts will add the name servers 127.0.0.1 and 127.0.0.0 to the 
  1132. resolv.conf file on connection, and remove them on disconnect.
  1133.  
  1134. This should provide a basic PPP up-and-running guide for those having trouble. 
  1135. The scripts and commands mentioned here can be front-ended with a Tk script, or 
  1136. can be replaced with a more complete package such as XISP, EZ-PPP, and the like.
  1137.  
  1138.  
  1139.  
  1140. X-Windows
  1141. ---------
  1142. X Windows is another area of linux in which the beginner gets frustrated and 
  1143. feels abandoned -- often needlessly. The configuration for X Windows is very 
  1144. straightforward and does not require any particular information about the system 
  1145. aside from the model or chipset of the video card and the size of the monitor -- 
  1146. although the setup utilities and most documentation may claim otherwise.
  1147.  
  1148. There are many X setup tools, often tailored to the distribution or developed as 
  1149. freeware utilities; the most reliable and the one with the least chance for 
  1150. error is XF86Config, a console-mode utility. To run it, us the following command:
  1151.  root@local>xf86config
  1152. A basic disclaimer screen will come up, after which there will be quite a few 
  1153. prompts which, when answered, will create an XF86Config file [the file which the 
  1154. xserver reads to determine how to interact with the video hardware]. The setup 
  1155. process in XF86Config will proceed in the following order:
  1156.   1. Specify a mouse type -- usually #1 or #4. Emulate 3 buttons if you only have 
  1157.     2, and enable ChordMiddle if you have 3 buttons. Just press ENTER for the 
  1158.      mouse device name to take the default.
  1159.   2. Use XKB, use type #1 for a 101-key keyboard and type #2 for a 104-key.
  1160.   3. Monitor configuration: The first screen will prompt for the horizontal sync 
  1161.     range, the second for the vertical. All of the old urban legends of X 
  1162.      setting monitors on fire refer to this part of the install, but do not 
  1163.      worry -- all modern monitors can handle a horizontal sync of 35 and a 
  1164.      vertical of 90. For the horizontal, choose #4 for older monitors, #5 for 
  1165.      smaller [14"] monitors, and #6 or #7 for larger monitors. For vertical 
  1166.      range, choose #2 for smaller screens and #3 for larger ones. Press ENTER 
  1167.      for the monitor names.
  1168.   4. Card Selection: Page through the list looking for the correct video card, 
  1169.     or at least a video card with the same chipset [video controller chip can be 
  1170.     identified by looking at the card itself, it's the big black CPU-looking one]. 
  1171.      Choose the correct card and for the X server select #5 to use the one from the 
  1172.      card definition. Say 'y' to the symbolic link questions and then enter the 
  1173.      correct amount of video ram. Finally, press ENTER for the video card name 
  1174.      questions.
  1175.   5. Clockchip setting: Usually just press ENTER.
  1176.   6. Mode Selection: For each color depth, X will try the modes in the order 
  1177.     listed until it finds a working mode. For this reason, the modes all need to 
  1178.      be changed so that the highest resolution is *first* instead of *last*; 
  1179.      otherwise all video modes will default to the VGA-style 640x480 resolution. 
  1180.      An example for changing the 8-bit modes: Select 1, then type in '432' and 
  1181.      press ENTER. Say 'n' for virtual desktop [most window managers provide their 
  1182.      own].
  1183.   7. Writing the config file: say 'n' to the /etc/XF86Config question, and 'y' 
  1184.     to the default location.
  1185.  
  1186. X is now configured; it can be started with "startx" for the default color 
  1187. depth, or 'startx -- -bpp#' where # is the desired color depth [e.g. 'startx -- 
  1188. -bpp 24' or 'startx -- -bpp 16']. The default color depth can be changed by 
  1189. adding the line "DefaultColorDepth #' to the XF86Config file "Screen" section:
  1190.  root@local>vi /usr/X11R6/lib/X11/XF86Config
  1191. Section "Screen"
  1192.     Driver      "svga"
  1193.     Device      "NeoMagic (laptop/notebook)"
  1194.     Monitor     "My Monitor"
  1195.     DefaultColorDepth 24
  1196.     Subsection "Display"
  1197. ...
  1198.  
  1199. Additional XF86Config options can be determined by reading the XF86Config man 
  1200. page.
  1201.  
  1202.  
  1203.  
  1204. Printing
  1205. --------
  1206. Unlike standard desktop operating systems such as Windows and MacOS, Linux has
  1207. no inherent printing support. Rather, a number of utilities interact to provide
  1208. basic printing services. Foremost among these utilities is lpd, the line printer
  1209. daemon; lpd will manage queues for a number of printers via the lpr et. al. 
  1210. commands.
  1211.  
  1212. Lpd will not format output; rather, it sends output to the printer with no 
  1213. modification and no formatting. For this reason, it is desireable --if not 
  1214. necessary-- to provide a filter which lpd will apply to the output in order 
  1215. to format it for printer output. The filter can be a shell script, a perl
  1216. script, or any executable file; the program 'apsfilter' is perhaps the most 
  1217. versatile filter available. Its setup package is pretty straightforward, and 
  1218. will go so far as to define further filters and /etc/printcap entries for 
  1219. you.
  1220.  
  1221. Apsfilter relies mainly on two additional filters -- a2ps [ASCII to Postscript] 
  1222. and ghostscript [for converting Postscript to printer commands]. Once setup, 
  1223. the apsfilter package manages printing as follows:
  1224.        sourcefile -> aps -> ghostview -> lpd
  1225. The source file is cat'ed to a filter [or a sequence of filters] in order to 
  1226. convert it to Postscript; the output is then passed through Ghostscript to 
  1227. create a copy suitable for printing [Ghostscript is actually a program that 
  1228. converts PS files/data into a bytestream configured for display on a specific 
  1229. device; that device can be a graphics card, a printer, or a graphics file 
  1230. format], and the final data is piped straight to the printer device. This 
  1231. causes a bit of overhead for printing and you can expect a 20-50% decrease in 
  1232. printing speed; to bypass this apsfilter offers additional printer modes such 
  1233. as raw ascii.
  1234.  
  1235. Setting up a linux box for printing is as simple as obtaining the latest 
  1236. versions of Ghostview, apsfilter, and a2ps; for the support of newer printers, 
  1237. it may be necessary to compile the source for Ghostview directly [be sure to 
  1238. kill -HUP lpd after compiling ghostview or setting up apsfilter] -- the 
  1239. changes required are minimal [the only lines in ./makefile to be changed are 
  1240. the FEATURES= and DEVICES= lines], and are well-documented in make.txt.  
  1241.  
  1242.  
  1243.  
  1244. Documentation
  1245. -------------
  1246. The fact that linux tends to come with no printed manuals and a limited [in the 
  1247. case of GUI-based distributions] or even missing GUI-based online help system
  1248. gives the appearance that the OS ships with no documentation. This can be 
  1249. frustrating and even intimidating for the novice, and all for no reason -- 
  1250. linux in fact comes with more documentation than just about every other operating 
  1251. system. The documentation ranges from technical 'man pages' to newbie 'FAQs' and 
  1252. includes a number of tutorial or 'How-To' files to cover a variety of obscure or 
  1253. complex tasks; accessing this documentation, however, does require some measure of 
  1254. initiation into the linux documentation structure, such as it is.
  1255.  
  1256. Man Pages
  1257. The 'man' command allows access to formatted manuals ['man pages'] for the 
  1258. software, daemons, configuration files, and programming libraries shipped with 
  1259. the OS. Software installed subsequently may or may not come with its own man 
  1260. pages; however, it is possible to translate a README or DOCUMENTATION file into 
  1261. a man page an place it in the appropriate directory.
  1262.  
  1263. The man command uses the variable MANPATH to determine which directories contain 
  1264. man pages; this is set in the file /etc/man.conf and usually includes /usr/man, 
  1265. /usr/local/man, and /usr/X11R6/man. 
  1266.  
  1267. Each man directory contains numbered subdirectories which contain specific types 
  1268. of manuals; even though commands or programs may have the same name [e.g. the 'chmod'
  1269. utility and the 'chmod' system call], the correct one can be accessed by specifying 
  1270. which section of the man pages to look in. The 'sections' are similar to the sections 
  1271. in a printed reference manual; they group the material by type and give the impression
  1272. of a rough table of contents:
  1273.           1. User/unpriveleged commands & programs
  1274.           2. System calls [provided by kernel]
  1275.           3. Library functions [provided by C libs, etc]
  1276.           4. Special files [character and block devices]
  1277.           5. File formats, data structures
  1278.           6. Games, frivolous accessories
  1279.           7. Misc [header files, macros, OS guidelines]
  1280.           8. Administration/privileged commands & programs
  1281.           n. Tcl/Tk-related commands
  1282. An overview to each section can be viewed with the command 'man # intro', where 
  1283. '#' is the number of the section to view. The command 'man -a' will display the 
  1284. results for all sections; thus typing
  1285.  root@local>man -a intro
  1286. will display the introductory pages for each section [note that the commands used 
  1287. in  the man viewer are similar to vi or more commands; thus ':n' or ':q' will 
  1288. switch to the next man page]. 
  1289.  
  1290. The main page for a specific section can be viewed by prefixing the search term 
  1291. with the section number, e.g.
  1292.  root@local>man 1 chmod
  1293. will present the man page for the chmod utility, while
  1294.  root@local>man 2 chmod
  1295. will present the man page for the chmod system call. The sections or pages which 
  1296. apply to a specific command can be viewed with the 'whatis' utility; thus 
  1297.  root@local>whatis chmod
  1298. will list the User Command and System Call man pages for chmod.
  1299.  
  1300. Man pages can be searched for strings in case the specific command is not known; 
  1301. the apropos utility [also the command 'man -k'] will search the whatis database 
  1302. for the provided string; 'man -K' will search all extant man pages for the supplied 
  1303. string [very slow!]. To see the difference, try the following commands:
  1304.  root@local>apropos editor
  1305.  root@local>man -K editor
  1306. The first will give a list of all editors installed on the system [and having 
  1307. man pages], the second will present a prompt each time it finds a man page with 
  1308. the word 'editor' in it, verifying with the user whether or not to display that 
  1309. page.  Note that using the 'man -K', one can limit a search to a specific section 
  1310. by specifying the section number before the search term, e.g.
  1311.  root@local>man -K n canvas
  1312. will search the Tcl commands for the term 'canvas', while
  1313.  root@local>man -K 3 canvas
  1314. will search the Library functions for the term 'canvas'.
  1315.  
  1316. The order in which the sections are searched by the man utility is determined by 
  1317. the MANSECT variable, which is set in /etc/man.conf as follows:
  1318.   MANSECT     1:8:2:3:4:5:6:7:9:tcl:n:l:p:o
  1319. The PAGER variable is defined in the same file:
  1320.   PAGER    /usr/bin/less -is
  1321. ...this determine what viewer is used to display the man pages. For more 
  1322. information on the keystrokes used to work the man pager, do a 'man less'.
  1323.  
  1324. Info
  1325. The GNU project has moved most of their documentation from the searchable man 
  1326. pages to the browsable [and, of course, searchable] 'info' system. Info is a 
  1327. console-mode hypertext documentation system; it is invoked by typing 'info' or 
  1328. 'info [menuitem]'.
  1329.  
  1330. When info is run with no parameters, a menu will be displayed containing such 
  1331. topics as 'Developing in C/C++', 'Libraries and functions', and 'Programming 
  1332. Tools.' At this point, PageUp and PageDown will scroll through the menu, and '?'
  1333. will display a list of commands for navigating Info. The salient commands are
  1334. as follows:
  1335.           q Quit Info
  1336.           n Next node
  1337.           p Previous node
  1338.           u Up one node level
  1339.           m Select a menu item
  1340.           [spacebar] Scroll down 
  1341.           [delete] Scroll up
  1342.           b Beginning of page
  1343.           e End of page
  1344.           g Go to a specific node
  1345.           s Search for a string in this node
  1346. When using the 'm' command, the name of a menu item must be specified. For 
  1347. example, to view the menu item labelled 'GCC' one would type 'm GCC'. Typing 
  1348. 'm ?' will give a list of all menu labels for the current node.
  1349.  
  1350. Readmes
  1351. Most programs come with a README or some addendums to the man page; these are 
  1352. often stored in the /usr/doc directory. To make for quick browsing of the 
  1353. directory and files, an alias can be set up in ~/.bashrc which uses the text-
  1354. mode browser Lynx as a combined directory browser and text viewer:
  1355.   alias doc='lynx /usr/doc'
  1356.  
  1357. LDP
  1358. The linux documentaton project provides a wealth of documentation which is 
  1359. installed by most distributions in the /usr/doc directory. These include How-Tos,
  1360. FAQ lists, and manuals such as the Network Administrator Guide [NAG], System 
  1361. Administrator Guide [SAG], and the Linux Programmer's Guide [LPG]. It is 
  1362. convenient to set up aliases for these documents in the ~/.bashrc file:
  1363.   alias howto='lynx /usr/doc/how-to'
  1364.   alias faq='lynx /usr/doc/FAQ'
  1365.   alias nag='lynx /usr/doc/nag/index.html'
  1366.   alias sag='lynx /usr/doc/sag/index.html'
  1367.   alias lpg='lynx /usr/doc/lpg/index.html'
  1368. Some distributions provide an HTML-formatted online manual which is stored in 
  1369. the doc directory:
  1370.   alias manual='lynx /usr/doc/HTML'
  1371. Distributions such as Debian allow the installation of an archive of Linux 
  1372. Gazette issues in the /usr/doc directory:
  1373.   alias lg='lynx /usr/doc/lg'
  1374.  
  1375.  
  1376.  
  1377. Software
  1378. --------
  1379. Linux distributions come with thousands of software packages, about a quarter of 
  1380. which will ever be run by then end user [usually late at night when curiosity 
  1381. strikes, before the scotch wears off]. Unfortunately most distributions forget 
  1382. one or another of the most useful software packages -- the ones that make Linux 
  1383. easier to use and more powerful.
  1384.  
  1385. Console Utilities
  1386. Linux has a huge amount of console utilities included with every distribution, 
  1387. more than a single user could ever hope to learn. Surprisingly, though, some 
  1388. essentials are invariable left out of almost every distribution:
  1389.  aide -- GPL utility similar to Tripwire
  1390.  alien -- Convert packages to and from RPM, DEB, and TGZ format
  1391.  biew -- binary file viewer and editor; similar to hiew
  1392.  lsof -- List Open Files -- excellent system monitoring tool.
  1393.  nasm -- Netwide Assembler -- for assembly language programming
  1394.  nc -- NetCat -- network debugging/probing tool
  1395.  nmap -- network port scanner
  1396.  pgcc -- pentium-optimized version of GCC
  1397.  portsentry -- network port monitor [detects scans] 
  1398.  pstack -- Similar in spirit to strace; displays stack trace of running program
  1399.  tcpdump -- packet capture utility [use with sniffit/ethereal]
  1400.  
  1401.  
  1402. X Applications
  1403. With the advent of the KDE and Gnome desktop environments, a lot of the standard
  1404. GUI utilities --CD players, hex editors, notepads, calculators-- are readily 
  1405. available. There are one or two additional utilities that might be considered 
  1406. essential [or at least highly recommended] to any X installation:
  1407.  DDD -- Data Display Debugger -- excellent front-end to GDB
  1408.  Eterm or Aterm -- enhanced terminal emulators for X
  1409.  FileRunner -- Filemanager with FTP capability
  1410.  Helptool -- Redhat GUI frontend to installed man, howto's, etc
  1411.  Nedit -- programmer's editor [with Project Mgr front-ends available]
  1412.  
  1413.  
  1414.  
  1415.  
  1416. In Conclusion
  1417. -------------
  1418. This should be enough to get a basic linux installation both fully functional 
  1419. and reasonable secure, as far as typical workstation applications are concerned. 
  1420. To be sure, there additional considerations to be taken into account for laptops, 
  1421. for DSL or ISDN connections, and for inter- or intranet servers. It is hoped that 
  1422. upon finishing this document, the reader will be in a better position for 
  1423. researching and applying solutions to these additional configuration problems.
  1424.  
  1425.