home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / hostmode / hostmode.txt < prev    next >
Text File  |  2020-01-01  |  33KB  |  796 lines

  1. KERMIT 95 HOST MODE PROPRIETOR'S GUIDE
  2.  
  3.   ---   PREPUBLICATION DRAFT   ---
  4.  
  5.   Copyright (C) 1996, Frank da Cruz and Christine M. Gianone.
  6.   All rights reserved.
  7.  
  8. Most recent update: February 8, 1996.
  9. Applies to: Kermit 95 1.1.3, Host Mode script version 1.00.
  10.  
  11.  
  12. CONTENTS
  13.  
  14.   1. INTRODUCTION
  15.   2. WHAT HOST MODE IS FOR
  16.   3. THE HOSTMODE MANAGEMENT PROGRAM
  17.   4. CONFIGURATION
  18.   5. USER IDs
  19.   6. LOGS
  20.   7. MESSAGES
  21.   8. STARTING AND STOPPING HOST MODE
  22.   9. SUMMARY OF FILES
  23.  10. IDEAS FOR IMPROVEMENT
  24.  
  25.  
  26. 1. INTRODUCTION
  27.  
  28. The "host mode" feature described here can be used with Kermit 95 1.1.3 and
  29. later, allowing people to dial up or Telnet to your PC and transfer files
  30. within a secure restricted environment.  Kermit 95's host mode is implemented
  31. entirely in the Kermit script language, and executed by Kermit itself.  You
  32. can find all the scripts in the Kermit 95 SCRIPTS subdirectory as HOST*.KSC.
  33.   
  34. The host-mode scripts include the host-mode user interface, a host-mode
  35. management program for the PC owner, and some others, plus some configuration,
  36. database, and documentation files.  There is also a new program, K95D.EXE, the
  37. "Kermit 95 Daemon", that handles incoming TCP/IP connections and starts up
  38. subprocesses to handle them.
  39.  
  40. For a detailed explanation of Kermit's script programming language, refer to
  41. Chapters 11-13 of "Using C-Kermit", as supplemented by DOCS\CKERMIT.UPD.
  42.  
  43. Documentation for host-mode users is in two separate files:
  44.  
  45.   USERS\HOSTMODE.TXT  -  A short help file
  46.   PUBLIC\HOSTUSER.DOC -  A more detailed user guide
  47.  
  48. The host-mode manager's guide is this file that you are reading.
  49.  
  50. In this document, filenames are all relative to the Kermit 95 directory, even
  51. though you can configure Kermit 95's host mode to use any other directories of
  52. your choice.  So, for example, if you have installed Kermit 95 in D:\K95,
  53. then:
  54.  
  55.   USERS\HOSTMODE.TXT
  56.  
  57. refers to:
  58.  
  59.   D:\K95\USERS\HOSTMODE.TXT
  60.  
  61. Kermit 95's host mode feature is entirely self-contained and does not make any
  62. use at all of the Windows 95 (or NT) Registry or Windows 95/NT user IDs or
  63. passwords.  Therefore it is not to be run as a Windows NT Service under the
  64. Service Manager.
  65.  
  66. When you use host mode, you become what amounts to the manager of a multiuser
  67. computer system.  As such, you need to understand how the system works before
  68. you can provide good and reliable service to your users.  So before you jump
  69. right in to running the Kermit 95 host, please read the following sections
  70. about security, configuration, user ID management, logs, and messages.
  71.  
  72.  
  73. 2. WHAT HOST MODE IS FOR
  74.  
  75. Windows 95 is not a multiuser operating system in the traditional sense that
  76. it can be dialed up and logged in to by ordinary terminals or terminal
  77. emulators, nor that it embodies notions of file ownership and access
  78. permission within the PC's file system.
  79.  
  80. Yet often, the owner of a PC wants to allow other people to be able to dial up
  81. her PC from different types of computers and upload or download files.
  82. Sometimes even the owner herself needs to do this from a remote location.
  83. This could be done simply by leaving a Kermit server running on the desired
  84. communication port or TCP socket, but in that case the user gets no cues about
  85. what to do.  Also, security is an issue -- if you leave your PC in this state,
  86. anybody who knows the phone number or Internet address can access it and,
  87. potentially, do some damage.
  88.  
  89. Kermit 95's host mode provides a simple mechanism for access control, and it
  90. gives users an easy-to-use menu.  The functions are limited: upload and
  91. download files within restricted areas, display files, display directory
  92. listings, read and leave messages.  Multiple authenticated users are allowed,
  93. as well as anonymous (guest) access if you (the PC owner) permit it.
  94.  
  95. Furthermore, there are several levels of privilege, allowing different levels
  96. of access to the file system and to the facilities of the operating sytem.
  97.  
  98. Cast of characters:
  99.  
  100. PROPRIETOR
  101.   The PC owner, or "proprietor", is the person who grants access to users by
  102.   giving them IDs, and the one who configures host mode, and who starts and
  103.   stops host most from the PC's console (keyboard and screen).  This document
  104.   is for you, the proprietor.
  105.  
  106. USER
  107.   A "user" is someone who accesses the PC from a remote location via Telnet or
  108.   dialup, and who logs in and accesses the PC only via the host-mode menus,
  109.   providing a username and a password.  The Kermit 95 host can have any number
  110.   of distinct users, plus a "guest" username that can be logged into by
  111.   anybody without a password if the PC owner wishes.
  112.     
  113. GUEST
  114.   An anonymous user who can log in without a password, if you allow it.
  115.   A guest never has any privileges.
  116.  
  117.  
  118. 3. THE HOSTMODE MANAGEMENT PROGRAM
  119.  
  120. Kermit 95 host mode comes with a management program to make it easy for
  121. the PC owner (proprietor) to start host mode, manage the configuration,
  122. manage user IDs, send and read messages, and so on.
  123.  
  124. To run the management program, enter a console ("DOS") window and type:
  125.  
  126.   hostmode
  127.  
  128. NOTE: "hostmode" is simply a Batch program (hostmode.bat) that starts
  129. K95.EXE and has it execute the host-mode management script, HOSTMODE.KSC.
  130.  
  131. You will see the following menu:
  132.  
  133. --------------------------------------------
  134. K-95 Host Mode Management
  135.  
  136.  1 - Start host mode
  137.  2 - Display configuration
  138.  3 - Change configuration
  139.  4 - Save configuration
  140.  5 - Read messages from users
  141.  6 - Leave a message for a user
  142.  7 - View/edit current greeting message
  143.  8 - Post a new greeting message
  144.  9 - Manage user database
  145. 10 - Help
  146. 11 - Exit
  147.  
  148. Your choice: 
  149. --------------------------------------------
  150.  
  151.  1 - Start host mode
  152.  
  153. This option guides you through starting a host-mode listener.  You may choose
  154. to start a listener for Telnet connections or for dialup connections.  In each
  155. case, the relevant parameters are displayed for you and you can choose whether
  156. to proceed, or to change the parameters.  For Telnet, the only parameter is
  157. the socket number.  For dialup, the parameters are the dialup device (port)
  158. name, the speed, and the modem type.  If you wish to change any of these
  159. parameters, return to the main menu and choose "Change configuration", and
  160. then come back to "Start host mode".
  161.  
  162. If you wish to use a TAPI device (in Windows 95, or Windows NT 4.00 or later),
  163. specify the port as "{TAPI name_of_tapi_device}". That is, the word TAPI
  164. followed by the name of the desired TAPI device, but with each space replaced
  165. by an underscore, all enclosed in braces, for example:
  166.  
  167.   {TAPI US_Robotics_Sportster_28800}
  168.  
  169. And specify the modem type as "TAPI". 
  170.  
  171. Direct serial connections are also offered, but these are a bit tricky.  In
  172. particular, you have to be very sure you've got a true null-modem connection
  173. that cross-connects the receive and transmit wires, the DTR and CD wires, and
  174. the RTS and CTS wires.  The latter is important or else flow control won't
  175. work and there could easily be large amounts of data loss, exhibited as
  176. fractured screens and file transfer failures.
  177.  
  178.  2 - Display configuration
  179.  
  180. This lists the current host mode configuration -- each variable and its
  181. assignment.
  182.  
  183.  3 - Change configuration
  184.  
  185. You are prompted for each configuration variable.  The current value is shown
  186. in [brackets].  If you don't want to change it, just press the Enter key.  If
  187. you do want to change it, type in the new value and then press the Enter key.
  188. You can use Backspace (delete character), Ctrl-W (delete word), and Ctrl-U
  189. (delete line) for editing.  After entering the new value, you are given a
  190. chance to change your mind.  After all the variables have been processed, you
  191. are returned to the main menu, but the configuration data is not saved, so you
  192. still have other chances to change your mind.  (Don't worry, if you try to
  193. exit without saving the configuration, you'll be warned.)
  194.  
  195.  4 - Save configuration
  196.  
  197. Saves the current configuration in the HOST.CFG file.
  198.  
  199.  5 - Read messages from users
  200.  
  201. If users have sent you messages, this will display them for you.
  202.  
  203.  6 - Leave a message for a user
  204.  
  205. This lets you compose and send a message to a particular user.  Whenever a
  206. user has messages waiting, it says so in the user's main menu.  Thus, even if
  207. you send a message to a logged in user, they can find out about it and read it
  208. right away.
  209.  
  210.  7 - View/edit current greeting message
  211.  
  212. This lets you view the current greeting message that all users see when
  213. they log in and edit it if you want to.  It just runs Notepad on the message
  214. file.
  215.  
  216.  8 - Post a new greeting message
  217.  
  218. This lets you post a new greeting message for all users.
  219.  
  220.  9 - Edit user database
  221.  
  222. This is the user ID management feature: add, remove, and change user IDs
  223. and passwords.  Explained in section 5.2.
  224.  
  225. 10 - Help
  226.  
  227. Displays a brief help message.
  228.  
  229. 11 - Exit
  230.  
  231. Exits back to the console window "DOS" prompt.
  232.  
  233.  
  234. 4. CONFIGURATION
  235.  
  236. Your host-mode configuration is governed by a plain-text configuration file,
  237. HOST.CFG, in Kermit 95's SCRIPTS subdirectory.  The configuration variables
  238. are listed below, along with their default values -- that is, the values they
  239. have if you don't change them.  All the various scripts that make up host mode
  240. read this file to get the information they need.
  241.  
  242. You can change the default configuration by editing the HOST.CFG file with a
  243. text editor like EDIT or NOTEPAD or perhaps more conveniently, by using the
  244. "Change configuration" option of the host-mode management program, HOSTMODE.
  245. The standard configuration file is shown here in its entirety:
  246.  
  247. sessions=1                             ; Maximum simultaneous Telnet sessions
  248. maxusers=100                           ; Maximum number of user IDs
  249. inactivity=1200                        ; Inactivity limit (seconds)
  250. logintime=300                          ; Inactivity limit during login
  251. anonok=1                               ; Anonymous logins OK (0 = not OK)
  252. logging=1                              ; Logging enabled (0 = skip logging)
  253. dlincoming=0                           ; Downloads OK from INCOMING directory
  254. msgmax=200                             ; Longest message size (lines)
  255. hostport=3000                          ; TCP port to listen on
  256. comport=                               ; Communication port for dialins
  257. comspeed=                              ; Speed for communication port
  258. modem=                                 ; Type of modem on communication port
  259. protocol=kermit                        ; Default file transfer protocol
  260. xfermode=binary                        ; Default file transfer mode
  261. owner={THE PROPRIETOR}                 ; For user's MESSAGE FROM... message
  262. herald={Welcome to K-95 Host Mode}     ; Main menu title
  263. public=\v(startup)PUBLIC               ; Publicly readable directory
  264. incoming=\v(startup)INCOMING           ; Publicly writeable directory
  265. logdir=\v(startup)LOGS                 ; Directory for proprietor's logs
  266. usertree=\v(startup)USERS              ; Root of user directory tree
  267. tmpdir=\v(startup)TMP                  ; Directory for temp files
  268. userfile=\m(_usertree)/HOST.USR        ; User database file
  269. greeting=\m(_usertree)/GREETING.TXT    ; Message/greeting text filename
  270. helpfile=\m(_usertree)/HOSTMODE.TXT    ; Host-mode help file
  271. msgfile=\m(_usertree)/MESSAGES.TXT     ; Messages for proprietor
  272.  
  273. Now, in more detail: 
  274.  
  275. sessions=4
  276.   The maximum allowed number of simultaneous incoming TELNET sessions.
  277.   Strictly speaking, the number is either 1 or "more than one".  If it is
  278.   1, then we simply run host mode in a loop: wait for a connection to come
  279.   in, have a session, close the session, wait for the next connection to
  280.   come in, and so on.  If SESSIONS is greater than 1, we use a special
  281.   "daemon" to wait for incoming connections and spawn new, possibly concurrent
  282.   sessions.  IMPORTANT: Only Microsoft TCP/IP allows multiple sessions.  If
  283.   you attempt to set SESSIONS greater than 1 with Trumpet Winsock or FTP
  284.   OnNet, it won't work.  The default maximum of 1 session should work with
  285.   all varieties of TCP/IP.
  286.  
  287. maxusers=100
  288.   The maximum number of users allowed in the user database.
  289.  
  290. inactivity=1200
  291.   Inactivity limit in seconds.  A logged-in user who doesn't type anything in
  292.   this amount of time is logged out and disconnected.  This prevents idle
  293.   users from tying up resources on your PC.
  294.  
  295. logintime=300
  296.   Inactivity limit in seconds in effect during the login process.  People
  297.   who don't type anything in this amount of time while at the Username or
  298.   Password prompt are logged out and disconnected.
  299.  
  300. anonok=1
  301.   This means that anonymous (guest) logins are permitted.  Change the 1 to 0
  302.   if you only want known users (from your HOST.USR file) to log in.
  303.  
  304. logging=1
  305.   This means you want to keep logs of the activities of your host-mode
  306.   users (see Section 6).  Change 1 to 0 if you don't want to keep logs.
  307.  
  308. dlincoming=0
  309.   This means it is not OK for users to download from the INCOMING directory
  310.   nor to type files or get directory listings from it.  If you want to
  311.   permit this type of access, change 0 to 1.  But this carries certain risks
  312.   (e.g. if they upload copyrighted material illegally, then you might be
  313.   held responsible for its further distribution).
  314.  
  315. msgmax=200
  316.   Maximum length (in lines) for messages sent by the user to the proprietor
  317.   or vice-versa.
  318.  
  319. hostport=3000
  320.   The TCP port to be used while listening for incoming Telnet sessions.
  321.  
  322. commport=
  323. comspeed=
  324. modem=
  325.   Communications parameters to be used when waiting for incoming modem
  326.   calls.  If these are left blank, the values from your K95CUSTOM.INI
  327.   file are used.
  328.  
  329.   If you wish to use a TAPI device (in Windows 95, or Windows NT 4.00 or
  330.   later), specify the "commport" as "{TAPI name_of_tapi_device}". That is,
  331.   the word TAPI followed by the name of the desired TAPI device, but with
  332.   each space replaced by an underscore, all enclosed in braces, for
  333.   example:
  334.  
  335.     commport={TAPI US_Robotics_Sportster_28800}
  336.  
  337. protocol=kermit
  338.   The default file transfer protocol.  The other choices are zmodem,
  339.   ymodem, ymodem-g, and xmodem. 
  340.  
  341. xfermode=binary
  342.   The default file transfer mode.  The other choice is text.
  343.  
  344. owner={THE PROPRIETOR}
  345.   This is what is shown to users who receive messages from you.  Replace
  346.   this by your name, your company's name, or whatever you like.  Braces are
  347.   needed if the value contains any spaces.
  348.  
  349. herald={Welcome to K-95 Host Mode}
  350.   This is the title shown at the top of the main menu screen.  Replace it
  351.   with anything you like, up to about 50 characters.  Braces are needed
  352.   if the value contains any spaces.
  353.  
  354. public=\v(startup)PUBLIC
  355.   This is the directory that all users can CD to and download from,
  356.   but can't upload to.  In other words it is the public "read only"
  357.   directory, intended for you (the PC owner) to distribute files to
  358.   your users.  NOTE: \v(startup) stands for the directory that Kermit 95
  359.   was started from -- normally the directory you installed it into.
  360.  
  361. incoming=\v(startup)INCOMING
  362.   This is the directory to which all users are allowed to upload files,
  363.   but which they can't download from or see directory listings of.
  364.   In other words, it is the public "write only" directory, intended for
  365.   your users to send files to you.  Optionally, you can configure this
  366.   directory to also allow your users to download from it -- see the
  367.   variable _dlincoming above.
  368.  
  369. logdir=\v(startup)LOGS
  370.   This is the directory where log files are kept (see below).
  371.  
  372. usertree=\v(startup)USERS
  373.   This is the root of the user directory tree.  So, for example, if your
  374.   Kermit 95 directory is D:\K95, and you have a host-mode user named Olga,
  375.   her personal directory will be D:\K95\USERS\Olga.  You can change this in
  376.   case you want to put your host-mode users someplace else.
  377.  
  378. tmpdir=\v(tmpdir)
  379.   Name of a directory that Kermit 95 can use for writing temporary files.
  380.  
  381. helpfile=\m(_usertree)/HOSTUSER.DOC
  382.   Help text that is displayed if the user asks for help.  This is a
  383.   short plain-text file that you can modify if you wish.
  384.  
  385. greeting=\m(_usertree)/GREETING.TXT
  386.   A short text file which, if it exists, is displayed every time each
  387.   user logs in.  You can create it with a text editor, or use the HOSTMODE.KSC
  388.   script to create it for you.
  389.  
  390. msgfile=\m(_usertree)/MESSAGES.TXT
  391.   Name of the file in which messages from users to the proprietor are placed.
  392.  
  393. userfile=\m(_usertree)/HOST.USR
  394.   This is the user database file, as described above.
  395.  
  396. 5. USER IDs
  397.  
  398. As distributed, HOST.KSC requires users to log in with a user ID and password.
  399. A user ID gives the user access to a private directory with full read/write
  400. access.  Guest (anonymous) users, if allowed, do not have a private directory.
  401.  
  402. A failed login causes a three-second pause.  Three failed logins cause the
  403. host script to hang up the connection.  All logins, failed logins, and actions
  404. are recorded to a file.
  405.  
  406. 5.1. STRUCTURE OF USER IDs
  407.  
  408. User IDs should be composed of letters and/or digits, and should not contain
  409. spaces, underscores, backslashes, or other non-alphanumeric characters.
  410.  
  411. Kermit 95's host mode allows users access to three different directories:
  412.  
  413.  1. The user's own private directory, to which the user has read/write
  414.     access, but which other users can't access.
  415.  
  416.  2. The PUBLIC directory, to which all users have read access only.
  417.  
  418.  3. The INCOMING directory, into which all users can send files, and, if you
  419.     permit it, from which all users can also retrieve files.
  420.  
  421. (In addition, users with "CD Privilege" can also access any (ANY) other
  422. directory on the system; more about this later.)
  423.  
  424. Regular unpriviledged users can switch among these three directories, but they
  425. can't go anywhere else -- not for reading or writing files, not for getting
  426. directory listings.  If a file is uploaded containing a pathname, the pathname
  427. is stripped upon receipt, preventing users from being able to place or
  428. overwrite files in other other areas.  Similarly, pathnames are stripped from
  429. filenames given by the user in download requests, thus restricting their
  430. access to their current directory.
  431.  
  432. 5.2. MANAGEMENT OF USER IDs
  433.  
  434. IDs are created only by the owner of the PC.  An ID is associated with an
  435. entry in the user database, normally USERS\USERS.DAT (you can change this in
  436. the configuration, if you want to), which is a plain-text ASCII file
  437. consisting of entries (lines) of the form:
  438.  
  439.   username_encryptedpassword_privileges_name_address_phone_email_
  440.  
  441. in which each field is terminated by an underscore, for example:
  442.  
  443.   jrd_6840DF9017F59B67_0_Joe R. Doupnik_Utah State University__jrd@cc.usu.edu_
  444.  
  445. The encrypted password can be created or modified only by using the tools
  446. provided -- not with a text editor or any other tool, because the encryption
  447. method is internal to Kermit 95.  The encryption method should be secure
  448. enough that no harm would be done if the USERS.DAT file fell into unfriendly
  449. hands, but of course there can be no guarantees.  In any case, the hostmode
  450. system is set up so that UNPRIVILEGED hostmode users will not have access to
  451. this file.
  452.  
  453. Adding a user to the database is sufficient to create the user ID.  The host
  454. script creates the user's directory automatically the first time the user logs
  455. in successfully.
  456.  
  457. To manage user IDs, select "Manage user database".  This presents you with a
  458. new menu that looks like:
  459.  
  460.   User database management functions...
  461.  
  462.   Database filename: USERS/USERS.DAT - Not loaded
  463.   Current user:      (none)
  464.  
  465.    1 - Load user database
  466.    2 - Display user database
  467.    3 - Look up a user / set current user
  468.    4 - Add a new user
  469.    5 - Remove current user
  470.    6 - Modify current user
  471.    7 - Save user database
  472.    8 - Remove lock
  473.    9 - Return to main menu
  474.  
  475.   Your choice: _
  476.  
  477. Before you can do anything else you must load the user database (item 1).
  478. If no user database exists yet, item 1 reads "Create user database".  In
  479. either case, select item 1 first.
  480.  
  481. Item 2 lets you look at the user database -- the literal contents of the file.
  482.  
  483. Item 3 lets you look up a particular user.  You are prompted for the user's ID
  484. or name (either one will work).  If the user's entry is found, this becomes
  485. the "current user", which is the one affected by Remove and Modify selections.
  486. When a user is selected in this way, her ID is displayed in the Current User
  487. field above the menu.
  488.  
  489. Item 4 lets you add a new user.  You are prompted for each field separately:
  490. user ID, password, privilege level, user's name, address, phone number, and
  491. email address.  All but the ID, password, and privilege level are optional.
  492. When you have entered the information, it is displayed for you and you are
  493. asked for permission to create the user ID, and if you give it, the ID is
  494. created.  NOTE: The user ID can not actually be used until you save the
  495. database (Item 7).
  496.  
  497. Item 5 removes the current user ID (obtained from Item 3) from the database.
  498. The entry is displayed, your permission is requested, and if you give it, the
  499. entry is removed from the database.  However, the user's directory and files
  500. are not removed.  You can do this yourself by hand -- since it is your PC, you
  501. might want to see what the user has been storing there and decide what to do
  502. with the files.  NOTE: The user ID is not actually removed until you save the
  503. database (Item 7).
  504.  
  505. Item 6 can be used to change the password and/or the privilege level of the
  506. current user.  NOTE: These changes do not actually take effect until you save
  507. the database (Item 7).
  508.  
  509. Item 7 saves the database, activating any changes you have made to it.
  510.  
  511. Item 8 unlocks the user database.  This will be necessary in case a host-mode
  512. session left a stale lock behind; for example, if they became disconnected
  513. while changing their password.  You can also remove the lock at the DOS
  514. prompt, simply by deleting the USERS.LCK file in the USERS directory.  You
  515. can also type this file -- it contains the user ID of the user who created
  516. the lock.  The timestamp on the file shows when it was created.
  517.  
  518. Item 9 returns you to the main menu of the hostmode program.
  519.  
  520. 5.3. PRIVILEGES
  521.  
  522. There are several levels of privilege:
  523.  
  524.  0 - No special privileges.  Users with this privilege level are restricted
  525.      to their own directory, plus the INCOMING and PUBLIC directories.  It
  526.      should be safe to give this level or privilege to anybody.  GUEST users
  527.      always have 0 privilege and, in addition, do not have a directory of
  528.      their own.
  529.  
  530.  1 - CD privilege.  This lets the user CD to any directory on the computer.
  531.      This should be given only to persons that you trust utterly and
  532.      completely yourself, and whom all of your other host-mode users can
  533.      trust as well.  This privilege allows the user to download any file at
  534.      all, to upload any file into any directory, possibly overwriting
  535.      critical system files or sensitive personal ones, including the host
  536.      mode user database, perhaps altering privilege levels of other other
  537.      users.  We recommend that this privilege be granted only to the PC's
  538.      owner and not to any other users.
  539.  
  540.  2 - DOS privilege.  This lets the user execute DOS commands.  It implies
  541.      and includes CD privilege, since there is no control over DOS commands,
  542.      their operands, and what they can do.  All the previous cautions apply,
  543.      and then some.
  544.  
  545.  
  546. 6. LOGS
  547.  
  548. All user actions are written to the hostmode window and, unless you change
  549. things, also written to a log file in Kermit 95's LOGS subdirectory.  The log
  550. file name for each session should be unique:
  551.  
  552.   <user>_<date>_<time>.log
  553.  
  554. for example:
  555.  
  556.   olga_951224_12345.log
  557.  
  558. where "olga" is the username, the first number is the julian date (yymmdd)
  559. and the second is the time in seconds since midnight.  These logs should be
  560. cleaned out periodically, especially if you have a lot of host-mode users
  561. and/or sessions, otherwise your disk could fill up.
  562.  
  563. If you don't want to keep log files, see the Section 4 about how to disable
  564. the log-file feature.
  565.  
  566.  
  567. 7. MESSAGES
  568.  
  569. You can leave a message that all users will see when they log in (even
  570. anonymous users) in the greeting file.  Use the "hostmode" program to post
  571. messages.
  572.  
  573. You can also use the hostmode program to leave a private message for a
  574. particular user.
  575.  
  576. Users can leave messages for you ("the proprietor") via the "Leave a message"
  577. menu entry.  All such messages are appended to a single message file,
  578. MESSAGES.TXT in the root directory of the user tree.  You can read them with
  579. the hostmode program.
  580.  
  581. All messages produced by Kermit 95 host-mode scripts are in standard e-mail
  582. format:
  583.  
  584. Date: <date and time message was sent>
  585. From: <username> (or if from you, the OWNER value)
  586. To: <username> (or if a general message, "All")
  587. Subject: <line of text>
  588.  
  589. <message body...>
  590. .
  591.  
  592. Each message ends with a period alone on a line, and a blank line separates
  593. the headers from the message body.
  594.  
  595. All message reading is done simply by putting the message into the "notepad"
  596. editor for you.  It is up to you to dispose of it.  There is no built-in
  597. mechanism for replying to a message -- instead, just choose the "Leave a
  598. message" from the main menu.
  599.  
  600.  
  601. 8. STARTING AND STOPPING HOST MODE
  602.  
  603. Using a single copy of the HOSTMODE program, you can run one or more host
  604. sessions simultaneously on any combination of serial communication ports or as
  605. TCP/IP Telnet servers.
  606.  
  607. To stop a host script, bring its window to the front and type Ctrl-C, and then
  608. "exit" from K-95, which will close any open files, devices, or connections.
  609. If Ctrl-C does not bring you back to the prompt (for example, when waiting for
  610. an incoming TCP/IP connection), then use the mouse to close the window from
  611. its system menu.
  612.  
  613. By the way, once you interrupt a host script by typing Ctrl-C, the connection
  614. is still open so you can (for example) CONNECT and then type characters which
  615. the client will see on her screen.  You can also use OUTPUT and TRANSMIT and
  616. any other commands to send text to the client's screen prior to hanging up
  617. and/or exiting.
  618.  
  619. 8.1. HOST MODE ON TCP/IP CONNECTIONS
  620.  
  621. TCP/IP connections are governed by the SESSIONS and HOSTPORT parameters in
  622. the configuration file.
  623.  
  624. HOSTPORT=3000
  625.  
  626. This is the TCP port, or "socket", on which the host session listens for
  627. incoming connections.
  628.  
  629. SESSIONS=1
  630.  
  631. If SESSIONS is 1, then only one Telnet host session is allowed at a time.
  632. In that case, the HOSTTCP.KSC script is used to wait for incoming connections
  633. and then to run the HOST.KSC script for them.  This method is required for
  634. FTP OnNet-32 and Trumpet Winsock, because these TCP/IP stacks do not allow
  635. socket handles to be shared.
  636.  
  637. If you are using Microsoft TCP/IP, you can set SESSIONS to 2 (or any number
  638. greater than 1), which allows multiple concurrent sessions.  (The number
  639. doesn't matter -- there is presently no way to limit the number of concurrent
  640. sessions to a particular maximum.)  In this case, the K95D.EXE program is
  641. used to listen for incoming connections and to spawn a host session for each
  642. one.
  643.  
  644. SESSIONS=1 works with all TCP/IP stacks, and so it is the default.  Numbers
  645. larger than 1 only work with the Microsoft TCP/IP stack.
  646.  
  647. Users should connect to your PC using a Kermit program that has built-in
  648. Telnet capability: Kermit 95, OS/2 C-Kermit, MS-DOS Kermit, UNIX C-Kermit, VMS
  649. C-Kermit, etc.  They should also enable the APC feature, if they have it,
  650. which allows both uploads and downloads to be automatic.  So if your PC's
  651. hostname were pc.oofa.com, the client Kermit command to make a connection to
  652. your PC would be:
  653.  
  654.   set terminal apc on
  655.   telnet pc.oofa.com 3000
  656.  
  657. For testing (under Microsoft TCP/IP only), you can run the host and client
  658. window on the same PC -- tell the client Kermit program to "telnet localhost
  659. 3000".
  660.  
  661. K95D.EXE can also be used for other purposes.  You can run it with a command
  662. line, or with a configuration file.  The command line format is:
  663.  
  664.   k95d <socket> "<k95 command>"
  665.  
  666. where <socket> is a socket number (such as 3000) and <k95 command> is one or
  667. more Kermit 95 commands (if more than one, separated by commas), for example:
  668.  
  669.   k95d 3000 "take scripts/host.ksc, exit"
  670.  
  671. Note the doublequotes around the K95 commands -- this causes the multiple
  672. words to be grouped together by the Windows shell as a single argument for
  673. K95D.EXE.
  674.  
  675. If you start K95D.EXE without command-line options, it reads its configuration
  676. files, K95D.CFG, which contains lines of the same form as the command line
  677. arguments, but without the quotes, for example:
  678.  
  679.   ; This is a comment
  680.   1000  set term echo local, set term newline on, connect
  681.   2000  server, exit                
  682.   3000  take scripts/host.ksc, exit
  683.  
  684. Then, if any connection came in on port 1000, a "chat mode" session would be
  685. started.  Connections coming in on port 2000 would get a Kermit server, and
  686. connections on port 3000 would get a host-mode session.
  687.  
  688. 8.2. HOST MODE ON DIALED CONNECTIONS
  689.  
  690. The management program uses HOSTMDM.KSC to run the host mode script in a loop,
  691. so whenever a user logs out, Kermit 95 waits for the next incoming phone call.
  692. Obviously, there can be only one concurrent host-mode session per serial port.
  693.  
  694. Users make connections to your PC simply by dialing your modem's phone number
  695. and then going into terminal emulation mode.
  696.  
  697.  
  698. 9. SUMMARY OF FILES
  699.  
  700. Filename are all relative to the Kermit 95 directory.
  701.  
  702.   HOST.CFG             The host-mode configuration file.
  703.   K95D.CFG             The K95D.EXE configuration file.
  704.   HOSTMODE.BAT         Starts the host-mode management program.
  705.   K95D.EXE             Daemon for managing incoming Telnet connections.
  706.   DOCS\HOSTMODE.DOC    This file.
  707.   SCRIPTS\HOST.KSC     The host-mode script.
  708.   SCRIPTS\HOSTTCP.KSC  Script to start host mode for TCP/IP users.
  709.   SCRIPTS\HOSTMDM.KSC  Script to start host mode for dialup modem users.
  710.   SCRIPTS\HOSTCOM.KSC  Script to start host mode for direct serial connection.
  711.   SCRIPTS\HOSTMODE.KSC The host-mode management program.
  712.   USERS\USERS.DAT      The user ID database.
  713.   USERS\GREETING.TXT   Short greeting text for users when they log in.
  714.   USERS\HOSTMODE.TXT   Help text displayed by "Help" menu item.
  715.   USERS\MESSAGES.TXT   Messages from users to the proprietor.
  716.   USERS\username.MSG   Message(s) to a particular user.
  717.   INCOMING             Directory to which all users can upload files.
  718.   PUBLIC               Directory from which all users can download files.
  719.   PUBLIC\HOSTUSER.DOC  A user guide which users can type or download and read.
  720.  
  721. The HOST.CFG configuration file is shared by HOSTMODE.KSC, HOST.KSC, and all
  722. the other scripts, so you only need to change configuration parameters in one
  723. place.
  724.  
  725.  
  726. 10. IDEAS FOR IMPROVEMENT
  727.  
  728. Since Kermit 95's host mode is written entirely in the Kermit script language
  729. and executed by Kermit itself, anybody can make improvements.  Here are a few
  730. ideas:
  731.  
  732.  . Callback capability for extra security.  User logs in with valid password,
  733.    callback number is looked up in the database (just add one more field),
  734.    and the host script calls the user back before presenting the menu.
  735.  
  736.  . Ability of users to find out about other users, see who's logged in, etc.
  737.  
  738.  . More-style paging of typed files and directory listings.
  739.  
  740.  . Ability to send messages, as well as TYPE and DIRECTORY material, to the
  741.    user's local printer.
  742.  
  743.  . File menus.
  744.  
  745.  . Better messaging features, interactive chat sessions, etc.
  746.  
  747.  . Limits on the length of sessions, the number of concurrent sessions, disk
  748.    quotas, ANSI screen coloration, etc etc...  Hey, it's BBS!
  749.  
  750. Several programming considerations might not be totally obvious.  The worst
  751. of them is the conflict between the use of the backslash (\) character by
  752. Kermit's command scanner, and its use by Windows as a directory separator.
  753. In the Kermit script language, backslash is used to introduce variables,
  754. function calls, and numerical representations of special characters.
  755. Variables, unless you take precautions to the contrary, are evaluated
  756. recursively so, for example, if the variable \%f contains a Windows filename
  757. such as C:\K95\OOFA.TXT, then any reference to this variable, such as:
  758.  
  759.   echo "\%f"
  760.  
  761. would result in its full evaluation, giving undesired results like:
  762.  
  763.   "C:K95OA.TXT"
  764.  
  765. Windows 95, at the API level, can accept forward slash (/) as well as
  766. backslash (\) as a directory separator, and therefore so can self-contained
  767. Kermit 95 commands such as SEND, MKDIR, etc, that take filenames or directory
  768. names.  Unfortunately, however, Windows commands and programs such as DIR
  769. will not accept forward slashes, and so before feeding a filename to one of
  770. them, you'll need to do:
  771.  
  772.   \freplace(xxx,/,\\)
  773.  
  774. where xxx is the name of the variable that contains the filename.
  775.  
  776. On the other hand, if the directory name contains backslashes to begin with,
  777. then any unguarded reference to it will result in the backslashes being
  778. interpreted recursively by Kermit's command scanner.  To avoid this, use
  779. constructions like:
  780.  
  781.   open read \fdefinition(_userfile)
  782.  
  783. \fdefinition means "return the definition of the macro" without evaluating
  784. it further.  Similarly for \%x variables:
  785.  
  786.   open read \fcontents(\%f)
  787.  
  788. A related consideration to be aware of is that you can't start a DOS shell
  789. and redirect its input and/or output to the communications channel.  It just
  790. doesn't work, don't even try it.  If it did work, we could easily use (e.g.)
  791. REDIRECT on COMMAND.COM to give hostmode users an interactive DOS session.
  792. (REDIRECT presently works in only one direction, and then only through the
  793. use of temporary files.)
  794.  
  795. (End)
  796.