[LWN Logo]

From: Neil Zanella <nzanella@cs.mun.ca>
Subject: BLFAQ: Brief Linux FAQ with answers
Date: Fri, 13 Mar 1998 12:25:38 -0330

Copyright Notice:
--------------------------------------------------------------------------------
Copyright (c) 1998 by Neil Zanella. This document may be distributed under the 
terms set forth in the LDP license at http://sunsite.unc.edu/LDP/COPYRIGHT.html

Intro:
--------------------------------------------------------------------------------
Welcome to the Brief Linux FAQ (BLFAQ)!

Here is a brief list of some frequently asked Linux questions with their 
answers. I hope that these will be of some help to Linux users, especially to 
newbies. Also, I invite you to modify and add to this list anything that you 
might think would be helpful to Linux users in general. If you modify this list 
please be sure to mail me a copy of the modified list so that I can include 
your changes in future postings.

FAQs:
--------------------------------------------------------------------------------
Q: I am trying to use the text based ftp program to download some stuff via 
   anonymous ftp from an ftp site. I have never done this before and the ftp 
   server doesn't seem to be letting me log in. Do I need a special username 
   and password to do this?

A: No, anonymous ftp means that you log in with the username "anonymous"
   without quotations and your full e-mail address as your password.
   Some ftp sites will also accept the words "ftp" or "guest" instead of
   the word "anonymous" as username.

--------------------------------------------------------------------------------
Q: I plan to use the fips program to shrink a FAT32 partition (such
   as one devoted to MS-Windows 95) and hence create space for my
   Linux operating system. Can this be done?

A: Yes, but in order to do this you will need a version of fips
   at least as up to date as fips15c. You can get the latest
   version of fips by anonymous ftp from bmrc.berkeley.edu
   in the directory /pub/linux/fat32

--------------------------------------------------------------------------------
Q: I am trying to install Linux via CD-ROM. I have made space for Linux on my 
   hard drive but inserting the Linux CD into the CD-ROM drive and rebooting 
   has no effect.

A: You might have to tell your BIOS (Basic I/O System) to enable booting 
   from CD-ROM by changing the default BIOS settings. On most systems you may
   access the BIOS settings by pressing the <del> key on your keyboard shortly 
   after rebooting.

--------------------------------------------------------------------------------
Q: I have completed the installation process but upon reboot I get a LI
   prompt or a bunch of zeros and ones.

A: If your machine is old and you have an IDE (or EIDE) hard drive then
   you must install your root partition completely below cylinder 1023
   which means below 512MB of disk space. On SCSI drives this means
   your root partition must be contained within approximately one GB.
   If your machine is fairly new and your BIOS supports it you may get 
   around this problem by enabling LBA mode.

--------------------------------------------------------------------------------
Q: My new video card is listed at http://www.linux.org as a card which the
   X Window System supports under Linux but I cannot get it to work.

A: Make sure that you have the newest version of XFree86 and that you installed 
   the right X Server. If all else fails you might want to try selecting the 
   generic SVGA server as your X Server.

--------------------------------------------------------------------------------
Q: I have successfully installed the X Window System and use the startx
   command to run it from a text based virtual console. How can I have the X
   Window System run at all times so that I don't have to use the startx 
   command?

A: If you are running Red Hat then you can edit the file /etc/inittab on 
   your system and replace the entry

   id:3:initdefault:
 
   with the entry
 
   id:5:initdefault:

   and reboot.
   On other systems you might have to change the number 5 (the runlevel) to
   another number like 4. Which number should be clear by reading the comments 
   in the file /etc/inittab . Alternatively, yo might have to change a link
   in /etc/rc[2345].d . Runlevels 2-5 don't have really strong conventions 
   behind them like 0, 1, and 6 do. It depends on the distribution.

--------------------------------------------------------------------------------
Q: When I use the X Window system and open multiple windows I find that my
   screen size is insufficient. How can I use more virtual screen space?

A: Most window managers running under X Window have a built in feature known as
   a pager which allows you to obtain more virtual screen space.

