Copyright (c) 1995, Joe DeRouen
All rights reserved                                                    


[This column originally appeared in the May 1995 edition of the
Dallas/Ft. Worth, Texas monthly Computer Currents Magazine] 


QUICK TIPS AND FIXES
by Joe DeRouen


If you're having a problem you just can't seem to solve, a question you
want answered, or just an inherent need to bend a lonely writer's ear,
you've come to the right place.  While we can't print all questions, we
do read them and will reply personally when the situation warrants it. 
Keep those cards and letters coming, folks.  


Q: Dear Joe,

   I recently bought a shell account on a local Internet provider.  I've
   had a ball playing MUDs and searching the World Wide Web with Lynx.
   I found a command called FINGER, which you can use to find out
   information on another user in the Internet. I fingered someone I'd
   seen in a newsgroup and I noticed that they had something called a
   "plan" which told all about them!  I asked how such a thing existed
   and he told me how to create the file .plan for use with FINGER.  I
   created the file, but no one can see it!  I haven't the slightest
   clue as to how to fix this.  My friend told me it involves
   permissions on files (which I know nothing about) but he was vague on
   just what exactly a file permission is.  Can you help me? 

   Sincerely,
   Alexandra Dupree
   via Internet                 


A: Dear Alexandra,

   Recently I've gotten several other questions similar to your own
   regarding file permissions for Internet accounts.  Yours was the most
   complicated, so naturally I chose it.  I like a challenge.  

   I'm going to go through the steps for making a plan file, for the
   readers out there that haven't quite got as far as you.  I'll explain
   the permissions afterwards. 

   Making a plan for your Internet account is vastly easier than
   following one in real life.  First, you need to create a file called
   ".plan".  (without the quotes, but with the period before the word)
   You can use Pico (a standard Internet text editor, which should be
   available to pretty much anyone who has a shell account) to create
   the file. 

    Try this command: pico ~/.plan

    Enter your plan (talk about yourself - that's what it's there for)
    and save it.

    You've finished step one.  You now have a plan file.  Unfortunately,
    as you found out, no one can read it.  You need to make your plan
    file accessible to the rest of the world. 

    Now, try these commands:  chmod 755 ~
                              chmod 644 ~/.plan

    The first command changes the permissions for your directory, making
    files in it readable (but not writable) by others.

    The second command changes the file permissions for your .plan to
    allow others to view it but not to change it or write over it.  If
    you're interested in finding out more about these commands, "man
    chmod" and "man pico" will probably work on your system.  This'll
    bring up a manual on (respectively) chmod and pico and tell you all
    you ever wanted to know about the editor and the chmod command, and
    then some. 

    I'll try to give a brief explanation of what you just did.  Notice
    the three digits after the chmod command above.  The first digit
    stands for the "owner" (ie: you) of the file.  The second digit
    stands for the "group" - who the file is owned by.  (Again, you)  The
    third digit stands for "world".  World is everyone but you. 

    In each slot after chmod (owner, group, world) you can have any
    number between 0 and 7.  These numbers are determined by adding up the
    allowable numbers for the file in question. 

    Here's a chart:

              0 - No permission
              1 - Execute permission
              2 - Write permission
              4 - Read permission

    You add the numbers to get various permissions.  A 3 gives you write
    (2) and execute (1).  A 5 gives you read (4) and execute (1).  6
    gives you read (4) and write (2).  The number 7 gives you everything.

    As you probably know, "ls" is the UNIX command to let you see what's
    in a particular directory.  Type "ls -lg" (the -lg is an argument
    standing for "long", which will get you a tad more information than
    the regular ls will)  You should see something like:

    drw--------  1 jderouen     shell  512 Jun 8 17:23 file

    The first bit towards the left, which is set to "d", is special. 
    This will generally only be a "-" (which means a normal file), a "d"
    (a directory) or a "l", which is a link. 

    The next nine fields are important.  The first three are for the
    user (in this case, "drw"), the second three are for the group, and
    the last three and for the world.  The first bit in each three
    groups stands for read (the "r"), the second bit write (the "w"),
    and the third bit (the "x") execute. 

    Looking at the permissions above, we would see that drw------- gives
    read and write permission to the owner.  (looking in the third field
    of the first entry, we can see that the owner is me)  

    If the entry said: drwxr-x--- this would mean that the entry is
    readable, writable, and executable by the owner as well as readable and  
    executable by the group.  (In this case, the group would be "shell", the
    fourth field above)

    If the entry said: drwxrwxr-- this would mean that the file is
    readable, writable, and executable by both the owner and the group
    and also readable by the entire world. 

    You can generally use any combination of these.  For safety reasons,
    however, it is wise to keep the owner permissions at read, write,
    and execute and to keep world permissions at only read. 

    How does all this translate into the chmod numbers?  Think of it
    this way: each of the three numbers represents each of the three
    fields for the owner, group, and world. 

    Thus, if you were to "chmod 700 file", you would get the following:
    drwx------.  This gives the owner full read, write, and execute
    permission, but the group also gets read and execute permission on
    the file. 

    If you were to "chmod 750 file", you would get drwxr-x--- which
    gives the owner all permissions, the group read and execute
    permissions, and the world none. 

    If you were to "chmod 755 file" you would get drwxr-xr-x which gives
    the owner all permissions while both the group and the world get
    read and execute permissions on the file in question. 

    This is all a bit confusing at first, but if you pay attention to
    the correlation between the three different "---" fields, as well as
    the numbers that put the bits in them, it isn't all that difficult. 

    The plan file notwithstanding, file permissions are a useful thing
    to understand and use.  It's an invaluable source for allowing
    access to certain files like your plan file in your directory while
    keeping others totally inaccessible and private. 

    Thanks for writing, Alexandra, and I'm glad I was able to help!



Q:  Joe,

    I have a 40Mhz 80386 system with a VGA monitor and a 14.4k modem. 
    I've recently started calling BBS's.  I can view ANSI just fine
    while on a BBS but I can't view programs that support ANSI (Sunlight
    Through The Shadows zine, for one) in DOS.  I don't understand
    what's wrong. 

    Thanks,

    Ed Smith
    Ft. Worth, Tx.


A:  Ed,

    Add the command DEVICE=C:\DOS\ANSI.SYS to your machine's CONFIG.SYS
    file.  If DOS isn't on drive C:, change the statment to reflect
    where DOS (and ANSI.SYS) actually is. 

    Voila!  Reboot and you now can view ANSI.  Thanks for writing in,
    and have fun on the boards! 


Are you having a problem with your computer?  Write to Joe at Computer
Currents, via Sunlight Through The Shadows BBS at 214/620-8793, on the
internet at jderouen@crl.com, or through CompuServe at 73654,1732.  Be
sure to stop in and check out Joe's new World Wide Web Home Page at 
http://www.crl.com/~jderouen/index.html while you're traversing the Web!

(c) 1995 Joe DeRouen.  All rights reserved.

