home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_q_t / draft-ietf-secsh-userauth-00.txt < prev    next >
Text File  |  1997-03-26  |  22KB  |  590 lines

  1.  
  2. Network Working Group                           Tatu Ylonen <ylo@ssh.fi>
  3. INTERNET-DRAFT                               SSH Communications Security
  4. draft-ietf-secsh-userauth-00.txt                          March 22, 1997
  5. Expires: September 1, 1997
  6.  
  7.  
  8.                       SSH Authentication Protocol
  9.  
  10. Status of This memo
  11.  
  12. This document is an Internet-Draft. Internet-Drafts are working
  13. documents of the Internet Engineering Task Force (IETF), its areas,
  14. and its working groups. Note that other groups may also distribute
  15. working documents as Internet-Drafts.
  16.  
  17. Internet-Drafts are draft documents valid for a maximum of six
  18. months and may be updated, replaced, or obsoleted by other documents
  19. at any time. It is inappropriate to use Internet-Drafts as reference
  20. material or to cite them other than as ``work in progress.''
  21.  
  22. To learn the current status of any Internet-Draft, please check
  23. the ``1id-abstracts.txt'' listing contained in the Internet-Drafts
  24. Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
  25. munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast),
  26. or ftp.isi.edu (US West Coast).
  27.  
  28. Abstract
  29.  
  30. This documents describes the SSH authentication protocol.  It is used to
  31. prove that the client is authorized access the requested service with
  32. the supplied user name.  This authorization can be demonstrated through
  33. possession of a password, through possession of a key, by authenticating
  34. the client host and user, by some other method, or a combination of
  35. these.
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. Tatu Ylonen <ylo@ssh.fi>                                        [page 1]
  60.  
  61. INTERNET-DRAFT                                            March 22, 1997
  62.  
  63. Table of Contents
  64.  
  65. 1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . .  2
  66. 2.  User Authentication   . . . . . . . . . . . . . . . . . . . . . .  2
  67.   2.1.  Authentication Requests   . . . . . . . . . . . . . . . . . .  3
  68.   2.2.  Responses to Authentication Requests  . . . . . . . . . . . .  4
  69.   2.3.  No Authentication   . . . . . . . . . . . . . . . . . . . . .  4
  70.   2.4.  Password-Style Authentications  . . . . . . . . . . . . . . .  5
  71.     2.4.1.  Password Authentication   . . . . . . . . . . . . . . . .  5
  72.     2.4.2.  SecurID Authentication  . . . . . . . . . . . . . . . . .  5
  73.   2.5.  One-Time Passwords and Similar Methods  . . . . . . . . . . .  5
  74.     2.5.1.  S/KEY   . . . . . . . . . . . . . . . . . . . . . . . . .  6
  75.     2.5.2.  NRL OPIE  . . . . . . . . . . . . . . . . . . . . . . . .  6
  76.   2.6.  Other Authentication Methods  . . . . . . . . . . . . . . . .  6
  77.     2.6.1.  Public Key Authentication   . . . . . . . . . . . . . . .  6
  78.     2.6.2.  Host-Based Authentication   . . . . . . . . . . . . . . .  7
  79.     2.6.3.  Kerberos Authentication   . . . . . . . . . . . . . . . .  8
  80. 3.  When Authentication Is Complete   . . . . . . . . . . . . . . . .  9
  81. 4.  Banner Message  . . . . . . . . . . . . . . . . . . . . . . . . .  9
  82. 5.  Message Numbers   . . . . . . . . . . . . . . . . . . . . . . . . 10
  83. 6.  Address of Author   . . . . . . . . . . . . . . . . . . . . . . . 10
  84.  
  85.  
  86.  
  87. 1.  Introduction
  88.  
  89. This protocol is designed to run over the SSH transport layer protocol
  90. using the same packet-based protocol as the transport layer.  The
  91. service name is "ssh-userauth".
  92.  
  93. Authentication works by the client first declaring the service name and
  94. the user name to be used to access the service.  The server then
  95. responds with the set of authentication methods that are acceptable; the
  96. client then sends an authentication request, and this dialog continues
  97. until access has been granted or denied.
  98.  
  99. When this protocol starts, it receives the session identifier from the
  100. transport layer protocol.  The session identifier uniquely identifies
  101. this session and is suitable for signing to prove ownership of a private
  102. key.
  103.  
  104. 2.  User Authentication
  105.  
  106. Authentication is mostly client-driven.  The client sends an
  107. authentication request, and the server responds with success or failure.
  108. With a failure response the server informs the client which methods may
  109. be used to continue the dialog, thus guiding the client through a
  110. potentially complex sequence of authentications.
  111.  
  112. Authentication methods are identified by names (strings).  Some methods
  113. are defined in the protocol; additional methods may be defined using the
  114. syntax "name@domainname" as the method name (for example,
  115. "footoken@footoken.com").  This ensures that private extensions can be
  116.  
  117.  
  118. Tatu Ylonen <ylo@ssh.fi>                                        [page 2]
  119.  
  120. INTERNET-DRAFT                                            March 22, 1997
  121.  
  122. implemented without breaking compatibility and without requiring a
  123. central registry of method names.  Method names are case-sensitive.
  124. Names must consist of non-control characters.  Commas are not allowed in
  125. names; at signs can only be used for the purpose described above.
  126.  
  127. The following methods are predefined:
  128.  
  129. none                 Checks if no authentication ok
  130. password             Knowledge of password
  131. securid              SecurID authentication
  132. skey                 S/KEY one-time passwords
  133. opie                 NRL OPIE one-time passwords
  134. publickeytest        Tests whether a key is acceptable
  135. publickey            Possession of private key
  136. hostbased            Identity of client host and user
  137. kerberos4            Kerberos v4 authentication
  138. kerberos5            Kerberos v5 authentication
  139. kerberos-afs         AFS Kerberos authentication
  140.  
  141. The server should have a timeout for authentication, and disconnect if
  142. the authentication has not been accepted within the timeout period.  The
  143. recommended timeout period is 10 minutes.  Additionally, the
  144. implementation may want to limit the number of authentication attempts a
  145. client may perform (the recommended limit is 20 attempts).
  146.  
  147. 2.1.  Authentication Requests
  148.  
  149. All authentication requests use the same generic message format.  Only
  150. the first few fields are defined; the remaining fields depend on the
  151. authentication method.
  152.  
  153.             vlint32   SSH_MSG_USERAUTH_REQUEST
  154.             string    user
  155.             string    service
  156.             string    method name
  157.             rest of the packet is method-specific
  158.  
  159. The user name and service are repeated in every new authentication
  160. attempt, and may change.  The server implementation must carefully check
  161. them in every message, and must flush any accumulated authentication
  162. state if they change.
  163.  
  164. If the requested service is not available, the server may disconnect
  165. immediately or any time later.
  166.  
  167. If the requested user does not exist, the server is allowed to
  168. disconnect, or may send a bogus list of acceptable authentications but
  169. never accept any.  This makes it possible for the server to avoid
  170. disclosing information about which accounts exist.
  171.  
  172. There are several authentication methods that basically work by the
  173. client sending some kind of identifying string (or other data) to the
  174. server, and the server directly responding with success or failure.
  175.  
  176.  
  177. Tatu Ylonen <ylo@ssh.fi>                                        [page 3]
  178.  
  179. INTERNET-DRAFT                                            March 22, 1997
  180.  
  181. Examples of this style of authentication are "password" and "securid"
  182. methods.  Other such methods may be defined later.
  183.  
  184. Another common form is one where the server sends a prompt (a
  185. challenge), and the client is supposed to respond appropriately based on
  186. the challenge.  Most one-time password methods use this form; examples
  187. include "skey" and "opie".
  188.  
  189. While there is usually little point in clients sending requests that the
  190. server does not list as acceptable, sending such requests is not an
  191. error, and the server should simply reject requests that it does not
  192. recognize.
  193.  
  194. An authentication request may result in a further exchange of messages.
  195. All such messages depend on the authentication method used, and the
  196. client may at any time continue with a new SSH_MSG_USERAUTH_REQUEST
  197. message, in which case the server must abandon the previous
  198. authentication attempt and continue with the new one.
  199.  
  200. 2.2.  Responses to Authentication Requests
  201.  
  202. If the server rejects the authentication request, it responds with
  203.  
  204.             vlint32   SSH_MSG_USERAUTH_FAILURE
  205.             string    authentications_that_can_continue
  206.  
  207. authentications_that_can_continue is a comma-separated list of
  208. authentication method names that may productively continue the
  209. authentication dialog.  Methods that require interaction with the user
  210. should not be listed unless they can actually be used to authenticate
  211. this user.  Note that successful response to one method in the list may
  212. not be enough to be accepted; the server is allowed to require multiple
  213. authentications.  The server should not list authentications that it has
  214. already accepted.
  215.  
  216. When the server accepts authentication, it responds with
  217.  
  218.             vlint32   SSH_MSG_USERAUTH_SUCCESS
  219.  
  220. The client may send several authentication requests without waiting for
  221. responses from previous requests.  The server will acknowledge any
  222. failed requests with a SSH_SMSG_AUTH_FAILURE message.  However,
  223. SSH_SMSG_AUTH_SUCCESS is sent only once, and any further authentication
  224. requests received after that are silently ignored.
  225.  
  226. Once SSH_MSG_USERAUTH_SUCCESS has been sent, any non-authentication
  227. messages sent by the client will be passed to the service being run
  228. above this authentication protocol.
  229. 2.3.  No Authentication
  230.  
  231. A client may request the list of real authentication methods that may
  232. continue by using the "none" authentication method.  This is actually an
  233. authentication request: if no authentication at all is needed for the
  234.  
  235.  
  236. Tatu Ylonen <ylo@ssh.fi>                                        [page 4]
  237.  
  238. INTERNET-DRAFT                                            March 22, 1997
  239.  
  240. user, this returns SSH_MSG_USERAUTH_SUCCESS.  Otherwise, this returns
  241. failure and with it the list of authentication methods that can
  242. continue.
  243.  
  244. 2.4.  Password-Style Authentications
  245.  
  246. All password-style authentication methods use a single message of the
  247. following format.  The server responds with success or failure.
  248.  
  249.             vlint32   SSH_MSG_USERAUTH_REQUEST
  250.             string    user
  251.             string    service
  252.             string    method name
  253.             string    authenticating string
  254.  
  255. 2.4.1.  Password Authentication
  256.  
  257. This is conventional password authentication.  The method name is
  258. "password"; the authenticating string is the plaintext password.  Note
  259. that the password is sent as plaintext in the packet, but the entire
  260. packet (including the password) is encrypted by the transport layer.  It
  261. is not possible for the client to hash the password, because it cannot
  262. know how the server stores the password.
  263.  
  264. 2.4.2.  SecurID Authentication
  265.  
  266. SecurID is a timing-based hardware token authenticator.  The user enters
  267. a code displayed on the token as authentication.  The entered token is
  268. passed in the following message.
  269.  
  270. The method name for SecurID authentication is "securid"; the
  271. authenticating string is the code displayed on the hardware token.
  272.  
  273. 2.5.  One-Time Passwords and Similar Methods
  274.  
  275. All one-time password authentication methods use the following message
  276. exchange:
  277.  
  278.             vlint32   SSH_MSG_USERAUTH_REQUEST
  279.             string    user
  280.             string    service
  281.             string    method name
  282.  
  283. The server responds with either SSH_MSG_USERAUTH_FAILURE or
  284.  
  285.             vlint32   SSH_MSG_USERAUTH_OTP_PROMPT
  286.             string    prompt
  287.  
  288. The client then responds with either a new authentication request or
  289.  
  290.             vlint32   SSH_MSG_USERAUTH_OTP_RESPONSE
  291.             string    response
  292.  
  293.  
  294.  
  295. Tatu Ylonen <ylo@ssh.fi>                                        [page 5]
  296.  
  297. INTERNET-DRAFT                                            March 22, 1997
  298.  
  299. The server responds to this message with either success or failure.
  300.  
  301. 2.5.1.  S/KEY
  302.  
  303. S/KEY is an early one-time password mechanism.  The method name is
  304. "skey".
  305.  
  306. 2.5.2.  NRL OPIE
  307.  
  308. NRL OPIE is another one-time password mechanism.  The method name for it
  309. is "opie".
  310.  
  311. 2.6.  Other Authentication Methods
  312.  
  313. 2.6.1.  Public Key Authentication
  314.  
  315. The possession of a private key can serve as authentication.  This
  316. method works by sending a signature created by the private key.
  317.  
  318. Private keys are often stored encrypted at the client host, and the user
  319. must supply a passphrase before the signature can be generated.  To
  320. avoid needing to supply passphrases when it is not necessary, the client
  321. can optionally query whether a particular key is acceptable as
  322. authentication.  This done with the following message.  The key may
  323. include certificates.
  324.  
  325.             vlint32   SSH_MSG_USERAUTH_REQUEST
  326.             string    user
  327.             string    service
  328.             string    "publickeytest"
  329.             string    public key algorithm name
  330.             string    public key to be used for authentication
  331.  
  332. Public key algorithms are defined in the transport layer specification.
  333. The key may include certificates.
  334.  
  335. The server will respond to this message with either
  336. SSH_MSG_USERAUTH_FAILURE or with
  337.  
  338.             vlint32   SSH_MSG_USERAUTH_PK_OK
  339.  
  340. However, no response is sent after a successful authentication.
  341.  
  342. To do actual authentication, the client should then send a signature
  343. generated by the public key.  It is permissible to send the signature
  344. directly without first querying whether the key is acceptable.
  345.  
  346.             vlint32   SSH_MSG_USERAUTH_REQUEST
  347.             string    user
  348.             string    service
  349.             string    "publickey"
  350.             string    public key algorithm name
  351.             string    public key to be used for authentication
  352.  
  353.  
  354. Tatu Ylonen <ylo@ssh.fi>                                        [page 6]
  355.  
  356. INTERNET-DRAFT                                            March 22, 1997
  357.  
  358.             string    signature
  359.  
  360. The public key may contain certificates.
  361.  
  362. Signature  is a signature by the corresponding private key of the HASH
  363. of the concatenation of the following, in this order:
  364.  
  365. o  the session identifier (which binds the signature to the server host
  366.    key and the particular key exchange),
  367.  
  368. o  length of the user name as a 32-bit integer, msb first,
  369.  
  370. o  user name (without length or null characters),
  371.  
  372. o  length of the service name as a 32-bit integer, msb first,
  373.  
  374. o  service name (without length or null characters),
  375.  
  376. o  length of the public key algorithm name as a 32-bit integer, msb
  377.    first,
  378.  
  379. o  public key algorithm name (without length or null characters),
  380.  
  381. o  length of the public key from the message as a 32-bit integer, msb
  382.    first, and
  383.  
  384. o  the public key from the message (without length or null characters).
  385.  
  386. When the server receives this message, it checks whether the supplied
  387. key is acceptable for authentication, and if so, checks whether the
  388. signature is correct.
  389.  
  390. If both checks succeed, authentication may be granted (the server may
  391. also require further authentication with other methods, without letting
  392. the client know at this point that authentication has partially
  393. succeeded).
  394.  
  395. 2.6.2.  Host-Based Authentication
  396.  
  397. Some sites wish to allow authentication based on the host where the user
  398. is coming from and the user name on the remote host.  While this form of
  399. authentication is not suitable for high-security sites, it can be very
  400. convenient in many environments.  The client requests this form of
  401. authentication by sending the following message.
  402.  
  403.             vlint32   SSH_MSG_USERAUTH_REQUEST
  404.             string    user
  405.             string    service
  406.             string    "hostbased"
  407.             string    public key algorithm for host key
  408.             string    public host key for client host
  409.             string    client host name
  410.             string    client user name
  411.  
  412.  
  413. Tatu Ylonen <ylo@ssh.fi>                                        [page 7]
  414.  
  415. INTERNET-DRAFT                                            March 22, 1997
  416.  
  417.             string    signature
  418.  
  419. The public key may contain certificates.  Public key algorithm names are
  420. defined in the transport layer protocol specification.
  421.  
  422. Signature is a signature by the host key of HASH of the concatenation of
  423. the following, in this order:
  424.  
  425. o  the session identifier (which binds the signature to the server host
  426.    key and the particular key exchange),
  427.  
  428. o  length of the user name as a 32-bit integer, msb first,
  429.  
  430. o  user name (without length or null characters),
  431.  
  432. o  length of the service name as a 32-bit integer, msb first,
  433.  
  434. o  service name (without length or null characters),
  435.  
  436. o  length of the public host key algorithm name as a 32-bit integer, msb
  437.    first,
  438.  
  439. o  public host key algorithm name (without length or null characters),
  440.  
  441. o  length of the public host key from the message as a 32-bit integer,
  442.    msb first,
  443.  
  444. o  the public host key from the message (without length or null
  445.    characters),
  446.  
  447. o  length of the client host name as a 32-bit integer, msb first,
  448.  
  449. o  client host name (without length or null characters),
  450.  
  451. o  length of the client user name as a 32-bit integer, msb first, and
  452.  
  453. o  client user name (without length or null characters).
  454.  
  455. Authentication is accepted if the server can verify that the host key
  456. actually belongs to the client host, the given user on that host is
  457. allowed to log in, and the signature is a valid signature on the
  458. appropriate value by the given host key.  (The server is also allowed to
  459. ignore the client user name, if it only wants to authenticate the client
  460. host.)
  461.  
  462. It is recommended that whenever possible, the server performs additional
  463. checks to verify that the network address obtained from the (untrusted)
  464. network matches the given client host name.  This makes exploiting
  465. compromised host keys more difficult.  Note that this may require
  466. special handling for connections coming through a firewall.
  467.  
  468. 2.6.3.  Kerberos Authentication
  469.  
  470.  
  471.  
  472. Tatu Ylonen <ylo@ssh.fi>                                        [page 8]
  473.  
  474. INTERNET-DRAFT                                            March 22, 1997
  475.  
  476. There are several ways to authenticate the user using Kerberos (OSF DCE
  477. and AFS are also incarnations of Kerberos).  Different versions of
  478. Kerberos (v4, v5, DCE, and AFS) have different capabilities.  Separate
  479. messages have been defined for each of these.  In each case, the server
  480. should respond with success or failure.
  481.  
  482.             vlint32   SSH_MSG_USERAUTH_REQUEST
  483.             string    user
  484.             string    service
  485.             string    "kerberos4"
  486.             string    kerberos v4 credentials
  487.  
  488.             vlint32   SSH_MSG_USERAUTH_REQUEST
  489.             string    user
  490.             string    service
  491.             string    "kerberos5"
  492.             string    kerberos v5 credentials
  493.             string    kerberos v5 ticket granting ticket (may be empty)
  494.  
  495.             vlint32   SSH_MSG_USERAUTH_REQUEST
  496.             string    user
  497.             string    service
  498.             string    "kerberos-afs"
  499.             string    AFS token
  500.  
  501. The Kerberos authentication requests should be sent before other
  502. authentication requests.  The other authentication methods may need to
  503. access files from the user's home directory, which may not be accessible
  504. until e.g. the AFS token has been passed.  Note that even if these
  505. requests fail, they may have side effects, such as making the home
  506. directory accessible.
  507.  
  508. 3.  When Authentication Is Complete
  509.  
  510. Authentication is complete when the server has responded with
  511. SSH_MSG_USERAUTH_SUCCESS.  Any SSH_MSG_USERAUTH_REQUEST messages
  512. received after sending this message will be silently ignored.
  513.  
  514. When sending SSH_MSG_USERAUTH_SUCCESS, the server also starts whatever
  515. application was requested as the service.  Any non-authentication
  516. messages received will be passed to the requested service.
  517.  
  518. 4.  Banner Message
  519.  
  520. The server may send a SSH_MSG_USERAUTH_BANNER message at any time.  This
  521. message contains a message to be displayed to the client user before
  522. attempting authentication.  On most Unix machines, this message is read
  523. from /etc/issue.  In some jurisdictions, sending a warning message
  524. before authentication may be relevant to getting legal protection.  The
  525. message may contain newlines.
  526.  
  527.             vlint32   SSH_MSG_USERAUTH_BANNER
  528.             string    message
  529.  
  530.  
  531. Tatu Ylonen <ylo@ssh.fi>                                        [page 9]
  532.  
  533. INTERNET-DRAFT                                            March 22, 1997
  534.  
  535. The client should normally display the message on screen if convenient.
  536. However, it may be sent on every login, and opening a separate window
  537. for it would probably be too annoying.  The client is thus free to
  538. ignore it, but displaying it should be possible at least if explicitly
  539. requested.
  540.  
  541. 5.  Message Numbers
  542.  
  543. All message numbers used by this authencation protocol are in the range
  544. 30..39, which is part of the range reserved for protocols running on top
  545. of the SSH transport layer protocol.  Message numbers above and
  546. including 40 are reserved for protocols running on top of this level.
  547. Receiving them before authentication is complete is an error, and the
  548. server must disconnect in this case.  After successful authentication,
  549. these messages are passed to the higher-level service.
  550.  
  551. The server should ignore any method-specific messages received while
  552. expecting an authentication request.  These might sometimes result if
  553. the client sends an authentication request that the server does not
  554. understand.
  555.  
  556. #define SSH_MSG_USERAUTH_BANNER         31
  557. #define SSH_MSG_USERAUTH_FAILURE        32
  558. #define SSH_MSG_USERAUTH_SUCCESS        33
  559. #define SSH_MSG_USERAUTH_REQUEST        34
  560.  
  561. /* Messages 35-39 are reserved for method-specific messages.
  562.    Different authentication methods may reuse the same message
  563.    numbers. */
  564. /* Key-based */
  565. #define SSH_MSG_USERAUTH_PK_OK          35
  566. /* One-time passwords */
  567. #define SSH_MSG_USERAUTH_OTP_PROMPT     35
  568. #define SSH_MSG_USERAUTH_OTP_RESPONSE   36
  569.  
  570. 6.  Address of Author
  571.  
  572.               Tatu Ylonen
  573.               SSH Communications Security Ltd.
  574.               Tekniikantie 12
  575.               FIN-02150 ESPOO
  576.               Finland
  577.  
  578.               E-mail: ylo@ssh.fi
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589. Tatu Ylonen <ylo@ssh.fi>                                       [page 10]
  590.