home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / network / telnetd.zip / DOC next >
Text File  |  1991-11-13  |  21KB  |  408 lines

  1.  
  2.                         The WATTCP TELNET Server
  3.  
  4.                             by Erick Engelke
  5.  
  6.  
  7. This program effectively allows you to remotely control your pc.  There
  8. is always work in place to improve TELNETD, work which is based on the
  9. large amount of positive feedback from users like you.  I post to
  10. comp.protocols.tcp-ip.ibmpc whenever I make significant changes
  11. or improvements to this program.
  12.  
  13. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  14. WARNING - TELNETD offers some simple password security provisions but remember:
  15.            1. TELNETD gets the password from an unencrypted disk file
  16.            2. TELNETD stores the password in memory as plain-text
  17.            3. All TELNET protocols send the password over the network in
  18.               plaintext - it's trivial to read a password on networks such
  19.               as Ethernet.
  20.  
  21.           The password protection is merely one step above no protection.
  22.           Do not leave important information accessible through TELNETD.
  23.           Change your password frequently and use mixed case and numbers
  24.           interspersed.  Avoid single words, use combinations of words.
  25.           Do not use the same password for TELNETD as you would for your
  26.           system priviledged account.  The maximum password length is
  27.           16 letters.
  28. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  29.  
  30. Installation
  31.  
  32.         TELNETD.EXE uses the Waterloo TCP kernal to do all the network i/o.
  33.         Installing the program can be performed by simply editing the ASCII
  34.         configuration file named WATTCP.CFG.  Try creating such a file with
  35.         information like the following and place it in the *SAME* subdirectory
  36.         as TELNETD.EXE.
  37.  
  38.         ---I:\NETWORK\WATTCP.CFG----------------------------------------------
  39.             my_ip=129.97.128.254            # substitute the PC's ip number
  40.             netmask=255.255.254.0           # substitute your local net mask
  41.             gateway=129.97.128.1            # substitute your local gateway
  42.                 # the next lines are optional
  43.             telnetd.password=Time2Go        # telnetd session password
  44.             telnetd.message="Wizbang Computer Network"  # openning message
  45.         ----------------------------------------------------------------------
  46.  
  47.         You need not include quotes except if you wish to include
  48.         non-alphanumeric characters like '#',';' or spaces.
  49.  
  50.         Full installation instructions for installing any Waterloo TCP
  51.         based program is available from sunee.uwaterloo.ca [129.97.128.196]
  52.         in pub/wattcp/apps.zip.  If you end up having difficulty running
  53.         TELNETD, download that zip file, it will prove very useful.  Also
  54.         included in that file is information on how to use BOOTP, multiple
  55.         gateways, and many other features.
  56.  
  57.         The above type of configuration is useful in all WATTCP based programs,
  58.         but you can also add some special parameters which will only be
  59.         interpretted by specific WATTCP programs.  In this case all parameters
  60.         specific to TELNETD are prepended with 'telnetd.' to make them
  61.         easily identifiable and to avoid naming conflicts with other WATTCP
  62.         applications.
  63.  
  64.         Load (and configure) an Ethernet packet driver, then run TELNETD.
  65.  
  66.         A message will appear indicating TELNETD is waiting for a caller and
  67.         it should report the correct IP address.  An indication of a password
  68.         should appear for every time it encounterred a password in the
  69.         configuration process.  If no packet driver is installed TELNETD will
  70.         have crashed by now.
  71.  
  72. Installing TELNETD on a Network
  73.         Do everything the same as above, but append the following line to
  74.         the WATTCP.CFG file:
  75.  
  76.         include=?c:\telnetd.pas
  77.  
  78.         and have user's place their private password in that file.  Eg.
  79.  
  80.         ---C:\TELNETD.PAS-----------------------------------------------------
  81.         # joe's private config parameters
  82.         telnetd.message="Joe's Private Computer - KEEP OUT ALL SURF NAZIS"
  83.         telnetd.password=Knuths4thBook
  84.         ----------------------------------------------------------------------
  85.  
  86.         In the above example I assumed the 'c' disk was the local hard disk.
  87.         You could select the network disk or both.  Here the network disk n:
  88.         has the last say on the password.  The telnetd.password directive can
  89.         appear several times and in several files, but the last occurance
  90.         is the password actually used.
  91.  
  92.         include=?c:\telnetd.pas
  93.         include=?n:\telnetd.pas
  94.  
  95.         The question mark tells TELNETD to use the file if it exists but not
  96.         complain if it doesn't.  You may like to leave a default password in
  97.         the WATTCP.CFG file, just so intruders are less likely to break in.
  98.  
  99.         There are some other parameters which are sometimes good to set.
  100.         One which can enhance security is the inactivity timeout.  Setting
  101.         this value to a non-zero value tells WATTCP to hang up the connection
  102.         if no activity occurs for a certain period of time.  A good value
  103.         would be something like twenty minutes.  Smaller values can be
  104.  
  105.  
  106.         -- WATTCP.CFG --------------------------------------------------------
  107.         # assuming properly configured as described earlier
  108.  
  109.         # print a message for local user
  110.         print="Press control-break to get out of this thing"
  111.  
  112.         # set the inactivity timeout value
  113.         inactive=1200   # 20 minutes ( 20 min x 60 sec/min = 1200 seconds )
  114.         ----------------------------------------------------------------------
  115.  
  116.  
  117. Using TELNETD
  118.         Go to a second PC.  Using Clarkson University (CUTCP) TELNET, telnet
  119.         to the first PC.  You could use NOS (KA9Q), but I don't think NOS
  120.         handles VT100 cursor keys and you will definately want them!
  121.         Other tested telnets include MicroVaxen, RS/6000 using AIX and
  122.         Macintoshes using MACTCP
  123.  
  124.         When you TELNET to TELNETD, you may have to hit return.  It's one
  125.         of those things left to fix.  Sorry, but it's getting too late
  126.         tonight.  You will then be confronted with a login message (from the
  127.         wattcp.cfg file) and a password prompt (if you selected a password in
  128.         the configuration file - otherwise skip this paragraph).  You must
  129.         enter the password correctly within a reasonable number of tries or
  130.         TELNETD will complain and close the session.  You must also reply
  131.         within a reasonable time limit.
  132.  
  133.         The passwords can be almost any printable ascii string up to 16
  134.         letters.  If you use characters other than alpha-numerics, you
  135.         should surround the password with quotes in the WATTCP.CFG file.
  136.         WATTCP removes the quotes when it parses the file, so you don't
  137.         enter the quotes when you enter the password at the prompt.
  138.  
  139.         Assuming you passed the password test, TELNETD becomes a TSR and almost
  140.         immediately you will be at the DOS prompt.  You are now logged in.
  141.  
  142.         Anything you type on the remote PC will appear to be typed on the
  143.         TELNETD PC.  QEDIT, LIST.COM, BORLAND C++, and many other programs
  144.         are compatible (check out the character translation).  There will be
  145.         slight periodic delays.  Using a 386 to run TELNETD will improve
  146.         your performance.  If the screen appears to be messed up or incomplete,
  147.         you can have TELNETD redraw it by typing ESC R on the keyboard.
  148.  
  149.         This usually happens from either a lost packet or contention on
  150.         the network card if you are using the same card for network disk i/o.
  151.         For example, if I am compiling then TELNETD can find very few
  152.         cracks in the network i/o because my computer is diskless.  But most
  153.         operations are not so incredibly disk intensive and it feels quite
  154.         reasonable.
  155.  
  156.         Remember that the remote PC is running VT 100 emulation and some
  157.         keystrokes have to be remapped.  I have written support for
  158.         VT100 and VT220 terminals, but not everything has been
  159.         tested yet.
  160.  
  161.         a-z, A-Z, 0-9 function normally.
  162.         cursor arrows function normally
  163.         To enter CONTROL-CHARACTER, eg. ^A,     press ESC C A
  164.         To enter ALT-CHARACTER,     eg. ALT A,  press ESC A A
  165.         To enter SHIFT-Something    eg. SHFT <- press ESC S <-
  166.         To enter function keys      eg.  F9     press ESC F 9
  167.         To enter ESCape                         press ESC E
  168.  
  169.  **     To exit (logoff and reboot)             press ESC X
  170.  **     To redraw the screen (clean up mess)    press ESC R
  171.  
  172.  **     To get online help press ESC H, the next keypress removes the
  173.         help screen.
  174.  
  175.         There are some extra VT100 and VT220 keystrokes available.  The
  176.         VT220 user can usually use both VT100 and VT220 keystrokes.
  177.  
  178.         PC      VT100           VT220
  179.  
  180.                 ESC H           HELP            get online help
  181.         ESC     ESC E           F11
  182.         BCKSPC  BS              F12             vt100 not confirmed
  183.  
  184.         INS                     Insert
  185.         DEL                     Remove
  186.         END                     pf4
  187.         DOWN    down arrow      down arrow
  188.         PgDn                    Next Screen
  189.         LEFT    left arrow      left arrow
  190.         5                       Select
  191.         RIGHT   right arrow     right arrow
  192.         HOME                    pf3
  193.         UP      up arrow        up arrow
  194.         PgUp                    Prev Screen
  195.  
  196.         F1       ESC F 1        1 on numeric keypad
  197.         ...                     ...
  198.         F9       ESC F 9        9 on numeric keypad
  199.         F10      ESC F 0        0 on numeric keypad
  200.         F11                     pf1
  201.         F12                     pf2
  202.  
  203. Notes on Using TELNETD
  204.         When you don't know how to do something, try the online help (ESC H).
  205.  
  206.         Many other keystrokes are built out of combinations, for example,
  207.         Shift F7 is attained by typing 'ESC S ESC F 7'.  Sorry, but that's
  208.         the way it is right now.
  209.  
  210.         Kermit users may wish to write a kermit script to remap the keyboard
  211.         and provide really nice emulation.  If you do it, please send me
  212.         a copy too.
  213.  
  214.         Once connected, TELNETD does some neat things.  It automatically
  215.         compensates for slow data lines.  Here's how I call in from home:
  216.  
  217.  PC <-- 10 Mbps <-- PCRoute <-- Ethernet <-- Telnet <-- Modem <-- phone <-- home
  218.       Token Ring                             Server                          PC
  219.  
  220.   \______________________________________________/        \__________________/
  221.                  high speed media                              1200 baud
  222.  
  223.         TELNETD attempts to use your network card during the timer tick.
  224.         The packet driver or network card may be in use and report a
  225.         transmission error.  No problem,  TELNETD will retry a little later
  226.         and eventually get through, but that explains the bumpiness you may
  227.         notice during network disk operations.
  228.  
  229.         If you've had a high count of network errors, the tcp/ip portion of
  230.         TELNETD will take a couple of packets to recompute the correct
  231.         response time.  Enterring a few keystrokes or using ESC R to redraw
  232.         the screen will generate the necessary traffic to restablize the
  233.         the round trip time.
  234.  
  235.         Although very rare, you may notice a little garbage on the screen.
  236.         This is usually something to do with ANSI escape sequences.  The
  237.         quick solution is to redraw the screen with ESC R.  If you see these
  238.         with any frequency, please let me know.
  239.  
  240.         When you wish to end your TELNETD session, either have your local
  241.         TELNET program close the session or use 'ESC X' which will tell TELNETD
  242.         to close the session.  Simply rebooting the TELNETD machine or the
  243.         TELNET machine is bad since the other machine will keep trying to
  244.         communicate and will annoy your network manager.
  245.  
  246. Limitations:
  247.         I *DID* mention that this is not perfected.  Here are the
  248.         current problems that come to mind:
  249.  
  250.         1. screen updates are sporatic - hey, don't be picky - but they
  251.            are getting much better
  252.         2. You cannot run other TCP/IP programs.  This is a limitation
  253.            of the packet driver combined with the fact that no other
  254.            programs use TELNETD as their TCP/IP kernel.
  255.         3. VT100's don't have a way to do *all* the cursor keys, well
  256.            I just haven't come up with keystrokes for all of them.
  257.            If you have some good ideas, send me a list.
  258.         4. TELNETD may show update delays because of network card contention.
  259.            Basically, if you are using your network card for something like
  260.            NOVELL file service, TELNETD won't know that and will attempt to
  261.            use the card at the same time which may cause delays.  My computer
  262.            is diskless too, but it doesn't feel that bad.
  263.         5. Screen blankers may cause problems and should not be installed.
  264.            I find this to be a general truth though I know everyone
  265.            has found one which works with (almost) every other program.
  266.  
  267.         Notes:
  268.         1. When you logoff or reset your connection or it timesout from
  269.            inactivity (if past the password prompt) I reboot the machine.
  270.            This way your autoexec can set it up for the next call and
  271.            sensitive network accounts can be managed more gracefull.
  272.         2. TELNETD automatically adjusts itself to work efficiently with
  273.            low performance and low bandwidth networks.
  274.  
  275. How Does It Work?
  276.         TELNETD passively watches the local screen and actively changes the
  277.         keyboard buffer.  In essence, it performs whatever is necessary to
  278.         share the computer with a remote session, and attempts to consume
  279.         as little processor time as possible doing so.
  280.  
  281.         TELNETD chains into the timer tick, meaning it gets a little bit
  282.         of processing time every time the computer's clock ticks.  That
  283.         works out to about 18 times per second.  It is pretty careful with
  284.         precious computer time, so it never sits in any form of idle loop.
  285.         You should not experience a significant processor slow down while
  286.         running TELNETD unless you are working on an 8088.
  287.  
  288.         During that time slice TELNETD checks to see how much data the remote
  289.         computer has accepted from previous screen updates.  If there is still
  290.         lots of unaccepted data, the remote computer is probably relatively
  291.         far away and TELNETD doesn't bother sending updates as often.  This
  292.         results in jerkier screen updates, but it reduces the load on the
  293.         intermediate networks.  If the last update is largely complete,
  294.         TELNET completes the following steps to do the next update.
  295.  
  296.         The update process works by comparing the screen memory against a
  297.         local buffer.  Differences are locallized to a particular screen
  298.         line and the first and last changed character on that line.  Eg.
  299.         line 12, characters 23 to 36.  The data is massaged, turning PC
  300.         graphic characters into ASCII characters and converting long
  301.         sequences of spaces into faster escape codes such as
  302.         clear-to-end-of-line.
  303.  
  304.         Typically an escape sequence is sent saying, goto line 12,
  305.         character 23, and then 13 ASCII characters are then transmitted.
  306.  
  307.         Special optimizations are made to try to reduce the number of
  308.         lines sent by checking for scrolled screens.  If the screen appears
  309.         scrolled, TELNETD sends commands to scroll the remote screen.
  310.  
  311.         TELNETD transmits chuncks of information until a certain number of
  312.         lines appear in transit, currently that value is 12 lines, or up to
  313.         approximately one kilobyte.  Then the remote cursor is positioned at
  314.         the correct screen location.
  315.  
  316.         In all its screen updates, TELNETD must constantly deal with the
  317.         fact that the remote computer can only display 24 lines as compared
  318.         to the 25 lines on the local screen.  It attempts to handle this
  319.         by only looking at the 24 lines containing the cursor, ie. if the
  320.         cursor is on the upper-half of the screen, TELNETD shows the first
  321.         24 lines, otherwise the last 24 lines.  Again, it uses the VT100
  322.         scrolling sequences to toggle between the two efficiently.
  323.  
  324.         TELNETD relies on the fact users get confused by frequent screen
  325.         updates, thus most applications do not change a significant portion
  326.         of the screen very frequently.  The common exception is editors
  327.         and word processors which tend to update the current line and
  328.         status lines with every key pressed.
  329.  
  330.         TELNETD must also read characters from the network.  It builds them
  331.         into a string in local memory and compares that string agains known
  332.         keystrokes.  If a match could exist, ie. you typed ESC A but not the
  333.         third letter, TELNETD does not do anything with the data until the
  334.         next letter is received.
  335.  
  336.         When a simple keystroke arrives, or a complex keystroke (eg. ALT A) is
  337.         completed, TELNETD must find the PC scan code equivalent.  It does
  338.         this by searching a table.  Finally, the ASCII/ScanCode value is placed
  339.         into the BIOS keystroke table in low memory and the BIOS thinks the
  340.         PC enterred the keystroke.
  341.  
  342.         TELNETD must also deal with passwords and the possibility that the
  343.         remote person wishes to use its internal help or logoff facilities.
  344.         These are managed from the keyboard dispatch section just like other
  345.         keystrokes.
  346.  
  347.  
  348. Future Enhancements
  349.         TELNETD and the underlying kernel were all written by me.  You
  350.         can guess I've been pretty busy.  I tried to design the kernel so
  351.         oddball applications like TELNETD could be written in 'C' and
  352.         without looking like some of the nastier UNIX or Bible sequences.
  353.  
  354.         The number of TELNETD users is growing and I think the program has
  355.         become pretty reliable.  I really appreciate mail from users, I've
  356.         put a good deal of rainy day time into this project and it feels good
  357.         to know that others can benefit from the effort.
  358.  
  359.         There are some items which are still untidy, like the first password
  360.         attempt mess.  That's the problem when a person has a real job and
  361.         only writes software like this on rainy weekends.  I'll eventually get
  362.         around to it, just pray for bad weather.  I live in Canada so you don't
  363.         have to pray that hard.
  364.  
  365.         I post news to comp.protocols.tcp-ip.ibmpc when major improvements
  366.         are made to TELNETD or I am releasing other free software.
  367.  
  368.         In case you are interested in TCP applications programming, you
  369.         may like to look at some of the other applications available.
  370.         FTP to sunee.uwaterloo.ca [129.97.128.196] and get
  371.         pub/wattcp/src.zip
  372.  
  373. Suggested Uses for TELNETD
  374.         Here are just some of the practical uses for TELNETD.
  375.         1. People who are away from their desks can quickly call in to check
  376.            files, mail, etc.  Some prime candidates are when you are
  377.            in a meeting and you need something from your computer, any
  378.            terminal, mac or pc will allow you access if it is somehow connected
  379.            to the Internet.
  380.  
  381.         2. If you have a Dial up TELNET server, you can allow people to call
  382.            in from home (much like PC Anywhere), but without requiring modems
  383.            in their office PCs.
  384.  
  385.         3. Consulting can be simplified.  Set up an easy to use batch file
  386.            which invokes TELNETD.  When someone calls your consultant they will
  387.            be able to talk over the phone and use TELNET/TELNETD to solve the
  388.            problem.  If you have MARK/RELEASE you can remove TELNETD from
  389.            memory without rebooting.
  390.  
  391.         4. Some applications (such as databases) need to be accessible to
  392.            people at remote locations or on different computer systems.
  393.            TELNETD lets you to network existing applications on the PC
  394.            rather than programming on multiple platforms or trying to
  395.            get databases to work over wider area networks.
  396.  
  397. If you run into difficulty due to limitations of these brief notes, please
  398. E-mail me with suggestions.
  399.  
  400. Good luck, and I hope TELNETD fulfils some of your needs in a remote
  401. computing facility.
  402.  
  403. Erick Engelke
  404. Waterloo TCP Architect
  405. erick@development.watstar.uwaterloo.ca
  406.  
  407. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  408.