--------------------------------------------------------------------------------
Q: I would like to have xdm run multiple local diplays on my system and switch 
   back and forth by pressing <ctrl><alt><F*> where * is a number between 
   1 and 12.

A: If you wanted to run 6 virtual consoles accessible by pressing the keys
   <ctrl><alt><F7> through <ctrl><alt><F12> then you could put the following
   entries in the file /usr/X11R6/lib/X11/xdm/Xservers

:0 local /usr/X11R6/bin/X vt07 :0
:1 local /usr/X11R6/bin/X vt08 :1
:2 local /usr/X11R6/bin/X vt09 :2
:3 local /usr/X11R6/bin/X vt10 :3
:4 local /usr/X11R6/bin/X vt11 :4
:5 local /usr/X11R6/bin/X vt12 :5

--------------------------------------------------------------------------------
Q: I hate the sound of the bell. I would prefer to disable it perhaps enabling
   the visual bell as an alternative.

A: If you are running X then you can simply type
   xset -b 
   at the command prompt. For more information see the Visual-Bell-mini-HOWTO
   at http://www.linux.org/

--------------------------------------------------------------------------------
Q: I have access to a unix machine that has some commercial software that
   uses X which I would like to run remotely on my display. How do I do it?

A: First connect using dip or whatever you use. If the machine is called
   foo.bar.edu you can type xhost +foo.bar.edu
   from your own machine's shell prompt. Once you're there if your machine
   is called kiwi.remote.net then you must export the display on
   foo.bar.edu
   with a command like export DISPLAY=kiwi.remote.net:0.0 or 
   set DISPLAY=kiwi.remote.net:0.0 . You should be now ready to run the 
   remote application from your own machine.

--------------------------------------------------------------------------------
Q: I have more than 64 MB of RAM, so, how do I get Linux to recognize the
   additional RAM?

A: Linux uses a BIOS function call to detect the amount of available RAM.
   At the present time the BIOS call reports a maxmium of 64 MB. If you have a
   stable version of the Linux kernel prior to 2.2.x then you can get Linux
   to detect all of the RAM by adding the line:

A: Linux uses the BIOS to detect the amount of available RAM. At the present 
   time there are two separate function calls available to do the job. Any 
   version of Linux prior to 2.1.x uses the old call which is limited to 64M.
   The newer call (used by 95/NT and Linux 2.1.x) can return more than 64M.
   This problem should be fixed in the next stable release of the Linux kernel
   (release 2.2.0). For now it is possible to get Linux to detect all of the 
   RAM by adding the line:

   append = "mem=128M"

   to the file /etc/lilo.conf if you use LILO or to the end of the LOADLIN
   if you use LOADLIN. This will enable 128MB of RAM for example. 
   You will need to rerun LILO for the changes to take effect. The next time you
   boot up, Linux will see all of your memory.

   Any stable version of Linux at least as new as 2.1.x fixes this having to
   do this by having the BIOS do multiple fuc\nction calls.

--------------------------------------------------------------------------------
Q: I have used the rm command to delete a file. Is it possible to undelete the
   file and hence recover its contents?

A: No, you cannot undelete a file under Linux. Once you remove a file its 
   contents are permanently expunged from the hard drive. To prevent significant
   loss of data in this manner you must ensure that your system is backed up 
   regularly. Also, some users like to have a shell script that moves a file
   to a directory like /tmp each time it is removed or just before it is 
   overwritten.

--------------------------------------------------------------------------------
Q: I am trying to run a script file named script or test but I am getting some
   unexpected results.

A: The names script and test are names of executable prgrams on your system so
   you should not use them for your own executables. If you got unexpected 
   it's because the system binaries got to be executed before your own binaries.

----------------------------------------------------------------------------------
Q: I can't execute my script/program. I can list the file with ls -l and
   it is there with the correct permissions:

   ls -l mumble
   -rwxrw-r--   1 me      user          104 Feb 14 15:46 mumble

   but when I type mumble, I get

   mumble
   bash: mumble: command not found

