home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / WATTCP / TELNETD.ZIP / DOC next >
Encoding:
Text File  |  1992-11-17  |  20.6 KB  |  407 lines

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