LINUX NEWBIE ADMINISTRATOR GUIDE
ver. 0.90 2000-09-01 by Stan and Peter Klimas
Distributed under the General Public License http://www.gnu.org/copyleft/gpl.html. Your feedback, comments, corrections, and improvements are appreciated. Send them to penguin@thepenguin.zzn.com

Back to Top
Part 4: Linux Newbie Administrator FAQ


Contents:
4.1 LILO issues
   4.1.1 Linux cannot detect all my memory
   4.1.2 LILO displays only LI (or LIL) and hangs
   4.1.3 How can I change the operating system that LILO boots on default?
   4.1.4 The LILO prompt stays too short (or too long) on the screen during the bootup
   4.1.5 Uninstalling Linux
4.2 Accessing my drives
   4.2.1 Where are my drives?
   4.2.2 How can I access my CDROM?
   4.2.3 How to mount a floppy, zip drive, dos partition, or a network drive?
   4.2.4 How to mount a remote MS Windows filesystem through Samba?
   4.2.5 Any quick way to access a file on a DOS/Windows floppy?
   4.2.6 Mounting works when I am root. Can a normal user mount?
   4.2.7 Mounting command is too long, how can I simplify it with an alias?
   4.2.8 Can I automount?
   4.2.9 How do I get my zip drive recognized?
   4.2.10 Can I set 32-bit hard drive IO?
4.3 Working with X-windows
   4.3.1 How do I install kde on RedHat 5.2?
   4.3.2 How do I set up my video card, monitor and mouse for the X-server?
   4.3.3 How to X-window remotely?
   4.3.4 Can I have multiple sessions of X running at the same time?
   4.3.5 Can I have a GUI login prompt?
4.5 Printer and soundcard
   4.4.1 How to setup my soundcard?
   4.4.2 How do I setup my printer?
   4.4.3 Word Perfect 8 does not have a driver for my printer
4.6 Setting up a network
   4.5.1 Would it be worth it to set up my home network?
   4.5.2 How to set up my home network?
   4.5.3 I have problems configuring my ppp dial out
   4.5.4 How to browse the net from my networked computer without a modem?
   4.5.5 How do I use Samba?
   4.5.6 Sendmail
   4.5.7 Simple web server (running Apache)
   4.5.8 Simple ftp server
   4.5.9 How can one access my computer from the outside world when I am on the net using phone connection?
4.5.10 Can my home computer get hacked?

4.1 LILO issues

4.1.1 Linux cannot detect all my memory

If you have more than 64 megabytes of physical memory, Linux kernel ver. 2.0.36 or lower will use, by default, only the first 64 MB. To see how much memory Linux uses on your system, type:
cat /proc/meminfo
You can check your version of Linux kernel with:
uname -a
The last popular kernel with the "memory problem", 2.0.36, comes with RedHat 5.2.  My RedHat 6.0 came with kernel 2.2.5-15 so it does not have the "memory problem" any more.
To get more than 64 MB memory recognized on RH5.2, you have to edit (as root) the file /etc/lilo.conf, and add a line like this just before your first "image=" statement:
append="mem=80M"
If you have an amount of memory different than 80 MB, adjust the above line. For any changes in /etc/lilo.conf to take effect, you *must* re-run the program
lilo
(watch if it runs without errors) and reboot. After the reboot, you can check if your adjustment worked using either of these two commands:
cat /proc/meminfo
free
For testing purposes, or if you are having problems, the option of specifying the amount of memory at the LILO prompt is useful:
[type at LILO prompt during bootup] linux "mem=16M"
Occasionally, I hear the advice to skip the upper few megabytes if you have problems enabling all your memory, or the machine locks up. E.g., enable only 78 out of your 80 MB. This is apparently the case for some SCSI controllers that use the very upper chunk of the main memory. Take it for what it's worth.
Occasionally on some systems, Linux recognizes only 16 MB of memory. This is usually linked to the setting "memory hole at 15-16 MB" enabled in the BIOS setup (the solution is to disable this BIOS setting). It is probably a good idea to disable all "advanced" features in your BIOS setup anyway (for example, the BIOS virus detection seems to be a common source of problems ).
Mixture of memory chips with different timings can also lead to memory recognition problems or to system crashes (the solution is to replace the memory chips so that the timing of all memory chips is the same).

4.1.2 LILO displays only LI (or LIL) and hangs

I quote from my good handbook "Red Hat Linux Unleashed" by Kamran Hussain, Timothy Parker, et al., published by SAMS Publishing:
"When LILO loads itself, it displays the word LILO. Each letter is printed before or after performing some specific action. If LILO fails at some point, the letters printed so far can be used to identify the problem. [...]
LI [...] This is caused either by geometry mismatch or by moving /etc/lilo/boot.b without running the map installer.
LIL [...] This is typically caused by media failure or geometry mismatch."
The geometry means the number of sectors/heads/cylinders used in the hard drive configuration of your BIOS. Hope this helps!
It is a very good idea to have a handbook for Linux or at least a general UNIX handbook. Handbooks for Windows are useless, handbooks for Linux are great!  "Red Hat Linux Unleashed" is a very good handbook but I am sure there are many other equally good ones.
With a LILO error like above, you can boot your machine using a Linux or DOS boot floppy. There seems to be several general possibilities to correct such a LILO error, depending on what is wrong:
1. If LILO simply got corrupted, you can remove and re-install it. You can remove LILO by running under Linux:
lilo -u /dev/hda
or, under DOS:
FDISK/MBR
which rewrites the hard drive master boot record (MBR), in which LILO resides, and replaces it with "clean" DOS stuff. You will lose access to Linux, but you can boot it from the floppy and re-install LILO on top of the DOS MBR. To re-install LILO simply re-run the command lilo (as root).
2. Specify the option
linear
in your /etc/lilo.conf file. This is particularly useful for large drives (>8 GB). See man lilo.conf for details. The option "linear" is safe--it should not affect a properly working system, so you can specify this option is any case.

You may also want to play with the method by which BIOS accesses your harddrive. Fore example, turn the LBA ("linear or large block access") mode on/off in your BIOS to see if this helps.

3. Look into your BIOS setup and figure out how the specified hard drive geometry does not match your hard drive. From under Linux, you can display the hard drive geometry using (for example, for the first IDE hard drive):
hdparm -g  /dev/hda
You can typically easily find the recommended manufacturer geometry on the web using Google to search for your harddrive model number.

4. Put LILO on another partition (different hard drive) and,  using fdisk, make this partition bootable (if your system supports booting from another drive). Or swap your hardrives so that the one that is better supported by your old BIOS comes as the first hard drive on your first IDE interface.

5. Maybe you prefer to use "loadlin" instead of "lilo". From under DOS, locate your CDROM and see the program /dosutils/loadlin.exe .  It boots Linux from DOS.

4.1.3 How can I change the operating system that LILO boots on default?

There are typically two sections in the file /etc/lilo.conf . One starts with "image=" and it is relevant to Linux, the other starts with "other=" and this is the dos/win section. The first to appear in /etc/lilo.conf is booted by default. So to change the system that boots on default, swap the sections. Don't forget to re-run the command
lilo
after any changes to /etc/lilo/conf .

4.1.4 The LILO prompt stays too short (or too long) on the screen during the bootup

Add or adjust the line
delay=100
right before the first "image=" or "append=" statement in your /etc/lilo.conf file. The number is the time of delay in tenths of a second (0.1 s), so in the example above the delay will be 10 seconds.  Don't forget to re-run lilo after making the changes to the /etc/lilo.conf file, or the delay will not change.

4.1.5 Uninstalling Linux

If you really wanted to "uninstall" Linux, you can run this command  (from under DOS or MS Windows):
FDISK/MBR
which will get rid of LILO--it overwrites the master boot record (MBR) of your first hard drive, where LILO resides. After this you can remove the Linux partitions using the DOS "FDISK" utility to re-claim the hard drive space.

4.2 Accessing my drives

4.2.1 Where are my drives?

Linux shows all the directories in one directory tree, irrespectively of what drives/hardware they are found on. Generally, this is a much better solution than the traditional DOS/Windows model--it completely abstracts the file system from the underlying hardware. You will appreciate this if you ever have to re-arrange or expand your hardware or add network resources. But for the users who are accustomed to the DOS way of dealing with drives, it adds some extra complexity.
In short, don't search for drive letters. There are none under Linux; the content of your disks appears as subdirectories on your single Linux filesystem (directory tree).   On default, the content of removable media does not appear automatically in these subdirectories--you have to "mount" your drives. See the next answers for details. You should also unmount a drive before ejecting the media.
You can access (read and write) a variety of drives and file systems from under Linux. This includes native Linux partitions, DOS and MS Windows partitions (on hard drives or floppies), ZIP and Jazz drives, and CDROM disks. Many less common file system types are also supported. This means that you can download your Linux software using Netscape for Windows, save the downloaded file on you MS Windows hard drive partition, and then boot Linux and copy the downloaded software from the Windows partition on you harddrive to the Linux partition, and finally install the software under Linux.

4.2.2 How can I access my CDROM?