A: The current directory is not in your path. Either type the command followed by 
   the full path to the file as in 

   ./mumble 

    or

   /home/your-username-here/mumble

   or edit your PATH variable to contain . or the full path to your file.
   You can look at your path by typing echo $PATH at the shell prompt.
   
   echo $PATH
   /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/me/bin

--------------------------------------------------------------------------------
Q: I removed Linux from my system, but now DOS won't boot because LILO is still 
   there. How do I remove LILO?

A: If you have a version of DOS at least as recent as DOS 5.0 then you can 
   insert your DOS boot diskette and boot from it. At the DOS prompt, type

   fdisk /mbr

   to remove LILO from the Master Boot Record (MBR).

--------------------------------------------------------------------------------
Q: I want to add '.' to roots PATH, to allow me to not have to put ./ in
   front of every local command I type. But I hear this is a bad thing. Why?

A: Adding '.' to root's PATH would be a security risk. Imagine the case where a 
   malicious user creates a file called /tmp/ls containing a command sequence 
   such as

   # Caution: This script removes everything from the Linux filesystem.
   cat /tmp/ls
   rm -Rf /

   and you as root wander into temp and want to see what files are there. If
   the . occurs in root's path before /bin then typing ls at the shell prompt
   will execute the malicious command instead. Alternatively, the malicious
   command could be named mroe, ls-l, caat, lss, or similar in which case a
   typo on root's behalf would cause itt to be executed even if . is the last 
   entry in root's path. Finally, the mailicious command may be set to copy 
   /bin/bash to a hidden spot and change permissions of the copy to 
   suid ( -rws---r-x ) so that anyone executing the hidden copy would have 
   root permissions.

--------------------------------------------------------------------------------
Q: I accidently deleted a file. How do I undelete it?

A: In theory there is a way to undelete a file if you are using the ext2fs
   file system (most common). In practice, it is rarely possible. Sorry.
   If you are really desparate, read the Ext2fs-Undeletion mini-howto,
   which might work.

--------------------------------------------------------------------------------
Q: Why can't I telnet or rsh in to my Linux system as Root?

A: This is a security feature meant to protect you. Malicious users must
   know a valid user password, as well as the root password in order to
   get in to the system and do anything as root. Log in as a user, and
   use the su command to then become root. Better still is to use the ssh
   command (if installed) which encrypts your session to prevent anyone
   from seeing the root password.
   If your network is totally local (you have only a terminal connected
   to a serial port), you can edit /etc/securetty to add that port as one
   considered secure enough for root to log in.

--------------------------------------------------------------------------------
Q: Why can't I ftp as root?

A: This is a security feature meant to protect you. No user listed in
   /etc/ftpuser is allowed to use ftp. Always ftp as a regular user.

--------------------------------------------------------------------------------
Q: I've tried to create a shell script and made it setuid root so the users
   can execute it. But no matter what I do, it doesn't execute with root
   privliage. Why?

A: Shell scripts are a notorious security hole. To protect you, the kernel
   purposely ignores setuid and setgid in scripts. Create a C or Pearl
   program to do the task.

--------------------------------------------------------------------------------
Q: Why should I create ordinary user accounts. I'm the only user on this
   machine. Why not just work as root?

A: Root, commonly called the super-user, is for system administration tasks
   only. The normal protection mechanisms are eliminated for this account
   (indeed for any user with UID or GID equal to 0). So if you make any
   little mistake (for example the classic "rm  * myfile" -- note the
   space between the wild-card and myfile) the system will do _exactly_
   what you told it to do, not what you meant it to do. In the classic mistake 
   above, the system will remove all files in the current directory, then 
   complain because it can't remove 'myfile' which doesn't exist.

--------------------------------------------------------------------------------
Q: I have read the Brielf Linux FAQ (BLFAQ) but could not find what I was
   looking for. Where else should I look?

A: Other places include links under http://www.linux.org including the Linux
   FAQ (LFAQ) and the various HOWTOs and mini-HOWTOs.


Hope this helps,

--
maintained by: Neil Zanella
mail: nzanella@ganymede.cs.mun.ca