home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc1282 < prev    next >
Text File  |  1991-12-04  |  11KB  |  283 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          B. Kantor
  8. Request for Comments: 1282                      Univ. of Calif San Diego
  9. Obsoletes: RFC 1258                                        December 1991
  10.  
  11.  
  12.                                BSD Rlogin
  13.  
  14. Status of this Memo
  15.  
  16.    This memo documents an existing protocol and common implementation
  17.    that is extensively used on the Internet.  This memo provides
  18.    information for the Internet community.  It does not specify an
  19.    Internet standard.  Distribution of this memo is unlimited.
  20.  
  21. Protocol Description
  22.  
  23.    The rlogin facility provides a remote-echoed, locally flow-controlled
  24.    virtual terminal with proper flushing of output [1].  It is widely
  25.    used between Unix hosts because it provides transport of more of the
  26.    Unix terminal environment semantics than does the Telnet protocol,
  27.    and because on many Unix hosts it can be configured not to require
  28.    user entry of passwords when connections originate from trusted
  29.    hosts.
  30.  
  31.    The rlogin protocol requires the use of the TCP.  The contact port is
  32.    513.  An eight-bit transparent stream is assumed.
  33.  
  34. Connection Establishment
  35.  
  36.    Upon connection establishment, the client sends four null-terminated
  37.    strings to the server.  The first is an empty string (i.e., it
  38.    consists solely of a single zero byte), followed by three non-null
  39.    strings: the client username, the server username, and the terminal
  40.    type and speed.  More explicitly:
  41.  
  42.         <null>
  43.         client-user-name<null>
  44.         server-user-name<null>
  45.         terminal-type/speed<null>
  46.  
  47.         For example:
  48.  
  49.         <null>
  50.         bostic<null>
  51.         kbostic<null>
  52.         vt100/9600<null>
  53.  
  54.    The server returns a zero byte to indicate that it has received these
  55.  
  56.  
  57.  
  58. Kantor                                                          [Page 1]
  59.  
  60. RFC 1282                       BSD Rlogin                  December 1991
  61.  
  62.  
  63.    strings and is now in data transfer mode.  Window size negotiation
  64.    may follow this initial exchange (see below).
  65.  
  66. From Client to Server (and Flow Control)
  67.  
  68.    Initially, the client begins operation in "cooked" (as opposed to
  69.    to "raw") mode.  In this mode, the START and STOP (usually ASCII
  70.    DC1,DC3) characters are intercepted and interpreted by the client to
  71.    start and stop output from the remote server to the local terminal,
  72.    whereas all other characters are transmitted to the remote host as
  73.    they are received.  (But see below for the handling of the
  74.    local-escape character.)
  75.  
  76.    In "raw" mode, the START and STOP characters are not processed
  77.    locally, but are sent as any other character to the remote server.
  78.    The server thus determines the semantics of the START and STOP
  79.    characters when in "raw" mode; they may be used for flow control or
  80.    have quite different meanings independent of their ordinary usage on
  81.    the client.
  82.  
  83. Screen/Window Size
  84.  
  85.    The remote server indicates to the client that it can accept window
  86.    size change information by requesting a window size message (as out
  87.    of band data) just after connection establishment and user
  88.    identification exchange.  The client should reply to this request
  89.    with the current window size.
  90.  
  91.    If the remote server has indicated that it can accept client window
  92.    size changes and the size of the client's window or screen dimensions
  93.    changes, a 12-byte special sequence is sent to the remote server to
  94.    indicate the current dimensions of the client's window, should the
  95.    user process running on the server care to make use of that
  96.    information.
  97.  
  98.    The window change control sequence is 12 bytes in length, consisting
  99.    of a magic cookie (two consecutive bytes of hex FF), followed by two
  100.    bytes containing lower-case ASCII "s", then 8 bytes containing the
  101.    16-bit values for the number of character rows, the number of
  102.    characters per row, the number of pixels in the X direction, and the
  103.    number of pixels in the Y direction, in network byte order.  Thus:
  104.  
  105.         FF FF s s rr cc xp yp
  106.  
  107.    Other flags than "ss" may be used in future for other in-band control
  108.    messages.  None are currently defined.
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Kantor                                                          [Page 2]
  115.  
  116. RFC 1282                       BSD Rlogin                  December 1991
  117.  
  118.  
  119. From Server to Client
  120.  
  121.    Data from the remote server is sent to the client as a stream of
  122.    characters.  Normal data is simply sent to the client's display, but
  123.    may be processed before actual display (tabs expanded, etc.).
  124.  
  125.    The server can imbed single-byte control messages in the data stream
  126.    by inserting the control byte in the stream of data and pointing the
  127.    TCP "urgent-data" pointer at the control byte.  When a TCP urgent-
  128.    data pointer is received by the client, data in the TCP stream up to
  129.    the urgent byte is buffered for possible display after the control
  130.    byte is handled, and the control byte pointed to is received and
  131.    interpreted as follows:
  132.  
  133. 02   A control byte of hex 02 causes the client to discard all buffered
  134.      data received from the server that has not yet been written to the
  135.      client user's screen.
  136.  
  137. 10   A control byte of hex 10 commands the client to switch to "raw"
  138.      mode, where the START and STOP characters are no longer handled by
  139.      the client, but are instead treated as plain data.
  140.  
  141. 20   A control byte of hex 20 commands the client to resume interception
  142.      and local processing of START and STOP flow control characters.
  143.  
  144. 80   The client responds by sending the current window size as above.
  145.  
  146.    All other values of the urgent-data control byte are ignored.  In all
  147.    cases, the byte pointed to by the urgent data pointer is NOT written
  148.    to the client user's display.
  149.  
  150. Connection Closure
  151.  
  152.    When the TCP connection closes in either direction, the client or
  153.    server process which notices the close should perform an orderly
  154.    shut-down, restoring terminal modes and notifying the user or
  155.    processes of the close before it closes the connection in the other
  156.    direction.
  157.  
  158. Implementation Notes
  159.  
  160.    The client defines a client-escape character (customarily the tilde,
  161.    "~"), which is handled specially only if it is the first character to
  162.    be typed at the beginning of a line.  (The beginning of a line is
  163.    defined to be the first character typed by the client user after a
  164.    new-line [CR or LF] character, after a line-cancel character, after
  165.    resumption of a suspended client session, or after initiation of the
  166.    connection.)
  167.  
  168.  
  169.  
  170. Kantor                                                          [Page 3]
  171.  
  172. RFC 1282                       BSD Rlogin                  December 1991
  173.  
  174.  
  175.    The client-escape character is not transmitted to the server until
  176.    the character after it has been examined, and if that character is
  177.    one of the defined client escape sequences, neither the client-escape
  178.    nor the character following it are sent.  Otherwise, both the
  179.    client-escape character and the character following it are sent to
  180.    the server as ordinary user input.
  181.  
  182.    If the character following the client-escape character is the dot
  183.    ".", or the client-defined end-of-file character (usually control-D),
  184.    the connection is closed.  This is normally treated by the server as
  185.    a disconnection, rather than an orderly logout.
  186.  
  187.    Other characters (client-defined, usually control-Z and control-Y)
  188.    are used to temporarily suspend the rlogin client when the host has
  189.    that ability.  One character suspends both remote input and output;
  190.    the other suspends remote input but allows remote output to continue
  191.    to be directed to the local client's terminal.
  192.  
  193.    Most client implementations have invocation switches that can defeat
  194.    normal output processing on the client system, and which can force
  195.    the client to remain in raw mode despite switching notification from
  196.    the server.
  197.  
  198. A Cautionary Tale [2]
  199.  
  200.    The rlogin protocol (as commonly implemented) allows a user to set up
  201.    a class of trusted users and/or hosts which will be allowed to log on
  202.    as himself without the entry of a password.  While extremely
  203.    convenient, this represents a weakening of security that has been
  204.    successfully exploited in previous attacks on the internet.  If one
  205.    wishes to use the password-bypass facilities of the rlogin service,
  206.    it is essential to realize the compromises that may be possible
  207.    thereby.
  208.  
  209.    Bypassing password authentication from trusted hosts opens ALL the
  210.    systems so configured when just one is compromised.  Just as using
  211.    the same password for all systems to which you have access lets a
  212.    villain in everywhere you have access, allowing passwordless login
  213.    among all your systems gives a marauder a wide playing field once he
  214.    has entered any of your systems.  One compromise that many feel
  215.    achieves a workable balance between convenience and security is to
  216.    allow password bypass from only ONE workstation to the other systems
  217.    you use, and NOT allow it between those systems.  With this measure,
  218.    you may have reduced exposure to a workable minimum.
  219.  
  220.    The trusted host specification is ordinarily one of a host name.  It
  221.    is possible, by compromise of your organization's domain name server,
  222.    or compromise of your network itself, for a villain to make an
  223.  
  224.  
  225.  
  226. Kantor                                                          [Page 4]
  227.  
  228. RFC 1282                       BSD Rlogin                  December 1991
  229.  
  230.  
  231.    untrusted host masquerade as a trusted system.  There is little that
  232.    a user can do about this form of attack.  Luckily, so far such
  233.    attacks have been rare, and often cause enough disruption of a
  234.    network that attempts are quickly noticed.
  235.  
  236.    When the file containing a user's list of trusted logins is
  237.    inadvertently left writeable by other users, untrustworthy additions
  238.    may be made to it.
  239.  
  240.    Secure authentication extensions to the rlogin protocol (Kerberos,
  241.    et al) can greatly reduce the possibility of compromise whilst still
  242.    allowing the convenience of bypassing password entry.  As these
  243.    become more widely deployed in the internet community, the hazards
  244.    of rlogin will decrease.
  245.  
  246. References
  247.  
  248.       [1] Stevens, W., "UNIX Network Programming", ISBN 0-13-949876-1.
  249.  
  250.       [2] Garfinkel & Spafford, "Practical Unix Security",
  251.           ISBN 0-937175-72-2.
  252.  
  253. Security Considerations
  254.  
  255.    See the "A Cautionary Tale" section above.
  256.  
  257. Author's Address
  258.  
  259.    Brian Kantor
  260.    University of California at San Diego
  261.    Network Operations C-024
  262.    La Jolla, CA 92093-0214
  263.  
  264.    Phone: (619) 534-6865
  265.  
  266.    EMail: brian@UCSD.EDU
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Kantor                                                          [Page 5]
  283.