Part 4: Linux Newbie Administrator FAQ
by Peter, Stan, Barbara and Marie Klimas
Answers to Some Frequently Asked Linux Questions
Distributed under the General Public License http://www.gnu.org/copyleft/gpl.html.
Your feedback, comments, corrections, and improvements are appreciated.
Send them to either bklimas@magma.ca
or bw641@freenet.carleton.ca
Start: Linux Newbie Administrator Guide
Part 0: For the Undecided (Linux Benefits)
Part 1: Before Linux Installation
Part 2: Linux Resources, Help and Some Links
Part 3: Basic Operations FAQ
Part 4: >Linux Newbie Administrator FAQ<
Part 5: How to Upgrade the Kernel
Part 6: Linux Shortcuts and Commands
Part 7: Essential Linux applications (proprietary
or not)
Contents of this page:
4.1 LILO issues
4.1.1 Linux cannot detect all my memory4.2 Accessing my drives
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.1 Where are my drives?4.3 Working with X-windows
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.3.1 How do I install kde?4.5 Printer and soundcard
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.4.1 How to setup my soundcard?4.6 Setting up a network
4.4.2 How do I setup my printer?
4.4.3 Word Perfect 8 does not have a driver for my printer
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
Linux Newbie Administrator FAQ
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:4.1.2 LILO displays only LI (or LIL) and hangscat /proc/meminfo
You can check your version of Linux kernel with:
uname -a
To get more than 64 MB memory recognized, you may want to edit (as root) the file /etc/lilo.conf. 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 one of these two commands:
cat /proc/meminfo
freeFor 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.
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).
I quote from my good handbook "Red Hat Linux Unleashed" by Kamran Hussain, Timothy Parker, et al., SAMS Publishing:4.1.3 How can I change the operating system that LILO boots on default?"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 your bios hard drive configuration. 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 (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 diskette 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.
3. Look into your BIOS setup and figure out how your hard drive geometry does not match your hard drive.
4. Put LILO on another partition (different hard drive) and make this partition bootable from fdisk (if your system supports booting from another drive).
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.
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 command4.1.4 The LILO prompt stays too short (or too long) on the screen during the bootuplilo
after any changes to /etc/lilo/conf.
Add or adjust the line4.1.5 Uninstalling Linuxdelay=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). Don't forget to re-run "lilo" after making the changes.
If you really wanted to do "uninstall" Linux, you can run fdisk/MBR (from DOS or MS Windows) to get rid of LILO. After this you can remove the Linux partitions with fdisk to re-claim the disk space.4.2 Accessing my drives
Linux shows all the directories in one directory tree, irrespectively on what drives/hardware they are found. Generally, this is a much better solution than the traditional DOS/Windows model--it abstracts the file system from the underlying hardware. You will appreciate it if you ever have to re-arrange or expand your hardware or add network resources. But for users used to standard PC hardware and nothing else, it adds some complexity.4.2.2 How can I access my CDROM?In short, don't search for drive letters; the content of your disks appears as subdirectories on your single Linux filesystem. By 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 filesystems. 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 Windows hard drive partition, and then boot Linux and copy the software from the Windows to the Linux partition to install it there.
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.4.2.3 How to mount a floppy, zip drive, DOS/Windows partition, or a network drive?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 mount) 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 /dev/cdrom exists. If you don't have it, you may create it as a symbolic link, for example:
ln -s /dev/hdb /dev/cdrom
if your cdrom is /dev/hdb drive.
If you cannot mount because "the device is already mounted or directory busy", perhaps the mountpoint /dev/cdrom is your current directory. You have to change the directory to somewhere else in order to be able to mount to it.
To unmount a mounted CD, exit the directory /mnt/cdrom and type as a root:
umount /dev/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.
Very much the same as CDROM--see the previous answer if you did not read it.4.2.4 How to mount a remote MS Windows filesystem through Samba?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 the current directory of any user on your system.
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 should 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 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 Windows. 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, for example:
chmod a=rwx /mnt/dosdrive
Network File System (NFS). This is great for direct access of 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, run as root:
netconf
and adjust the setting under "Exported file systems".
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 directory /usr (read-only access) and /home and /mnt (read-write).
If you set up 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 directory home from a machine called mars onto 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.
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):4.2.5 Any quick way to access a file on a DOS/Windows floppy?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 is /mnt/mars_windows. The option -c specifies that the samba server is a machine called marie (this should not be necessary, but 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 from 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
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:4.2.6 Mounting works when I am root. Can a normal user mount?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 man 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 /etc/mtools.conf requires just uncommenting (removing the "#" at the beginning of the line) and adjusting the appropriate entry.
You have to edit the file /etc/fstab as root, for example using the pico text editor:4.2.7 Mounting command is too long, how can I simplify it with an alias?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,rw,user 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro,user 0 0
/dev/sda4 /mnt/zipdrive vfat noauto,rw,user,exec 0 0
/dev/hda1 /mnt/dosdrive vfat noauto,rw,user 0 0
none /proc proc defaults 0 0
hacker:/mnt/cdrom /mnt/hacker_cdrom nfs ro,noauto,user 0 0
hacker:/mnt/floppy /mnt/hacker_floppy nfs rw,noauto,user 0 0
hacker:/home /mnt/hacker_home nfs rw,noauto,user 0 0
hacker:/usr /mnt/hacker_usr nfs ro,noauto,user 0 0Each line contains six space-delimited fields. The first field is the name of the device. The second is the mountpoint (an existing directory on your Linux system to which the resource will be mounted). The third is the filesystem type. The fourth are 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, "exec" execution of programs is permitted from this filesystem. If you are curious about the numbers in the fields 5 & 6, check man fstab. The hacker stuff in my /etc/fstab are filesystems on another computer (called "hacker") in my home network and serve as an example on how to mount network resources.
If a user has the permission to mount the cdrom (the "user" option is specified), s/he can mount it using a command like this:
mount /mnt/cdrom
The command which the root used for mounting (see here) will not work for a regular user because the user is restricted by the options in /etc/fstab and therefore s/he cannot specify both the device and the mountpoint.
For the 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 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,rw,user,exec,umask=000 0 0
This gives absolutely everybody all the permissions on your zipdrive (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.
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, use the file .bashrc in the user home directory.) The relevant part of my /etc/bashrc looks like this:4.2.8 Can I automount?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
You can. Automount will automatically mount a filesystem as you access it and unmount when you stop using it.4.2.9 How do I get my parallel-port Zip drive recognized?First run "setup" (as root). Go to the option "netsysv". Make sure that automount service ("autofs") is enabled.
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 longer. 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:/usrThe 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 "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 so that I can also mount filesystems manually, without using automount, to the directory /mnt.
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.4.3 Working with X-windowsIf you didn't install the Zip drive during the initial RH5.2 installation, you can 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 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 you 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 probably works with the kernel 2.2.x, but we didn't try it). Use the command
uname -a
to see which version of kernel you are running.
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.)4.3.2 How do I setup video card, monitor and mouse for the X-server?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><backspace> 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 -i 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 them 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. 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. 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 .XclientsThat's it. Now typing startx should start your X-server with the kde as the windows manager.
This should be set-up during your RH5.2 Linux installation unless you skipped the step.4.3.3 How to X-window remotely?
To set it up now, you may try, as root, one of these configurators:Xconfigurator
XF86Setup
xconfThe simplest way is to run the command "setup" (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 on 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.
- Start X-server on the local machine, e.g.4.3.4 Can I have multiple sessions of X running at the same time?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:
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 -marieIn 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.
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:4.3.5 Can I have a GUI login prompt?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 by typing in the X-terminal window. For example:
fvwm2 (to run fvwm2)
startkde (to run kde)
afterstep (to run afterstep)
fvwm (to run fvwm)
AnotherLevel (to run AnotherLevel)Of course, the alternative windows manager will run only if it is installed on your system. The above windows managers are available on your RH5.2 CD for you to decide if you want them. I use almost exclusively KDE, although the other managers are smaller and faster. There is another famous X-windows project called Gnome. Gnome is said to be more advanced and prettier than KDE (and bigger too), but it is still more difficult to install and less stable than KDE, so perhaps not recommended for newbies. RH6.0 (due in early May 1999) contains two basic X-windows systems: Gnome and KDE.
To start up 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:4.4 Printer and soundcardid: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 with a command like this (as root):
init 6
which will reboot your computer.
4.5.1 How to setup my soundcard?
Try to run (as root)4.4.2 How do I setup my printer?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).
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).
If this 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.)
To stop the music either press the button on you CDROM or issue this command:
eject
As root, start an X-windows session by typing4.4.3 Word Perfect 8 does not have a driver for my printerstartx
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
Setting up the proper printer port is the most important part. If you don't know which one is yours, try lp1 first ( lp0 or lp2 are the other possibilities) and 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 machines, one machine per line. Mine looks like this:
hacker
marsThe 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 printcapThe 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 with lprm, both of which work for a user. You can print from the command line using lpr.
If you installed your printer using the printtool and it had a driver, 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 over 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 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.4.5.3 I have problems configuring my ppp dial outStart an x terminal, su (to make yourself a root) and 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/LPD/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 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.
After the module is added and kernel re-run, inspect the file /proc/modules to see if the module loaded (or run as root lsmod). 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, 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. If you need more understanding of how networking works, you may want to read the previously mentioned nag.
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 of your local computer) and the "Information About Other Hosts" (names, aliases and IPs of other computers on your local 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 machine 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 you 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.
Typically for a home network, you want a class C network (up to 254 machines, the smallest) 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).
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.]
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 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 a 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 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 RH5.2 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 latter). 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 machine to see it the loopback 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 a remote machine 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.
GUI. If I were you, I would install kde and use kppp. (If you don't have kde installed, see here for how to install it.) kppp is really easy to configure and run. Run kppp, press the "setup" button, create an account, and fill out the information required: telephone number, authentication protocol, and your Internet Service Provider (ISP) domain name and the Domain Name Server (DNS) number. All this information should have been provided to you by your ISP.4.5.4 How to browse the net from my networked computer without a modem?Next, I created a device called /dev/modem, by symbolically linking it to the device /dev/ttyS1
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 the 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:
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.
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 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 which one works with your ISP.
If you keep having problems with 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 RH5.2 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). When you are done with the settings, you can start your ppp0 interface using the command:ifup ppp0
and shut it down using
ifdown ppp0
Setting up the command line ppp was not more difficult on my machine than running kppp. 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.
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 the ISP will let them go out. Simple masquerading requires just one command (on the computer with the modem):4.5.5How to use Samba?/sbin/ipfwadm -F -p m
This sets up masquerading as your default forwarding policy and therefore is insecure but probably ok for a home user. (The danger is that somebody from your network may set his route to "tunnel" back to your network thus concealing his identity.) 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/0This 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 subnet 192.168.2.0. The number /32 stands for point-to-point networking, 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.
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
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!4.5.6. SendmailOne 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 ntsysv 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 5.2 setup? You may want to put your RH5.2 CD into the CDROM, mount the CD, start glint (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 RH5.2 may require adjustment to suit your particular needs, but don't have to be changed to get a Windows machine connected to your Samba server.
Just check that the options
domain master = yes
domain logons = yesare enabled in /etc/smb.conf. You probably want them.
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.
If your login from a MS-Windows-98-based machine fails, 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 stopYou 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-HOWTOand also by studying the file /etc/smb.conf and from the Internet. Having a good Linux handbook is also always an excellent idea.
Sendmail is the Internet standard mail-transport system and the default mail-transport on the RH5.2 Linux. 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 inconvinient 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.Go to part 5: Kernel UpgradeSendmail is very flexible and robust, but also notoriously difficult to manage if you needed to customize it to your specific needs. Luckily, RH5.2 comes with the sendmail that runs out-of-box (well, almost).
On my home system (default RH5.2 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 the same desk (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 your system--RH5.2 default DNS is cache-only.)
Lately, there has been lots of activity around sendmail (and also its competition-qmail) and a flood of improved, easier to configure versions, so hopefully newbies will soon get an a sendmail that (in its default configuration) does not do a DNS lookup if it can find the host in the file /etc/hosts.
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 unregistred, 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, 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 registred server) and thus bypasses your unregistred-home-network-based e-mail system. Another possibility is to specify the correct address in the "reply to" field of your KDE "mail client" setting. Same in pine, you can specify the reply-to address under "setup-configure", "customized-hdrs" something like:
Reply-to: joe@joe_net.net
where "joe@joe_net.net" is your good reply-to e-mail address.