Mount it. The mounting adds all the directories and files from your CD to your Linux directory tree so you can easily access them without the drive letter.
As root, you can mount the CDROM with a command like this:
mount -t auto /dev/cdrom /mnt/cdrom
If this works, the content of your CD appears in the directory /mnt/cdrom
Chances are this command will not work for you right away--you may have to customize it. Here is how it works.
The command tells the operating system to mount a filesystem autodetecting the filesystem type ("-t auto"). The device is /dev/cdrom. The mountpoint (the directory where to which "mounting" takes place) is /mnt/cdrom. This directory must exist and be empty. If it does not exist, create it with:
mkdir /mnt/cdrom
If the mounting command fails, make sure that the device /dev/cdrom exists. If it doesn't, where is your CDROM? Chances are it is something like /dev/hdb if you have an IDE CDROM. Try /dev/hdb instead of /dev/cdrom in the mount example above. If this fails, you can try /dev/hdc or /dev/hdd, if your cd is an IDE CDROM. If none of them is your CDROM, maybe you don't have IDE but a SCSI CDROM? Then try /dev/sda1, dev/sda2, etc. ["hda" is the the primary IDE master drive, "hdb" is the primary IDE slave drive, "hdc" is the secondary IDE master (if you have two IDE interfaces on your computer), hdd is the secondary IDE slave, "sda" is the first SCSI interface and the number is the SCSI device id number.]
It is a good idea to have a device /dev/cdrom anyway because some programs assume that it exists. If it does not exist on your system, you may create it as a symbolic link using, for example:
ln -s /dev/hdb /dev/cdrom
if your cdrom is the /dev/hdb drive.
If you cannot mount because "the device is already mounted or directory busy", perhaps the mountpoint /mnt/cdrom is your current directory. You have to change the directory to somewhere else in order to be able to mount to it; for example change the current directory to the root directory by issuing this command:
cd /
To unmount a mounted CD, exit the directory /mnt/cdrom and type as a root:
umount /mnt/cdrom
Your CDROM may refuse to eject the media if it is not unmounted. Also, you may have problems mounting the next CD if the previous one was not unmounted. If you cannot unmount because "the device is busy", perhaps /mnt/cdrom (or any subdirectory underneath) is your current directory? You need to change your current directory to somewhere else out of the mountpoint in order to unmount the device.

4.2.3 How to mount a floppy, zip drive, DOS/Windows partition, or a network drive?

Very much the same as CDROM--see the previous answer if you did not read it.
Floppy. I can mount my floppy (as root) with:
mount -t auto /dev/fd0 /mnt/floppy
Again, make sure that the directory /mnt/floppy exists and is empty. Also, /mnt/floppy/ cannot be your current directory.
After a successful mount, the files from the floppy appear in the directory /mnt/floppy/ . All the users will be able to read the files, but only root will be able to modify/delete the files. Please read further if you wanted the users to be able to write to the floppy.
To unmount a floppy (you *must* do this before ejecting the disk!) use:
umount /mnt/floppy
If you cannot unmount because "the device is busy", perhaps the /mnt/floppy/ directory is your current directory. Exit it by typing (for example):
cd
which will change your current directory to your home directory.
Zipdrive.  I mount the parallel port external zipdrive (scsi emulation) with:
mount -t vfat /dev/sda4 /mnt/zipdrive
The "-t vfat" is used here because zip disks come preformatted in the vfat filesystem, which is the filesystem of MS Windows with the long filename support. You won't be able to eject the disk without unmounting it.
All zipdrives (internal SCSI and IDE, external SCSI and parallel port) but the USB are supported under Linux (April 1999).
DOS/Windows partition. I use a dual boot system with both Linux and MS Windows on the same computer. I can access files on the DOS/Windows partition after mounting it with the following command:
mount -t vfat /dev/hda1 /mnt/dosdrive
Again, you may have to customize this command depending on what partition your DOS filesystem is. The "hda1" means the first IDE hard drive (hd a), first partition (1); "hda2" is the first IDE hard drive, second partition; "hda3"--the first IDE hard drive, third partition; "hdb1"--second IDE hard drive,  first partition (or just "hdb" if it is the CDROM installed as a slave on your first IDE interface). "hdc" is the third IDE drive, hdd is the fourth IDE drive. SCSI drives have analogous names but start with letters "sd", followed by the letter indicating the SCSI interface, followed by the number indicating the SCSI device id . For example sda4 means "first SCSI interface, id number 4".
To mount so that all the users can read and write, you may want to try:
mount -t vfat -o user,rw,exec,umask=000 /dev/hda1 /mnt/dosdrive
This uses options (-o user,rw,exec,umask=000) to give absolutely everybody all the permission to all files on your DOS /dev/hda1 partition (you should ask yourself if this is really safe on your system). If users still can't write to the DOS partitions, perhaps the permissions on your mountpoint need to be set. This command (executed by root) will set up the permissions on the mountpoint /mnt/dosdrive so that all users will be given rights to read, write and execute:
chmod a=rwx /mnt/dosdrive
Network File System (NFS). This is great for direct access to files that reside on another Linux computer. For mounting of a remote filesystem as NFS, first check if the NFS service is enabled (use the program setup). NFS also requires permission from the other computer. To configure the permissions on the server machine, run as root:
netconf
and adjust the setting under "Exported File Systems" menu.
If you prefer to do it manually, the permissions are set in the file /etc/exports . My /etc/exports looks like this:
/usr hacker(ro) mars(ro)
/home hacker(rw) mars(rw)
/mnt hacker(rw) mars(rw)
This gives the machines called hacker and mars the permission to mount the directories /usr/ (read-only access), /home and /mnt (read-write).
If you set up your NFS properly, you should now be able to mount a network directory using a command like this:
mount -t nfs mars:/home /mnt/mars_home
This mounts the contents of the directory /home/ on a machine called "mars" into the directory /mnt/mars_home/ (which must exist and be empty).
Many operating systems know NFS, but MS Windows doesn't. Therefore MS Windows remote shares have to be dealt with differently. See the next answer for details.

4.2.4 How to mount a remote MS Windows filesystem through Samba?

