home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD1.iso / doc / FAQ / txt / BLFAQ < prev    next >
Encoding:
Text File  |  1998-10-14  |  17.2 KB  |  368 lines

  1. The Linux BLFAQ
  2. Neil Zanella <nzanella@ganymede.cs.mun.ca>
  3. v0.1.3.1, March 27 1998
  4.  
  5. Copyright Notice:
  6. --------------------------------------------------------------------------------
  7. Copyright (c) 1998 by Neil Zanella. This document may be distributed under the 
  8. terms set forth in the LDP license at
  9. <http://sunsite.unc.edu/LDP/COPYRIGHT.html>
  10.  
  11. Intro:
  12. --------------------------------------------------------------------------------
  13. Welcome to the Brief Linux FAQ (BLFAQ)!
  14.  
  15. This document contains a list of some frequently asked Linux questions and their
  16. answers. It is meant to provide general help to Linux users, especially newbies.
  17. I invite you to modify and add to this list but if you do so please be sure to 
  18. mail me a copy of the modified list so that I can include your changes in
  19. future releases.
  20.  
  21. FAQs:
  22. --------------------------------------------------------------------------------
  23. Q: I am trying to use the text based ftp program to download some stuff via 
  24.    anonymous ftp from an ftp site. I have never done this before and the ftp 
  25.    server doesn't seem to be letting me log in. Do I need a special username 
  26.    and password to do this?
  27.  
  28. A: No, anonymous ftp means that you log in with the username "anonymous"
  29.    without quotations and your full e-mail address as your password.
  30.    Some ftp sites will also accept the words "ftp" or "guest" instead of
  31.    the word "anonymous" as username.
  32.  
  33. --------------------------------------------------------------------------------
  34. Q: I plan to use the fips program to shrink a FAT32 partition (such
  35.    as one used by MS-Windows 95) and hence create space for my
  36.    Linux operating system. Can this be done?
  37.  
  38. A: Yes, but in order to do this you will need a version of fips at least as 
  39.    recent as fips15c. You can get the latest version of fips by anonymous ftp 
  40.    from bmrc.berkeley.edu in the directory /pub/linux/fat32
  41.  
  42. --------------------------------------------------------------------------------
  43. Q: I am trying to install Linux via CD-ROM. I have made space for Linux on my 
  44.    hard drive but inserting the Linux CD into the CD-ROM drive and rebooting 
  45.    has no effect.
  46.  
  47. A: You might have to tell your BIOS (Basic I/O System) to enable booting 
  48.    from CD-ROM by changing the default BIOS settings. On most systems you may
  49.    access the BIOS settings by pressing the <del> key on your keyboard shortly 
  50.    after rebooting.
  51.  
  52. --------------------------------------------------------------------------------
  53. Q: I have completed the installation process but upon reboot I get a LI
  54.    prompt or a bunch of zeros and ones.
  55.  
  56. A: If your machine is somewhat old and you have an IDE (or EIDE) hard drive then
  57.    you must install your root partition completely below cylinder 1023
  58.    which means below 512MB of disk space. On SCSI drives this means
  59.    your root partition must be contained within approximately one GB.
  60.    If your machine is fairly new and your BIOS supports it you may be able to
  61.    get around this problem by enabling LBA mode in the BIOS settings.
  62.  
  63. --------------------------------------------------------------------------------
  64. Q: My new video card is listed at <http://www.linux.org> as a card which the
  65.    X Window System supports under Linux but I cannot get it to work.
  66.  
  67. A: Make sure that you have the newest version of XFree86 and that you installed 
  68.    the right X Server. If all else fails you might want to try selecting the 
  69.    generic SVGA server as your X Server.
  70.  
  71. --------------------------------------------------------------------------------
  72. Q: I have successfully installed the X Window System and use the startx
  73.    command to run it from a text based virtual console. How can I have the X
  74.    Window System run at all times so that I don't have to use the startx 
  75.    command?
  76.  
  77. A: If you are running Red Hat then you can edit the file /etc/inittab on 
  78.    your system and replace the entry
  79.  
  80.    id:3:initdefault:
  81.  
  82.    with the entry
  83.  
  84.    id:5:initdefault:
  85.  
  86.    and reboot. 
  87.    On other systems you might have to change the number 5 (the runlevel) to 
  88.    another number like 4. How to choose the correct runlevel should be clear 
  89.    by reading the comments in the file /etc/inittab . Alternatively, you might 
  90.    have to change a link in /etc/rc[2345].d . Runlevels 2-5 don't have really 
  91.    strong conventions behind them like 0, 1, and 6 do. It depends on the 
  92.    distribution.
  93.  
  94. --------------------------------------------------------------------------------
  95. Q: When I use the X Window system and open multiple windows I find that my
  96.    screen size is insufficient. How can I use more virtual screen space?
  97.  
  98. A: Most window managers running under X Window have a built in feature known as
  99.    a pager which allows you to have more virtual screen space.
  100.  
  101. --------------------------------------------------------------------------------
  102. Q: I would like to have xdm run multiple local diplays on my system and switch 
  103.    back and forth by pressing <ctrl><alt><F*> where * is a number between 
  104.    1 and 12.
  105.  
  106. A: If you wanted to run 6 virtual consoles accessible by pressing the keys
  107.    <ctrl><alt><F7> through <ctrl><alt><F12> then you could put the following
  108.    entries in the file /usr/X11R6/lib/X11/xdm/Xservers
  109.  
  110.    :0 local /usr/X11R6/bin/X vt07 :0
  111.    :1 local /usr/X11R6/bin/X vt08 :1
  112.    :2 local /usr/X11R6/bin/X vt09 :2
  113.    :3 local /usr/X11R6/bin/X vt10 :3
  114.    :4 local /usr/X11R6/bin/X vt11 :4
  115.    :5 local /usr/X11R6/bin/X vt12 :5
  116.  
  117.    I would limit myself to only a few of these though as X seems to eat up
  118.    quite a lot of memory when multiple displays are running.
  119.  
  120. --------------------------------------------------------------------------------
  121. Q: I hate the sound of the bell. I would prefer to disable it perhaps enabling
  122.    the visual bell as an alternative.
  123.  
  124. A: If you are running X then you can simply type "xset -b" without quotation 
  125.    marks at the command prompt. Alternatively, if you are running the bash 
  126.    shell then you can add the command "xset -b 2> /dev/null" without quotation 
  127.    marks at the end of your .bash_profile file in your home directory to have 
  128.    the audible bell disabled each time you log in.
  129.    For more information see the Visual-Bell-mini-HOWTO at
  130.    <http://www.linux.org/>
  131.  
  132. --------------------------------------------------------------------------------
  133. Q: I have access to a remote unix machine that has some commercial software that
  134.    uses X which I would like to run remotely on my display. How do I do it?
  135.  
  136. A: First connect to the remote machine using dip or whatever you use. If the 
  137.    remote machine is called grasshopper.uvw.edu and your machine is called
  138.    kiwi.fruit.org then first type 
  139.  
  140.    xhost +grasshopper.uvw.edu
  141.  
  142.    from your own machine's shell prompt while running X. If you telnet to the
  143.    remote machine and you're using a modem to connect then your machine name
  144.    on the internet may be different from your actual machine name at home
  145.    so be sure to use the finger command on the remote machine with your remote 
  146.    username as an argument to find out what your machine name is on the 
  147.    internet. Assuming your machine name has not changed you must type 
  148.  
  149.    export DISPLAY=kiwi.fruit.org:0.0
  150.  
  151.    on the remote machine if it uses the Korn shell or the equivalent if it uses
  152.    another shell. You should be now ready to fire up the remote application 
  153.    from your machine.
  154.  
  155. --------------------------------------------------------------------------------
  156. Q: I have more than 64 MB of RAM but when I use the "free" command to check
  157.    the amount of available memory on my system only slightly less than 64MB 
  158.    show up. How do I get Linux to recognize the additional RAM?
  159.  
  160. A: Linux uses the BIOS to detect the amount of available RAM. At the present 
  161.    time there are two separate function calls available to do the job. Any 
  162.    version of Linux prior to 2.1.x uses the old call which is limited to 64M.
  163.    The newer call (used by 95/NT and Linux 2.1.x) can return more than 64M.
  164.    This problem should be fixed in the next stable release of the Linux kernel
  165.    (release 2.2.0). For now it is possible to have Linux detect all of your 
  166.    RAM by adding the line:
  167.  
  168.    append = "mem=128M"
  169.  
  170.    to the file /etc/lilo.conf if you use LILO or to the end of the respective
  171.    LOADLIN file if you use LOADLIN. This will enable 128MB of RAM, for example. 
  172.    You will need to rerun LILO for the changes to take effect. The next time you
  173.    boot up, Linux will see all of your memory.
  174.  
  175. --------------------------------------------------------------------------------
  176. Q: I have used the rm command to delete a file. Is it possible to undelete the
  177.    file and hence recover its contents?
  178.  
  179. A: In theory there is a way to undelete a file if you are using the ext2fs
  180.    file system (most common). In practice, it is rarely possible. To prevent
  181.    significant loss of data in this manner you must ensure that your system 
  182.    is backed up regularly. Alternatively if you had installed the program
  183.    midnight commander before deleting and compiled a version with undelf
  184.    then you could use cd undel:/dev/hda8 to see your deleted files (without 
  185.    names).  Alternatively, some users like to have a shell script that moves 
  186.    a file to a directory like /tmp each time it is removed or just before
  187.    it is overwritten. If you are really desparate, read the Ext2fs-Undeletion
  188.    mini-howto, which might work.
  189.  
  190. --------------------------------------------------------------------------------
  191. Q: I am trying to run a script file named script or test but I am getting some
  192.    unexpected results.
  193.  
  194. A: The names script and test are names of executable prgrams on your system so
  195.    you should not use them for your own executables. If you got unexpected 
  196.    it's because the system binaries got to be executed before your own binaries.
  197.  
  198. --------------------------------------------------------------------------------
  199. Q: I removed Linux from my system, but now DOS won't boot because LILO is still 
  200.    there. How do I remove LILO?
  201.  
  202. A: If you have a version of DOS at least as recent as DOS 5.0 then you can 
  203.    insert your DOS boot diskette and boot from it. At the DOS prompt, type
  204.  
  205.    fdisk /mbr
  206.  
  207.    to remove LILO from the Master Boot Record (MBR).
  208.  
  209. --------------------------------------------------------------------------------
  210. Q: I want to add '.' to root's PATH, to allow me to not have to put ./ in
  211.    front of every local command I type. But I hear this is a bad thing. Why?
  212.  
  213. A: Adding '.' to root's PATH would be a security risk. Imagine the case where a 
  214.    malicious user creates a file called /tmp/ls containing a command sequence 
  215.    such as
  216.  
  217.    # Caution: This script removes everything from the Linux filesystem.
  218.    cat /tmp/ls
  219.    rm -Rf /
  220.  
  221.    and you as root wander into temp and want to see what files are there. If
  222.    the . occurs in root's path before /bin then typing ls at the shell prompt
  223.    will execute the malicious command instead. Alternatively, the malicious
  224.    command could be named mroe, ls-l, caat, lss, or similar in which case a
  225.    typo on root's behalf would cause it to be executed even if . is the last 
  226.    entry in root's path. Finally, the mailicious command may be set to copy 
  227.    /bin/bash to a hidden spot and change permissions of the copy to 
  228.    suid ( -rws---r-x ) so that anyone executing the hidden copy would have 
  229.    root permissions.
  230.  
  231. --------------------------------------------------------------------------------
  232. Q: I can't execute my script/program. I can list the file with ls -l and
  233.    it is there with the correct permissions:
  234.  
  235.    ls -l mumble
  236.    -rwxrw-r--   1 me      user          104 Feb 14 15:46 mumble
  237.  
  238.    but when I type mumble at the command prompt I get the reponse:
  239.  
  240.    bash: mumble: command not found
  241.  
  242. A: Most probably the current directory (CWD) is not in your path. The best
  243.    thing to do in such situations is probably to type the full path to the
  244.    script/program followed by the name of the script/program .
  245.    If you are work in a directory that you alone use and which is not shared
  246.    then you might want to take the risk of editing your PATH variable to
  247.    contain CWD. Alternatively you could keep all your executables in a directory
  248.    called ~/bin and put it in your path. You can look at your path by typing
  249.    echo $PATH at the shell prompt.
  250.  
  251.    echo $PATH
  252.    /usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/me/bin
  253.  
  254. --------------------------------------------------------------------------------
  255. Q: Why can't I telnet or rsh in to my Linux system as Root?
  256.  
  257. A: This is a security feature meant to protect you. Malicious users must
  258.    know a valid user password, as well as the root password in order to
  259.    get in to the system and do anything as root. Log in as a user, and
  260.    use the su command to then become root. Better still is to use the ssh
  261.    command (if installed) which encrypts your session to prevent anyone
  262.    from seeing the root password.
  263.    If your network is totally local (you have only a terminal connected
  264.    to a serial port), you can edit /etc/securetty to add that port as one
  265.    considered secure enough for root to log in.
  266.  
  267. --------------------------------------------------------------------------------
  268. Q: Why can't I ftp as root?
  269.  
  270. A: This is a security feature meant to protect you. No user listed in
  271.    /etc/ftpuser is allowed to use ftp. Always ftp as a regular user.
  272.  
  273. --------------------------------------------------------------------------------
  274. Q: I've tried to create a shell script and made it setuid root so the users
  275.    can execute it. But no matter what I do, it doesn't execute with root
  276.    privliage. Why?
  277.  
  278. A: Shell scripts are a notorious security hole. To protect you, the kernel
  279.    purposely ignores setuid and setgid in scripts. Create a C or Pearl
  280.    program to do the task.
  281.  
  282. --------------------------------------------------------------------------------
  283. Q: Why should I create ordinary user accounts. I'm the only user on this
  284.    machine. Why not just work as root?
  285.  
  286. A: Root, commonly called the super-user, is for system administration tasks
  287.    only. The normal protection mechanisms are eliminated for this account
  288.    (indeed for any user with UID or GID equal to 0). So if you make any
  289.    little mistake (for example the classic "rm  * myfile" -- note the
  290.    space between the wild-card and myfile) the system will do _exactly_
  291.    what you told it to do, not what you meant it to do. In the classic mistake 
  292.    above, the system will remove all files in the current directory, then 
  293.    complain because it can't remove 'myfile' which doesn't exist.
  294.  
  295. --------------------------------------------------------------------------------
  296. Q: I am able to establish a dial up connection but when I use telnet to
  297.    connect to remote hosts telnet understands IP address but not host names.
  298.    What can I do to have telnet and other programs understand host names?
  299.  
  300. A: You should be able to get rid of this problem by adding an entry for a
  301.    name server in the file /etc/resolv.conf . If you have more than one name
  302.    server then you should put your primary dns first as nameserver entries 
  303.    get read from top to bottom. The 'search' or 'domain' line should have 
  304.    your isp's domain name. Your /etc/resolv.conf should look something like:
  305.  
  306.    search virtual-impact.com
  307.    domain virtual-impact.com
  308.    nameserver 205.162.94.51
  309.    nameserver 205.162.88.33
  310.    nameserver 134.153.2.90
  311.  
  312. --------------------------------------------------------------------------------
  313. Q: I don't like having to type the full hostname when using telnet. 
  314.    How can I resolve this problem?
  315.  
  316. A: Edit the file /etc/hosts and add entries like the following:
  317.  
  318.    127.0.0.1       localhost       localhost.localdomain
  319.    134.153.1.200   riemann         riemann.math.mun.ca
  320.    134.153.39.1    ganymede        ganymede.cs.mun.ca
  321.    134.153.1.1     garfield        garfield.cs.mun.ca
  322.    134.153.2.151   plato           plato.ucs.mun.ca
  323.    129.128.88.12   vega            vega.math.ualberta.ca
  324.  
  325. --------------------------------------------------------------------------------
  326. Q: I am logged into a host. I would like to find out its IP address
  327.    and a few other ones. How can I do this?
  328.    
  329. A: You could use the hosts command as follows:
  330.    
  331.    ganymede $ host ganymede.cs.mun.ca
  332.    ganymede.cs.mun.ca has address 134.153.39.1
  333.    ganymede.cs.mun.ca mail is handled (pri=5) by garfield.cs.mun.ca
  334.    ganymede $
  335.  
  336.    The programs nslookup and /sbin/ifconfig can also be used for this
  337.    purpose.
  338.  
  339. --------------------------------------------------------------------------------
  340. Q: How can I have the "useradd" or "adduser" command automatically place some
  341.    default files in a user's directory when that user is added to the system?
  342.  
  343. A: Edit the contents of the files located under /etc/skel to suit your needs.
  344.    These files will be added to a user's home directory each time that user
  345.    is added.
  346.  
  347. --------------------------------------------------------------------------------
  348. Q: I have read the Brief Linux FAQ (BLFAQ) but could not find what I was
  349.    looking for. Where else should I look?
  350.  
  351. A: Other places include links under <http://www.linux.org> including the Linux
  352.    FAQ (LFAQ) and the various HOWTOs and mini-HOWTOs. Other sites of interest
  353.    might include <http://www.xfree86.org> for X related things and i
  354.    ftp://sunsite.unc.edu if you're looking for interesting applications to run
  355.    under Linux.
  356.  
  357. --------------------------------------------------------------------------------
  358.  
  359. Hope this helps,
  360.  
  361. --
  362. maintained by: Neil Zanella
  363. e-mail: nzanella@ganymede.cs.mun.ca
  364. comp.os.linux.answers . I have included it below:
  365.  
  366. Neil Zanella
  367. nzanella@ganymede.cs.mun.ca
  368.