A remote MS Windows filesystem can be mounted onto a Linux filesystem through the Samba protocol (Samba must be installed, go here if it isn't). Type a command like this (as root):
smbmount //mars/windows /mnt/mars_windows -c marie
This mounts the MS Windows resource called windows from the MS Windows machine called mars. The mountpoint on the client computer is /mnt/mars_windows/ . The option "-c" specifies that the samba server is a machine called marie (this should not be necessary, but it is on my system).
For the above to work, the permission must be given on the MS Windows machine for sharing the directory or drive as a resource. To do this, on the MS Windows machine, enable the filesharing using the "control panel-network", then launch the "Windows Explorer", click the right mouse button on the drive or directory to share, click on properties, switch to the page "sharing", give yourself the permission and give the resource a name.
To unmount an MS Windows directory use:
smbumount /mnt/mars_windows
If you have problems, see:
man smbmout

4.2.5 Any quick way to access a file on a DOS/Windows floppy?

Use "mtools", no mounting required. For example, I can use the mdir command to quickly inspect the content of the root directory on my DOS floppy:
mdir a:\
I can also use mcopy to copy the file "autoexec.bat" from the root directory on the floppy to my current directory on Linux:
mcopy a:\autoexec.bat .
You have to be root to be able to write to a floppy.
Type "mtools" to see the supported commands in the rich mtools set, which parallel the most popular DOS commands (for example: mformat, mtype, mren, mmove, mdel, mrd, mattib, ...), and use manual pages if you have problems using them. For example:
man mtype
will show me how to display a content of a text file on a DOS partition.
To access DOS drives other than a: or b:, you have to configure mtools so as to indicate which devices are associated with other DOS "drive letters". This is quite easy--you just edit and modify the file /etc/mtools.conf . I typically use pico to do it (as root):
pico /etc/mtools.conf
For example, my /etc/mtools contains a line like this:
drive c: file="/dev/hda1"
which instructs the mtools that the partition "/dev/hda1" will be called "c:" The setup of /etc/mtools.conf requires just uncommenting (removing the "#" at the beginning of the line) and adjusting the appropriate entry.

4.2.6 Mounting works when I am root. Can a normal user mount?

You have to edit the file /etc/fstab as root to give the normal users the permission to mount a particular drive. For example I can use the pico text editor to do this:
pico -w /etc/fstab
The option "-w" turns off the long line wrap.
Here is the content of my /etc/fstab:
/dev/hda2 / ext2 defaults 1 1
/dev/hdc3 /home ext2 defaults 1 2
/dev/hdc2 /usr ext2 defaults 1 2
/dev/hdc4 swap swap defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,users,rw 0 0
/dev/cdrom /mnt/cdrom auto noauto,user,ro 0 0
/dev/sda4 /mnt/zipdrive vfat noauto,user,rw,exec 0 0
/dev/hda1 /mnt/dosdrive vfat noauto,user,rw 0 0
none /proc proc defaults 0 0
hacker:/mnt/cdrom /mnt/hacker_cdrom nfs noauto,user,ro 0 0
hacker:/mnt/floppy /mnt/hacker_floppy nfs noauto,user,rw 0 0
hacker:/home /mnt/hacker_home nfs noauto,user,rw 0 0
hacker:/usr /mnt/hacker_usr nfs noauto,user,rw 0 0
Each line contains six space-delimited fields (this means that each line has six entries separated by white space). The first field is the name of the device. The second field is the mountpoint (an existing directory on your Linux system to which the resource will be mounted). The third is filesystem type.  For removable media that may contain filesystems of several types, I use the option "auto" to let Linux probe which filesystem is currently present there. (The order in which they are probed is determined by the content of the file /etc/filesystems . You may want to make sure that it specifies "vfat" before "msdos" or the long DOS filenames may be cut short.) The fourth field contains options: "auto" = mount the filesystem on the system startup; "rw" = read and write allowed; "ro" = read only, "user" = users have the permission to mount this filesystem (one can also use "users" to allow a user to mount and another user to unmount--otherwise only the user that mounted the filesystem can unmount it), "exec" execution of programs is permitted from this filesystem. The number in the field 5 specifies if the filesystem is to be backed up during a system backup, the number in the field 6 determines if to check up the filesystem integrity during bootup. The hacker stuff in my /etc/fstab are filesystems on another computer (called "hacker") on my home network and it serves here as an example of how to mount network resources. Check man fstab for more info.
For example, if regular (non-root)  users have the permission to mount the cdrom (the "user" option is specified), they can mount it using a command like this:
mount /mnt/cdrom
The command which the root uses for mounting (see here) will not work for a regular user because the regular user is restricted by the options in /etc/fstab and therefore s/he cannot specify simultaneously both the device and the mountpoint.
For a regular user to be able to write to a disk or execute a program on it, s/he must also be given the appropriate permission on the "mountpoint" directory. For example, this will give all the users all the permissions (read, write, execute) on the directory /mnt/floppy :
chmod a+rwx /mnt/floppy
Now (also the "rw" option is specified for the floppy in the /etc/fstab) the user will be able to write to a floppy. If the "exec" option was enabled in the /etc/fstab, the user would also be able to execute programs from the floppy.
Please note that the DOS vfat file system doesn't know about the file permissions the way Linux does. Linux manages this during mounting by giving the default file permissions on the mounted filesystem: the user who mounted the filesystem will be the owner of all files and will be given the right to write to the filesystem (if "rw" was specified in fstab) but other users can only read.  If you wanted to change this behaviour, you could use the "umask=" option so that the appropriate line in your /etc/fstab may look like this example:
/dev/sda4 /mnt/zipdrive vfat noauto,users,rw,exec,umask=000 0 0
This gives absolutely everybody all the permissions on your zipdrive (mounting, unmounting, read, write, execute).
To summarize, the file /etc/fstab is the place to keep your defaults on how to mount filesystems and what kind of access is allowed for users. You really want to customize it to simplify mounting on your system.  Linux default mounting scheme is restrictive so as to be secure,  you may want to remove some restrictions when setting up Linux at home.

4.2.7 Mounting command is too long, how can I simplify it with an alias?

An alias is an abbreviation  of a more complex or often used command.  For creating aliases, I edit, as root, the file /etc/bashrc . This way the aliases are available for all the users on the system. (For creating user-specific aliases, I edit the file .bashrc in the user home directory.) The relevant part of my /etc/bashrc looks like this:
alias cdrom="mount -v /mnt/cdrom"
alias ucdrom="umount -v /mnt/cdrom"
alias dosdrive="mount -v /mnt/dosdrive"
alias udosdrive="umount -v /mnt/dosdrive"
alias zipdrive="mount -v /mnt/zipdrive"
alias uzipdrive="umount -v /mnt/zipdrive"
alias floppy="mount -v /mnt/floppy"
alias ufloppy="umount -v /mnt/floppy"
The option "-v" stands for "verbose", i.e., it tells Linux to talk to me a lot during mounting. For the aliases to take effect, the user has to re-login. Now the user can mount the floppy using this simple command:
floppy
and s/he can unmount it using
ufloppy

4.2.8 Can I automount?

You can. Automount will automatically mount a filesystem as you access it and unmount when you stop using it.
To set up automount, I first run the programs setup (as root). Go to the option "netsysv" (RH5.2) or "System Services" (RH6.0) and make sure that automount service ("autofs") is enabled.
Then, I configure automount by editing the files /etc/auto.master and /etc/auto.misc, e.g. (as root):
pico /etc/auto.master
My /etc/auto.master looks like that:
/misc /etc/auto.misc --timeout 1
This says that my automount devices will be mounted in the directory /misc (which must exist and be empty). My automount drives will automatically unmount one second after I stop using them (for example, after I exit the directory). This is a short time--you may choose a longer one. The detailed config file is /etc/auto.misc . Here is mine:
kernel -ro,soft,intr ftp.kernel.org:/pub/linux
cdrom -fstype=auto,ro :/dev/cdrom
floppy -fstype=auto,rw :/dev/fd0
zipdrive -fstype=vfat,rw :/dev/sda4
dosdrive -fstype=vfat,ro :/dev/hda1
hacker_cdrom -fstype=nfs,ro hacker:/mnt/cdrom
hacker_floppy -fstype=nfs,rw hacker:/mnt/floppy
hacker_usr -fstype=nfs,ro hacker:/usr
Each line consists of 3 space delimited fields. The first field is the "key" which will be the name of the subdirectory (under /misc) to which the device will be mounted. This directory must NOT exist. It will not be visible when I use the command ls , but I can "cd" to it and my device will then mount. Don't ask me why it is so, and how to use this automount in GUI. I don't know. The hacker stuff in my auto.misc is the cdrom and floppy from another computer in my home network.
I automount to the directory /misc (not /mnt) so that I can also mount filesystems manually, without using automount, to the directory /mnt.

4.2.9 How do I get my parallel-port (external) Zip drive recognized?

RedHat 5.2 During the initial RH5.2 installation, answer "yes" to the question "do you have scsi devices" Then pick up the parallel port zip drive (ppa) from the list. During the disk partitioning later in the installation process, either have a disk in your zip drive or tell the install process to "skip" when it attempts to access your zip drive.
If you didn't setup  your Zip drive during the initial RedHat installation, you may also add the Zip support later in a way similar to adding the network card or any other module to the kernel:
As root, start an X-terminal, and run
/usr/bin/kernelcfg
to insert the ppa module into the kernel. (The "ppa" stands for, I guess, the "parallel port first interface 'a' ".)
After everything is done, inspect /proc/modules to see if the ppa module is loaded (or run as root lsmod to list the loaded modules). The information from kernelcfg goes to the file /etc/conf.modules so if you have difficulty removing modules (e.g., inserted by mistake)--as I did--just edit and adjust this file manually.
Now your zipdrive should be recognized. Put a zipdisk into it and try mounting using the previously described command (as root):
mount -t vfat /dev/sda4 /mnt/zipdrive
Using the Linux kernel ver.2.0.36 and below, you will not be able to use a printer which is connected through the parallel port zip drive (this works with the kernel 2.2.x). Use the command
uname -a
to see which version of kernel you are running.
RedHat 6.0 and 6.1  The zipdrive (zip100 drive) installation did not work during my upgrade to RedHat 6.0 (the installation program said that it couldn't find the zipdrive). So, after the installation was completed, I issued the following commands to insert the modules for parallel port zip drive into the kernel (as root):
/sbin/insmod parport
/sbin/insmod ppa
To have these two lines executed automatically after each bootup, I added them at the end of the file /etc/rc.d/rc.local (this file is something like autoexec.bat on DOS).
If this still does not work for you, you may also want to edit the file /etc/conf.modules.  Mine contains such a line:
alias parport_lowlevel parport_pc
and there is no line mentioning the "ppa" module.
For the newer Zip250 drive, I have the following two lines executed from my /etc/rc.d/rc.local file:
/sbin/insmod parport
/sbin/insmod imm

4.2.10 Can I set 32-bit hard drive I/O?

Newer Linux distributions (e.g., Mandrake 7.0) come with an option to automatically turn on the hard drive optimization. Here is how to turn on the hard drive optimization manually.

I know nothing about harddrives, but saw a review of RedHat 6.0 by Edward Choh (http://hardwarezone.community.com.sg/main.htm), in which he gave some interesting tips, including setting up the 32 bit input/output (I/O) and direct memory access (DMA). I tried it, and it worked fine for me. Be warned that it can possibly harm the content of your harddrive, so do not do it if you are a real PC newbie, don't feel geeky today, or have a weak heart--I can't guarantee it will work for you.

The turning on of the 32-bit I/O and DMA has to be done by root, and I did it in a single-user mode (to minimize the damage to the file system if something went wrong and I had to reboot). I definitely would not do it on a system currently running many programs or X-windows, and would have a current backup of any precious data.
To boot your computer in a single-user mode, I type this at the lilo prompt (during bootup):
linux single
Say, I would like enable the 32-bit I/O on my first IDE harddrive, which is "hda". First, I time the harddrive current performance, and note the score:
hdparm -t /dev/hda
Now, I display my current I/O and DMA settings:
hdparm -c /dev/hda
[my system showed 0, meaning that the 32-bit I/O is turned off and the default 16-bit access is used]
hdparm -d /dev/hda
[my system showed 0 again, meaning that the harddrive DMA access is turned off].
Now, I turn on the 32 bit IO and DMA:
hdparm -c 1 /dev/hda
hdparm -d 1 /dev/hda
Now, I can time the performance of the harddrive again to compare the score with the original one:
hdparm -t /dev/hda
If everything worked ok, and the performance has improved, I can "commit" the new settings, so they can survive a soft reset:
hdparm -k 1 /dev/hda
To have the new settings in effect every time you reboot the machine, you may add a line at the end of the file /etc/rc.d/rc.local (this file is something like AUTOEXEC.BAT in DOS):
hdparm -c 1 -d 1 -k 1 /dev/hda
If something did not work as expected, or the performance did not really improve, I can reboot at any time and the old settings will be in effect as long as I did not perform the last operation.
I performed this tune-up on 4 hard drives on my home network. It was a success on 3 newer hardrives: the performance improved by 30-300% and at least one computer "feels" faster than before. One harddrive (which is always flaky) hanged the computer hard during the performance test and I had to reset the machine (no damage done).

4.3 Working with X-windows

4.3.1 How do I install kde on RedHat 5.2?

RedHat 5.2 does not install kde by default because at the time of the RH5.2 release there was a problem with the license for a library that the kde uses. Otherwise, kde is a very good GUI, the library license problem is now solved, and the latest RedHat (6.0) includes kde (and the more ornamental GNOME). Still, the kde binaries are on your RedHat 5.2 CDs, you just have to install them yourself. (If you don't have the CDs, you can download the binaries from the kde site on the Internet.)
First check if your X-server works by executing:
xinit
[The X-server is a bare-bone X-windows system, without a "Windows Manager." You can execute your X-windows programs from here by typing the program name (with leading ./ or full path) in the X-terminal window, but you will not be able to move or resize the windows, add icons, etc.]
You can exit your X-server by typing exit in the X-terminal window, or pressing <Ctrl><Alt><Bkspace> to kill the X-windows server. (The last solution is perfect should your windows ever hang-don't reboot in such a case.) If your X-server does not work, see the next answer.
Now, login as root. Mount the RH5.2 CD:
mount /mnt/cdrom
Go to the proper directory:
cd /mnt/cdrom/kde/distribution/RedHat/i386/binary
It is useful to use the command line autocompletion (press Tab) when typing long paths or filenames.
Read the README file:
cat README-2rh51-rpms | more
Use the rpm  "RedHat Package Manager" to install the necessary packages
rpm -iv packagename
The packages have filenames ending with .rpm. First install the qt libraries, then kde support, then kde libs, then kde base. If you choose the wrong order, the dependency check will fail and the package will not install (rpm will issue a message). This is not serious, just re-install the required package first, and then try the next package again. After you are done with the base, you may want to install all other packages for kde (utill, admin, network, games, graphics, multimedia)--they are not big, so you may consider installing them all. Finally, just to make sure that you installed everything type:
rpm -ivh  *.rpm
The options "vh" print some extra info. You will get some messages like "the package is already installed" If there is more than a screenful of them, you can scroll back using <Shift><PgUp>. If you really don't like the command-line-based rpm package manager, you may install the same packages using a GUI front to rpm called glint (available only in RH5.2). Just type "glint" in the X-windows terminal.
Now tell your system that kde is to be your default X-windows manager. In user home directory, create an   .Xclients file:
pico .Xclients
which contains just one line:
/opt/kde/bin/startkde
Type in the line and save the file. (Adjust the line as required so the location of the startkde file is correct.) Now, make the file executable to all users:
chmod a+x .Xclients
Check if the permissions were changed:
ls -l .Xclients
[Files with a dot at the beginning are not displayed by a regular ls command, there are something like hidden files under DOS. You must use its name or ls -a  .]
If you created the file as root not the user, change the owner and the group of the file to the proper user:
chown user_name .Xclients
chgrp user_name .Xclients
That's it. Now typing startx should start your X-server with the kde as the windows manager.

4.3.2 How do I setup video card, monitor and mouse for the X-server?

This should be set-up during your Linux initial installation unless you skipped the step.
To set it up now, you may try, as root, one of these configurators:
Xconfigurator
XF86Setup
xconf
The simplest way is to run the command setup (under RedHat, as root) and access Xconfigurator from there.
To setup X-windows under Linux, you may need to know your hardware. You may want to dust your monitor manual to see what max synchronization frequencies (vertical and horizontal) your monitor supports. The message when the computer boots may give you a clue about what type of video card you have and with how much memory. Read the label underneath your mouse to find out about the mouse. Next time you buy a mouse, get a 3-button "Linux-ready" Logitech or similar (Linux makes a good use of all three mouse buttons).
When testing the X-server, if the screen goes blank, displays funny lines, or otherwise obviously does not function as designed, kill it fast with <Ctrl><Alt><BkSpace> and re-check your monitor sync frequencies. Running wrong frequencies can be bad for your monitor.
If you really have problems, set up a basic vga (640x480) server first. You can fine-tune it later, after you get some understanding of how things work on your system.

4.3.3 How to X-window remotely?

- Start X-server on the local machine, e.g.
xinit
- From the x-terminal give the remote machine the permission to display on your local screen:
xhost name_of_the_remote_server
In the really secure environment of my house, I could even give all servers the permission to display on my screen using (don't do it when connnected to the Internet):
xhost +
- Telnet the remote server.
- Start an X-program on the remote server directing the display on your local screen, for example, you may start a window manager:
startkde -display local_machine_name:0.0 &
The symbol "&" puts the command in the background, so that your telnet window is still available to you.
The 0.0 means "display zero, screen 0", which is your first screen on the first display and makes sense since you can have many concurrent sessions of X running on your computer with Linux.
You don't have to specify the "-display" option if your environment variable DISPLAY specifies the correct location on your current terminal, which is the case on my systems by default, but not on everybody else's as I am told. You can check your DISPLAY setting using:
echo $DISPLAY
- After I finish my remote X session, I restore the access control to my X-server using:
xhost -name_of_the_remote_server
or
xhost -
Example. This sequence of commands will run Netscape on the remote machine called marie, directing the display to the X-server with X-windows manager which runs on the local machine hacker:
startx
xhost marie
telnet marie
[login]
netscape -display hacker:0.0 &
[do my stuff]
[logout]
xhost -marie
In principle, you can run a program on any computer on the network, and display the output on any other (not necessarily the one you are sitting at).
I use remote X-windowing a lot to run fat programs (kde, Word Perfect 8, and Netscape) on a slim machine (486-33, 8 MB mem) which would not be able to run those by itself. It is also a convenient and fast way to work with files on a remote system for which the nfs mount is not set up.

4.3.4 Can I have multiple sessions of X running at the same time?

Yes, you can. When you issue the first startx command on your system, it opens the first X-session on the default display 0.  The second X-session must be opened on a different display. For example, this will open a second X-session on the  display 1:
startx -- :1
 You can have up to 6 concurrent X sessions. Use <Ctrl><Alt><F7> to switch to display 0,  <Ctrl><Alt><F8> to second screen,  etc. up to <Ctrl><Alt><F12>   Try man startx  if you need more info.
In a similar fashion, you can open another bare X-server session without a window manager. This will open one on display 2:
xinit --  :2
On this bare-bone X-display I can run a different windows manager (so as to have two different ones running at the same time) by typing in the X-terminal window one of these:
startkde      (to run kde. on newer systems, the command may be kde)
gnome-session (to run Gnome)
xfce          (to run XFce, my favourite "lightweight" desktop)
afterstep     (to run afterstep)
AnotherLevel  (to run AnotherLevel)
fvwm2         (to run fvwm2)
fvwm          (to run fvwm)
Of course the alternative windows manager will run only if it is installed on your system. The above windows managers are available on RH/Mandrake CDs for you to decide if you want them.  I use almost exclusively KDE, although the other managers may be smaller and faster. Gnome is a famous X-windows project which is said to be more advanced and is prettier than KDE, but it is still quite buggy, so perhaps not recommended unless you don't mind occasional trouble. RH6.x contains both major X-windows systems, Gnome and KDE.

4.3.5  Can I have a GUI login prompt?

To start your X-server automatically on the system start-up and display a graphical login prompt, you have to edit just one character in the file /etc/inittab .  This file specifies something like:
id:3:initdefault:
Change it to
id:5:initdefault:
This sets up the default runlevel to 5, which is X-Windows. The meaning of the different runlevels is explained in the same /etc/inittab file :
0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)
You can change the runlevel from the command line. E.g., this command (has to be executed as root):
init 6
will reboot your computer.

In summary, <Ctrl><Alt><F1> will switch you to to the first text console any time. <Ctrl><Alt><F2> will switch you to the second text console, <Ctrl><Alt><F3> to the third text console, etc, up to <Ctrl><Alt><F6>, for the total of 6 text consoles. <Ctrl><Alt><F7> will switch you to the first graphical user interface (GUI) console if one is running. <Ctrl><Alt><F8> to the second GUI console, etc., up to <Ctrl><Alt><F11> for the total of 5 GUI consoles.  The 12th console is either used as the 6th GUI (RedHat 6.1) or a place to which kernel messages are continually displayed (Mandrake 7.0, really cool feature). Typically none or only the first GUI console is running.
 

4.3.5a Can my sister have second X-windows login prompt so she does not have to kill my X-session to start hers?

To enable several concurrent GUI logins on different local consoles under RedHat (RedHat uses program gdm for graphical logins), I had to edit the file:  /etc/X11/gdm/gdm.conf . I have the following entry at the end of this file to enable 4 login terminals  <Ctrl><Alt><F7>  to  <Ctrl><Alt><F10>:

[servers]
3=/usr/bin/X11/X vt10
2=/usr/bin/X11/X vt9
1=/usr/bin/X11/X vt8
0=/usr/bin/X11/X vt7

This lets me run KDE and GNOME at the same time on one computer with two GUI terminals spare, so my sister can login despite my having screensavers with password-protection.

To enable several concurrent GUI logins on different local consoles under Mandrake (Mandrake uses kdm for graphical logins), I had to modify two files:  /etc/X11/xdm/Xservers to include something like:

:0 local /usr/X11R6/bin/X :0
:1 local /usr/X11R6/bin/X :1
:2 local /usr/X11R6/bin/X :2

and  /etc/X11/xdm/xdm-config  to copy all the settings for display 0 to display 1 and 2 so that it includes this:

DisplayManager._0.authorize:    true
DisplayManager._1.authorize:    true
DisplayManager._2.authorize:    true
DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0
DisplayManager._0.startup:      /etc/X11/xdm/GiveConsole
DisplayManager._0.reset:        /etc/X11/xdm/TakeConsole
DisplayManager._1.setup:        /etc/X11/xdm/Xsetup_0
DisplayManager._1.startup:      /etc/X11/xdm/GiveConsole
DisplayManager._1.reset:        /etc/X11/xdm/TakeConsole
DisplayManager._2.setup:        /etc/X11/xdm/Xsetup_0
DisplayManager._2.startup:      /etc/X11/xdm/GiveConsole
DisplayManager._2.reset:        /etc/X11/xdm/TakeConsole

This enables me to run gnome and kde at the same time on a single computer with third GUI terminal spare.

4.4  Printer and soundcard

4.4.1 How to setup my soundcard?

Try to run  (as root)
setup
The third button from the top ("sndconfig") sets up the sound card. Unless you have a very fancy sound card, this will work for you. At the end of the setup, Linus says how he pronounces "Linux".  ("sndconfig" can be also run directly from the command line--type sndconfig.)
You may want to try your soundcard and cdrom using a command line cdplayer. Put a music CD to your CDROM and type:
cdplay
If this does not work, maybe you don't have /dev/cdrom?  Check if you can mount a data CD as a root (look here) and create the device /dev/cdrom by linking it to the appropriate drive (most likely /dev/hdb), for example:
ln -s /dev/hdb /dev/cdrom
If cdplay works for root, but does not work for a regular user, maybe you need to give (as root) everybody the permissions to read and write to the the file /dev/cdrom :
chmod 666 /dev/cdrom
(The directory /dev  is where all your devices appear as files.)
Now, that you got hooked on cdplay, you can play third song, try:
cdplay play 3
You can also use the command cdp for rudimentary command line interface to cdplay, but perhaps you prefer the interfaces available from under X-windows (e.g., from KDE "K" menu, choose: Multimedia-"CD Player").
To stop the music either press the button on you CDROM or issue one of these commands:
eject
cdplay stop

4.4.2 How do I setup my printer?

As root, start an X-windows session by typing
startx
Read here if your X-windows is not set up properly yet.
Start an X-terminal (the "two-computer" button on your K-bar) and type in it:
printtool
This program does a complete printer setup, you just have to fill up the information about your type of printer and where it is hooked up.
Specifying the proper printer port is the most important part. If you don't know which one is yours try:
on RedHat 5.2: lp1 (this is the first parallel port on RH5.2 ) or lp2 (this is the second parallel port on RH5.2) or lp3 (this is the third parallel port on RH5.2); on RedHat 6.0 (or later):  lp0 (this is the first parallel port on RH6.x) or lp1 (this is the second parallel port on RH6.x) or lp2 (this is the third parallel port on RH6.x).  After upgrading from RH5.2 to 6.0, the printing stopped working because of the names changes of the parallel ports. I had to re-run the printool and adjust the port. The numbering of ports changed to bring it in line with numbering of other devices, which always starts from 0.
Try printing an ASCII test-page straight to the port. Only when this works set up the bells and whistles.
If you are setting up a remote printer, make sure that your machine has the permission to use the remote printer. The permissions are set in the file /etc/hosts.lpd (more secure) or /etc/hosts.equiv (less secure). These files simply list the names of the remote computers that can use a local printer, one computer name per line. Mine looks like this:
hacker
mars
The file /etc/hosts.lpd did not exist on my system, so I created it.
For quick information about the printers on your machine, you may want to view the file /etc/printcap :
cd /etc/
cat printcap
Here is the meaning of some codes that I see in my /etc/printcap:
 
: Field separator (separates the entries in the file).
\ (at the end of line) Continuation on the next line.
lp Name of the printer. "lp" is the name of the default printer on your machine. Subsequent printers are often, by default, given the the names lp0 or lp1, ... (or whatever you like) but this should not be confused with the name of the devices (parallel ports) to which they are connected.
sd=/var/spool/lpd/lp My spool directory (sd).
mx#0 Maximum size of print jobs (mx) in blocks. "0" means no limit.
sh I want headers to be suppressed (sh). Header is the page with your name that prints before your printing job (waste of paper if you print at home). 
rm=mars Name of the remote machine (rm), which on my system is called "mars (my printer is connected to a different computer).
rp=lp

or

lp=/dev/lp0

Name of the remote printer (rp), which is the name of the printer on the remote machine ("lp" on "mars" on my home network)
or

the name of the device on the local machine.  "/dev/lp0" is the first parallel port on RH6.x (it used to be /dev/lp1 on RH5.2, the numbering of parallel ports changed).

if=/var/spool/lpd/lp/filter Input filter (if). Your printing job will be formatted by this "filter" before it is sent to the printer.
sf Suppress the form feed (sf)  that is normally sent when printing is completed (use it if your printer keeps printing an empty page at the end of each jobs). 
The printer is controlled using the command lpc (as root).  Type "?" to see the options. This program is notorious for its peculiarities, so don't get discouraged easily. The printer queue can be viewed with lpq and cleaned up with lprm, both of which work for a user (not only root). You can print from the command line using the command lpr.

4.4.3 Word Perfect 8 does not have a driver for my printer

If you installed your printer in KDE using the printtool and it had a driver which works alright, set up Word Perfect to print using the "passthru postscript" driver.

4.5 Setting up a network

4.5.1 Would it be worth it to set up my home network?

This is an excellent idea. It will let you use the machines that are in your closet now because they were not powerful enough to run standalone. The benefits include sharing hard drives, zipdrives, CDROMs, modem, printers, even soundcards, running programs remotely (the text or graphics mode), browsing the Internet on all computers at the same time over one phone connection. If you ever lose control of your machine, you may also be able to shut it down remotely and thus avoid possible problems--see the answer on shutting down for details.

4.5.2 How to set up my home network?

Hardware. Your hardware must be set up properly. Your network card should have been set up during the initial RedHat installation. If it wasn't, you may want to set up your network card now from X-windows. If you have more than one network card on your computer, you must also set up the second cards manually, since Linux will autodetect only 1 network card.
Start an X-terminal, execute "su" (to make yourself a root) and then run:
/usr/bin/kernelcfg
Under Linux, most drivers for network cards are implemented as modules. So setting up a card involves just inserting the proper module with its parameters. You don't need to recompile the kernel, nor even reboot your computer (unless you have an uncommon card). To figure out what module(s) and parameters you need, see the Linux Network Administrator Guide (file /usr/doc/LDP/nag on your system or check http://metalab.unc.edu/mdw/index.html#guide).  This excellent guide is known as nag.
The parameters (IRQ and address) were a problem during my setup of two network cards on one computer--you must make sure that you don't have any hardware conflicts.  A common source of problems is that the card wants to configure on IRQ 5, which is occupied by the SoundBlaster, or IRQ 3 which conflicts with the second serial port (COM2, cua1, ttyS1). Inspecting the files /proc/interrupts, /proc/ioport and reading bootup messages may help.
For example,  my WD8013 card (same as SMC Elite and SMC Elite plus, according to nag) runs under IRQ 10 (set by a jumper on the card and I specified the IRQ in the kernel module setup), under the address 0x300 and uses the "WD" module.  My "SMC EtherEZ" card (no jumper settings on the card) runs under IRQ 9, address 0x240 and uses "SMC EtherEZ" module. Please make sure you don't omit the leading "0x" in the address--it means "hexadecimal" and must be there else the number will be interpreted as decimal.
After the module is added from kernelcfg and the kernel is re-run (kernelcfg provides this, see the menus), inspect the file /proc/modules to see if the module is indeed loaded (or run  lsmod as root). Information from kernelcfg goes to the file /etc/conf.modules so if you encounter difficulties (for example, I had difficulty removing modules inserted by mistake), just edit and adjust this file manually,  e.g., using pico.
Network.  After setting up the network cards and connecting the cables, set up the network by running (as root):
netconf
This program has help!  netconf can also be run under GUI, but I did not really try it. If you need more understanding of how networking works, you may want to read the previously mentioned nag. Also, reading this material may be of help: http://ieee.uow.edu.au/~mjp16/wylug-netlinux/notes.html.
It also contains very clear examples on how to set up a small office network that, like our home setup, has only part-time connection to the outside world.

How and what to fill up in netconf depends on your network. You surely want to fill up "Basic Host Information" (enable the first ethernet interface, eth0,  fill in the name, aliases and IP number of your local computer) and the "Information About Other Hosts" (names, aliases and IPs of other computers on your home network). This information goes to the files: /etc/hosts and /etc/sysconfig/network, so you may want to inspect these files and adjust them manually.

When setting up the network, don't mess up with the "loopback driver" which has the IP 127.0.0.1.  It is always there--it is the IP through which the computer talks to itself.
If you don't have an IP address (as will typically be the case for a home network with no permanent connection to the outside world), you may want to invent one. It does not matter very much what it is since when connecting to the outside world by your modem, you will be dynamically allocated an IP address (a machine can have many IP addresses at the same time). Your invented IP must be formally correct and the net mask must match the class of the network (class A, B or C).  See the chapter on IP addresses in the already mentioned Network Administrator Guide (nag) (/usr/doc/LPD/nag on your system, or if you don't have it, download it now from http://metalab.unc.edu/mdw/index.html#guide.
For a home network, you might want to invent a class C network (up to 254 machines, the smallest) IP number which has the first three digits between 192 to 223. The last three digits identify the machine on your class C network and must be between 1 and 254 (don't use 0, it means "whole network" or 255 which is the "broadcast address").  The middle two sets of digits can be anything from 0 to 255. Thus 223.223.223.1 is the first machine on the class C network 223.223.223.0 (the last zero signifies the whole network), with the broadcast address 223.223.223.255. The network mask for a class C network is always 255.255.255.0 (unless you subdivide your network into smaller "subnet", which is not discussed here).

Rather than completely inventing an IP number, it might be safer/better to use one of the numbers reserved for "private networks". For me, the IP number 192.168.1.1 works just fine.

Typically, the first machine on a network is the one that is expected to have the connection to the outside world (since it was connected first, but there is no standard for that). So, I filled up the GATEWAY to xxx.xxx.xxx.1 (my first machine) on all machines, except for the machine xxx.xxx.xxx.1, where I left this field blank.  Actually, although I left the field blank, netconf inserted the gateway 0.0.0.0 into the /etc/sysconf file.  This was a source of an annoying error message during the loading of the network card on the bootup. To get rid of the message, I edited /etc/sysconfig/network and set it to something like this:
GATWAYDEV=
GATEWAY=
[You don't want a gateway on your ethernet interface on this machine if it does not lead to the outside world. The ppp interface on this first machine will be set up as a default gateway once you connect through your modem, e.g. using kppp.]
The name of a computer is entirely arbitrary--the main user normally chooses a short word s/he likes. The domain name of the home network is also entirely arbitrary, unless you have a permanent connection in which case a domain name is registered to you.  Try to invent something that does not exist yet--it could make your life easier once you have a permanent connection.
As for the DNS server (also called "named"), RedHat 5.2 and 6.0 comes with DNS preinstalled as "caching-only" so it is easy to configure as such. You may also choose not to use DNS at all--if DNS is looking up an "outside" server and can't find it, it can be a real show-stopper (the machine can appear to be hanged for up to a few minutes).  To use local DNS, the "named" service must be enabled-- check this by running setup. To set up the caching-only DNS,  fill up the appropriate boxes in netconf.  E.g., I filled "nameserver 1" to my first machine on all computers (I entered the loopback address 127.0.0.1 on the machine xxx.xxx.xxx.1, and the proper xxx.xxx.xxx.1 address on all other machines).
No routes to other networks and hosts were required in my network, since I don't have other local networks. So I left this field blank.
Other than setting up the hardware correctly and filling up the info under netconf on each computer, as described above, I did not have to do anything on the standard RedHat to get my network working.
Reboot all computers one by one in any order (this is not necessary, but won't hurt you) and watch the boot messages (if they scroll too fast off screen, use <Shift><PgUp> to scroll up, or use dmesg  from the command line to view them later). Did your cards configure correctly?  Use the command route (as root) to see if the eth0 interface is running. Use the ping command to test the connections between individual machines.  Try to telnet your local computer to see it the loopback-only (lo) interface works:
telnet name_of_the_machine_you_are_sitting_at
After a successful login, you can exit the telnet session by typing
exit
Finally, try to telnet another computer on your network:
telnet name_of_a_remote_machine
If this works on all machines, your eth0 network interface is set up.
After setting up your ppp and connecting to your Internet Service Provider (ISP), you will have another network interface (ppp0) and then will be able to telnet any machine in the world.

4.5.3 I have problems configuring my ppp dial out

GUI.  If I were you, I would install kde and use kppp. (If you don't have kde installed, look here for information on how to install it.)  kppp is really easy to configure and run.  To set up your ppp dial out, run kppp (it is under the "K" menu "Internet, or you can run it from the xterm by typing kppp), press the "setup" button, create an account, and fill out the information required: telephone number, authentication protocol, and your Internet Service Provider's (ISP) domain name and the Domain Name Server (DNS) number of your ISP. All this information should have been provided to you by your ISP.
Next, I created a device called /dev/modem, by symbolically linking it to the device /dev/ttyS1 (as root)
ln -s /dev/ttyS1 /dev/modem
ttyS1 should work if your modem is on the port that DOS calls COM2. Use ttyS0 for COM1 and ttyS2 for COM3. The modem will not dial at all if a wrong port is chosen.
Finally, I tried to run the kppp but got an error message complaining about  a "lock".  So, I made sure that the file /etc/ppp/options is empty by editing it (as root):
pico /etc/ppp/options
and deleting the word "lock", then saving the file.
After these simple steps, the kppp could connect to my ISP with no problems on RedHat 5.2.
RedHat 6.0 required one additional step: setting the "suid" ("substitute user id") so that "kppp" runs with the effective user id of root (because it needs to access hardware directly). Without it, kppp complains that "it was not properly set up" and "can't create lock file".  This has to be done as root:
cd /usr/bin/
chmod a+s kppp
Troubleshooting. If your modem refuses to dial on the port that you are positive is chosen properly, maybe the modem is not set up properly (or maybe it is a "winmodem"? Then throw it away and buy a proper modem).  In one instance, I had to run kppp setup, edit the "modem commands" and input ATZ1 as the initialization string (instead of the default ATZ for a standard Hayes-compatible modem).
If your telephone line requires pulse dialing (instead of the default touch-tone dialing), you may need  to change the modem dialup command from "ATDT" (="ATantion Dial Touchtone") to "ATDP" (="ATantion Dial Pulse"). These commands work with any standard Hayes-compatible modem.
If your modem dials correctly and you are able to connect, but your authentication fails, perhaps your Internet Service Provider (ISP) uses a different authentication protocol. Call them and ask what authentication protocol they use. Or try pap, terminal-based or chap (in your kppp setup) until you find one which works with your ISP.
In one instance, I had a problem with the reliability of establishing a connection (the error would pop up saying something like: "time-out for the pppd startup", and the connection would establish only once every few trials). The problem was solved by changing the "flow control" option (in the kppp "setup" under "device") from "CRTSCTS" to XON/XOFF.   (Still CRTSCTS is the recommended flow control method in most cases.)
The performance (speed) and the reliability of the connection with my kppp was much improved after I upgraded from RH5.2 to RH6.0.  So if you have problems with these, maybe it is time to upgrade.
If you keep having problems setting up ppp, you may want to try minicom to see if you can get your modem working from there. minicom is something like PROCOMM for Linux. It should be present on your system if you chose to install it during your RedHat initial setup.  Here is a post from a newsgroup comp.os.linux.help which explains how to start ppp manually using minicom (edited for space):
From:  mark <balthazaar@one.net.au>  Subject: Re: pppd problem with kppp
BachuZ wrote:
>>Also, for an experiment, try using minicom to connect to your ISP, start ppp manually ... this can prove buggy scripts.   >how would u do that?
Easy!! If your ISP doesn't allow a manual logon then you might be in trouble. Every ISP I've ever used does allow this, so..   1. Start minicom.  2. dial your ISP.  3. Log in.  4. AFter your ISP starts PPP, quit minicom with ALT-Q (or whatever the sequence is to 'quit without reset').  5. start pppd, eg:
pppd -d -detach /dev/modem  115200 &
OK, PPP will be running.  Try pinging your ISP or another known IP address. That will test everything is OK. BTW, this is all in the PPP-HOWTO.  If you can get PPP running this way, then you have a scripting problem. If PPP doesn't work, you have a PPP configuration problem. Cheers.
 
Command line. If you would like to start your ppp from the command line, run netconf (as root) to configure your first ppp interface (ppp0).  The information you must enter is similar to what you entered when setting up kppp (have a look above!):  the proper device for the modem port, modem initialization and dialup strings, the telephone number of your Internet Service Provider (ISP), the proper authentication protocol (by entering the login name and password into the right slot).  The netconf utility lacked a place to enter the IP addresses of my ISP DNS server, so I edited the file /etc/ppp/pap-secrets (I use PAP authentication protocol) and added the two DNS IP addresses at the end of the setup line which was created by netconf so it looked like this:
# added by linuxconf
my_login_name ppp0 my_password 111.111.111.111 222.222.222.222
When done with the settings, I could start my ppp0 interface using the command (as root, unless I specified in netconf that normal users can start the interface):
ifup ppp0
and shut it down with
ifdown ppp0
Setting up the command line ppp was not more difficult on my machine than running kppp and the connection is more reliable for me. There is lots of command line scripts to start/stop ppp, but they apparently are not so easy to set up and use, and many newbies seem to have problems with them.
If this minimalistic setup of ppp does not work for you, here are some useful links:
Roderick A. Anderson < raanders@altoplanos.net > wrote:
I have a web page on setting up diald to work with RedHat Linux 5.x that works for me every time.  It is at http://home.altoplanos.net/~raanders/diald.html
 
Bill Unruh < unruh@physics.ubc.ca > wrote:
I just wanted to bring your attention to the page http://axion.physics.ubc.ca/ppp-linux.html for detailed instructions for setting up ppp. This is especially for cases in which the remote side uses (perhaps without the ISP even telling you) PAP or CHAP. While kppp is useful, there are a number of situations where it can fail.

4.5.4 How to browse the net from my networked computer without a modem?

Another computer on your network must have a modem (or another Internet connection) though :-). Set up IP masquerading. This way, all requests going from your network to your Internet Service Provider (ISP) appear to have originated from a single computer, and your ISP will let them through.

ON REDHAT 5.2, simple masquerading required just one command (on the computer with the modem):

/sbin/ipfwadm -F -p m
This sets up masquerading as your default forwarding policy of your IP firewall, and therefore is insecure but probably ok for a home user. (The danger is that if somebody hacked your computer, s/he can use it as an annonymous forwarder to hide his identity. Whatever malicious the hacker does to anybody, you take the blame. The hacker can even set his route to "tunnel" back to your network thus concealing his identity from you.) For more info, please check the file /usr/doc/HOWTO/mini/IP-Masquerade. A more secure setup is shown here:
ipfwadm  -F -p deny
ipfwadm  -F -a m -S 192.168.1.1/32 -D 0.0.0.0/0
ipfwadm  -F -a m -S 192.168.1.3/32 -D 0.0.0.0/0
ipfwadm  -F -a m -S 192.168.2.0/24 -D 0.0.0.0/0
This sets up the default policy to "deny" and explicitly masquerades two machines with IPs 192.168.1.1 and 192.168.1.3. It also masquerades any machine from the network 192.168.2.0. The number /32 stands for point-to-point networking (this means "machine-to-machine"), the option /24 identifies a class C network. The -D 0.0.0.0/0 identifies the default route that the machines to be masqueraded use to go out to the Internet.
ON REDHAT 6.0 THE NAME OF THE COMMAND is ipfwadm-wrapper (instead of ipfwadm) and I had to use the second, more secure method (setting up masquerading as the default policy does not seem to work on my system any more). Also, with newer kernels (2.0.34 and later) forwarding is disabled by default and must be turned on using:

echo "1" > /proc/sys/net/ipv4/ip_forward

Actually, ipfwadm-wrapper is a wrapper because it lets me use the old rules of setting up the firewall policies using the brand new firewalling kernel code. Doing something like this may work better for you:

ipchains -P forward DENY
ipchains -A forward -s 192.168.1.0/24 -j MASQ

If you would like to have this command(s) always executed on your system startup, add it as the last line(s) to the file /etc/rc.d/rc.local . This file is something like AUTOEXEC.BAT in DOS. As always, it is recommended to read the manual page and other documentation to see what the command(s) does and what are the other options:
less /usr/doc/HOWTO/mini/IP-Masquerade
man ipfwadm
man ipchains

4.5.5 How to use Samba?

Samba (smb) is for Linux-MS Windows networking. It is a program that makes a Linux computer pretend to be a MS Windows NT server, and thus lets your MS Windows 3.1/95/98-based computers connect to the network. Samba not only replaces WinNT--it is acclaimed to do a much better job than WinNT!
One of the three machines on my home network is a dual Linux/Win95 boot. I configured my network so that if I boot Win95, another Linux machine acts as a Samba server. This way, the Win95 machine has access to the network printer, shared directories on Linux, can telnet,  browse the Internet through a modem on Linux, etc. I can also access the files on the remote Win95 machine from Linux computers.
It is necessary to configure Samba only on one Linux machine.
First, I ran setup  as root, choose "System Services" (RH6.0) or "ntsysv" (RH5.2)  from the menu, and make sure that the "smb" service is enabled. (The program setup has help if you press F1. Just in case you were curious what the different services are for.)  If smb is not listed there, maybe you did not install it during your RedHat setup?  You may want to put your RedHat CD into the CDROM,  mount the CD, start glint (RH5.2) or gnorpm (RH6.0) installation utility (as root) and add Samba to your system.
The second part is to configure Samba. This is relatively simple since the Samba configuration is done through a single, well commented file: /etc/smb.config . The minimum setup includes specifying the workgroup name. Note that if you don't fill up the "host allow" option, all hosts are allowed, which is probably ok for the home network. The other options in the example /etc/smb.conf supplied with your RedHat CD may require adjustment to suit your particular needs, but they didn't have to be changed to get a Windows machine connected to my Samba server.
 Check that the options
domain master = yes
domain logons = yes
are enabled in /etc/smb.conf. You probably want them.
Under RH6.0, you may also perform a basic samba setup using (as root):
netconf
The third step is to configure your MS Windows 95 (or whatever) for networking. This is done exactly as if you were connecting to a WinNT server.  Make sure to enable the networking ("client for Microsoft Network") and fill up the workgroup name. To login on the network when booting MS Windows, use your Linux user ID and password. To see if it worked, click on the icon "Network Neighborhood"--your Linux server should be listed there, and underneath you should see the shared directories and printers that you chose to share in the file /etc/smb.conf.
If you can't see or use the public directories, make sure that you created them and set the proper read/write permissions for all users.
MS Windows 95b and above (95c, 98, and newer NTs) may use password encryption.  This will make your logins from the Window's machine fail, and you may need to enable this option in the /etc/smb.conf file:
encrypt passwords = yes
On the Linux server, you can start, stop, restart and check the Samba status using these commands (as root):
samba start
samba status
samba restart
samba stop
You need to re-start samba after making changes to your /etc/smb.conf file.
You can browse the net using your Netscape for Windows if you are connected to your Linux computer through Samba and the Linux machine is currently connected to the Internet. To do this, the IP masquerading must be set up on the Linux machine with the modem (described here) and you must enable the Samba dns name resolution in /etc/smb.conf :
dns proxy = yes
and then tell Windows to enable the dns server, specify the Linux server name and IP address (in ControlPanel-Network-TCP/IP).
You can also mount a remote Windows directory onto your Linux filesystem. Look here to see how.
The above described just a minimal Samba setup. You can get more information from:
man samba; man smb.conf; man smbclient; man smbmount
less /usr/doc/HOWTO/SMB-HOWTO   (under RH5.2)
documentation in /usr/doc/samba-2.0.3/doc  (under RH6.0)
http://www.sfu.ca/~yzhang/linux/samba/  (samba minihowto)
http://www.germanynet.de/teilnehmer/101,69082/samba.html
and also by studying the file /etc/smb.conf .

4.5.6  Sendmail

Sendmail is the Internet standard mail-transport system and the default mail-transport on RedHat5.2 and RedHat6.x Linux (Mandrake uses PostFix). As a user, you don't use sendmail directly--sendmail is the underlying engine that manages the mail on your machine in the background. To read/send mail in the text mode, you probably want to use pine or elm (choose one and stay with it--it can be inconvenient to manage two separate mail boxes).  In KDE, you may choose to use the "mail client" available from the K-menu. To communicate with the outside world through your ppp dial-out, you probably would like to use the Mozilla mailer that is built into your Netscape and which communicates directly with your remote Internet-Service-Provider-based mailbox.
Sendmail is very flexible and robust, but also notoriously difficult to manage if you needed to customize it to your specific needs. Luckily, Red Hat (5.2 or 6.0) comes with the sendmail that runs out-of-box (with some limitations though).
On my home system (default Red Hat setup), I can send mail to another user on the same machine with no problem (e.g. using pine). I can send mail locally or anywhere in the world from any mailer once I am connected to my Internet Service Provider through the modem  (IP masquerading enabled).  But when I am not connected, the mail sits in the queue and waits for the Internet connection, even if the mail is to be sent to another computer on my home network (a minor annoyance).  It gets sent once I connect.  (It happens because sendmail is trying to do a DNS lookup and this is not available on my system--RedHat default DNS is cache-only.)  If you really want to avoid this on RH6.0, you may use netconf (as root) and specify that sendmail is not to use DNS at all (Linuxconf that comes with RH5.2 does not give you the choice).  I do use DNS.
Under Linux 6.0, you may also want to configure other sendmail options using (as root) netconf.  I entered the name of my Internet Service Provider and the names of other machines on my home network under "mail deliver system"-"relay to hosts". I also added the names of my home network machines under "relay for by name".
You should also be aware of the limitation of your simple setup that arises if you send e-mail  from your home network (for example using pine), to the world beyond your network.  If you invented the IP address and your domain name is unregistered, there is no chance you will receive a reply.  Your outgoing mail is given a "reply" address in the form: "user_login_name@machine.domain". This is NOT ok since your domain name does not exist, according to any DNS in the outside world,  hence no way for any reply to get to you.  To overcome this, you may use the Netscape mailer to communicate to the outside of your home network. Netscape uses the settings you enter in its "edit-preferences" to communicate directly to your ISP-based mailbox (which resides on a registered server of your ISP) and thus bypasses your unregistered-home-network-based e-mail system.  Another possibility is to specify the correct address in the "reply to" field. If you do it in Netscape, you can setup your NetscapeMail to use your local Linux computer as the mail server, and this way be able to send e-mail from your NetscapeMail also to the computers on your home network (not only in the "outside world").  The option "reply-to" can also be set in the KDE "mail client" setting.  Also in "pine"  you can specify the reply-to address under "setup-configure",  "customized-hdrs" with something like:
Reply-to:  joe@joe_net.net
where "joe@joe_net.net" is your good reply-to e-mail address.

4.5.7 Simple web server (running Apache)

To set up a simple apache web server was extremely easy under RedHat 6.0.  First of all, I made sure to install the apache web server rpm package during my RedHat installation.  If you didn't do it, you can put the RH CD in your CDROM now, mount it, and install the package apache-*.rpm (instead of the "*" the name also contains the version number and the platform).  If I know what I want to install, it is simple do it (as root):
cd /mnt/cdrom/RedHat/RPMS
rpm -ivh apache*.rpm
Then, I run "setup" (as root) and make sure that the httpd daemon (under "system services") is enabled.  [A daemon is a program that sits in the background and wakes up when it is needed. In the case of httpd, it gets awakened when somebody calls on your http server.]
Now, the httpd will start automatically every time I boot the computer. I can also start it manually using (as root):
/etc/rc.d/init.d/httpd start
and shut it down using:
/etc/rc.d/init.d/httpd stop
I should already have the directory:  /home/httpd (check if it exists), and under it, the subdirectory html--this is the "root directory" for people accessing my computer from the web ( "their root directory" means that they will not be able to access any directories above the directory /home/httpd/html/ on your system).  On default, this directory contains some html files and manual that the apache installation program put there.  So I should now be able to connect to my web server from another machine on my home network. For example I would type on the Netscape "Location" line:
http://my_http_server_name
and be able to browse the "apache" manual.
To put my own content on my web server, I move the "apache" sample files somewhere else, and copy or link my html files (the ones which I want to display to the public) to the directory /home/httpd/html/ (don't forget to include the the file index.html , this is the one that appears first when somebody connects to your server).
The apache configuration files and log files are in the directory /etc/html/ if you wanted to view/customize them. The log file can be viewed in "real time" using this simple command (as root):
tail -f /etc/httpd/logs/access_log
[The tail command normally displays the end ("tail") of a text file. With the option "-f", "tail" keeps displaying the end of the log file as it grows--really handy to monitor the log file and see who logs onto your server.]
For graphical setup of the Apache server, try this (in an X-window, as root, if you installed "Comanche" from your RedHat CD):
comanche

4.5.8 Simple ftp server

With my RedHat Linux distribution,  setting up an ftp server could not be simpler--it just works out-of-box.  This is because the ftp service is enabled on default as one of the standard services (as is telnet and gopher), in the file /etc/inetd.conf. Here is the relevant part of my /etc/inted.conf:
ftp     stream  tcp     nowait  root    /usr/sbin/tcpd  in.ftpd -l -a
telnet  stream  tcp     nowait  root    /usr/sbin/tcpd  in.telnetd
gopher  stream  tcp     nowait  root    /usr/sbin/tcpd  gn
The second part of my ftp server setup is in the file /etc/passwd which defines the ftp account:
ftp:*:14:50:FTP User:/home/ftp:
The ":" is a field separator. The first field is the account (user) name "ftp", the "*" in the second field indicates that the password is disabled (nobody can login under the "ftp" user name), the user id is 14, group id is 50, "FTP User" is a comment, the home directory is /home/ftp, the last field is empty (for "normal" user accounts, it specifies the name of the shell for the user).
Because this setup was already done for me by RedHat,  anybody can ftp my computer and either login as a user (will be prompted for password and directed to his/her home directory), or login as "anonymous" and give his/her e-mail address as a password.  Any user can also enter something like this on the Netscape "location" line:
ftp://my_computer_name
and connect automatically (Netscape will take care of sending the "anonymous" user name and the e-mail address as password).
The "anonymous" ftp users are directed to the directory /home/ftp ,  which appears to be a root directory to them (they cannot access any directory above it). I put the files I want to serve in the subdirectory /home/ftp/pub .
The directory /home/ftp/bin contains the commands that the remote users are able to execute. On my system these are: compress, cpio, gzip, ls, sh, tar, zcat; all with execute-only (111) permissions.
The directory /home/ftp/etc contains the setup files necessary for the anonymous account to function (edited passwd, group, ld.so.cache). The directory /home/ftp/lib contains the libraries (I guess these libraries are used by the commands that the anonymous ftp users are allowed to run).

4.5.9 How can one access my computer from the outside world when I am on the net using phone connection?

The only difficulty is that your IP address is dynamically allocated to you by your Internet Service Provider (ISP)  from their IP address pool, and therefore the IP address is not the same every time you connect (unless you made specific arrangements with your ISP).  To telnet, ftp, or access your web pages (served by your appache web server) from the outside world, one has to know your current IP address. To find out my current IP address, I use this  "interface configuration" command which, when run without any parameters, just displays info on all active network interfaces present on your machine:
/sbin/ifconfig
On my machine this displays three paragraphs of information on:  eth0 (the first ethernet network interface that leads to other computers on my home network), lo (the loopback-only interface, the one with IP 127.0.0.1, this one must be present on every machine), and ppp0 (the first point-to-point protocol interface).  My current IP address, assigned to me by my ISP, is displayed under the ppp0 heading.  (Your Linux machine can have multiple IP addresses assigned at the same time,  so if you have a "static" IP that you use on your home network, it is still valid but visible only on your home network.)
Once I know the IP address, I can send it through ICQ or e-mail to a friend, who can then, for example, telnet my computer (s/he must have an account on my machine) and run a program on my linux machine, or enter http://my_ip_address on the "location" line in the browser to browse my home web pages, etc.  I can also write a short script that will automatically notify my friend when I am connecting to the Internet and enter the name of the script under kppp-setup-account-edit-dial-"execute program upon connect".  Here is my script which notifies me at work when somebody in my house is going on-line  (I entered the text into a text file and made the file executable using chmod o+x file_name) :
#!/bin/bash
sleep 15
/sbin/ifconfig | mail -s notification my_email_address
The first line of this script tells my computer to interpret this text file as a bash shell script.  The second line makes the script wait 15 seconds (just to make sure that the e-mail is not sent before the ppp connection is fully established).  The third line executes the ifconfig command and pipes the output to the mail utility that sends it to my_email_address under the subject "notification".
A more flexible way to access your home computer remotely is to configure it as a dial-up ppp server (as opposed to the dial-in client that you use when you connect to your ISP).  If somebody has a simple recipe how to do it, please drop a line.

4.5.10 Can my home computer get hacked?

Unfortunately, this is perfectly possible and attempts to do so are quite common.  Every time you are connected to your Internet Service Provider (ISP) you are at risk.  Read the previous answer if you would like to know how it is possible.
The real danger is that the intruder, if s/he is able to login onto your machine on any account, might find another security hole and get root access. This is particularly possible if you are a real newbie administrator and/or your machine is not really security oriented (you are at home, aren't you--who would care about security, you think!).
To protect yourself, have fairly long passwords that contain both numbers and letters for all accounts on your computer.  Change the passwords occasionally.  The best way to enforce the password policies on all users of your computer is to run (as root, available on RH6.0) linuxconf and under "password and account policies" change the minimum password length to 6 or more characters, the minimum number of non-alpha characters (i.e., not-letters) to 1 or 2,  the number of days after which the password must be changed to something like 90 or less,  and set a warning about password expiry to something like 7 days before the expiration.  Check here for more info on weak passwords.
It is also an excellent idea to occasionally screen the files that contain a record of all the logins onto your computer: /var/log/secure (the most recent log) /var/log/secure.1 (older log)  /var/log/secure.2 (yet older log), etc.  There are also other useful log files in the directory /var/log that you might want to view, check them out from time to time. The most typical "warning" sign is a scanning of the ports on your computer: there are repeated entries on connection request from the same IP number to your system telnet, ftp, finger and other ports--somebody tried to learn more about your system.
If you never use remote connections to your home Linux machine, you might want to restrict the rights to use telnet, ftp, etc. (all the network services are listed in the file /etc/inetd.conf) to the machines on your home network. The access is controlled by two files: /etc/hosts.allow and /etc/hosts.deny .   These access-control  files work as follows.  When an outside connection is requested, the file /etc/host.allow is scanned first and if the name of the machine from which the connection is requested is matched, the  access is granted (irrespectively of  any entry in /etc/host.deny ).  Otherwise, the file /etc/host.deny is scanned, and if the name of the machine from which the connection is requested is matched, the connection is closed.  If no matches are found in either file, the permission is granted.  As an example,  you can deny access to telnet and ftp your home server from any machine from outside your home network by inserting the following entry in the file /etc/hosts.deny :
in.telnetd, in.ftpd: ALL EXCEPT LOCAL, .your_home_domain.name
For more info, check the excellent "Linux Network Administrator Guide" which is surely present on your RedHat (or whatever) distribution CD.  I printed this book and had it hardcovered.

For security reasons, it is also a good idea not to advertise the of the OS/version that you use. I replaced the contents of the file /etc/issue that on my computer read:

Red Hat Linux release 6.2 (Zoot)
Kernel 2.2.14-5.0 on an i586

with something like this:

WARNING: THIS IS A PRIVATE NETWORK
UNAUTHORIZED USED IS ALWAYS PROSECUTED!
MS Windows 2000 Telnet Server
Linux Compatibility Level

This blends a good joke with a bit more security (I hope).

Go to part 5: Linux shortcuts and commands