draft-ietf-secsh-userauth-16.txt   draft-ietf-secsh-userauth-17.txt 
Network Working Group T. Ylonen Network Working Group T. Ylonen
Internet-Draft T. Kivinen Internet-Draft T. Kivinen
Expires: March 21, 2003 SSH Communications Security Corp Expires: March 2, 2003 SSH Communications Security Corp
M. Saarinen M. Saarinen
University of Jyvaskyla University of Jyvaskyla
T. Rinne T. Rinne
S. Lehtinen S. Lehtinen
SSH Communications Security Corp SSH Communications Security Corp
September 20, 2002 September 2002
SSH Authentication Protocol SSH Authentication Protocol
draft-ietf-secsh-userauth-16.txt draft-ietf-secsh-userauth-17.txt
Status of this Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026. all provisions of Section 10 of RFC2026.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet- other groups may also distribute working documents as Internet-
Drafts. Drafts.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six
and may be updated, replaced, or obsoleted by other documents at any months and may be updated, replaced, or obsoleted by other
time. It is inappropriate to use Internet-Drafts as reference documents at any time. It is inappropriate to use Internet-Drafts
material or to cite them other than as "work in progress." as reference material or to cite them other than as "work in
progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on March 21, 2003. This Internet-Draft will expire on March 2, 2003.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2002). All Rights Reserved. Copyright (C) The Internet Society (2002). All Rights Reserved.
Abstract Abstract
SSH is a protocol for secure remote login and other secure network SSH is a protocol for secure remote login and other secure network
services over an insecure network. This document describes the SSH services over an insecure network. This document describes the
authentication protocol framework and public key, password, and host- SSH authentication protocol framework and public key, password,
based client authentication methods. Additional authentication and host-based client authentication methods. Additional
methods are described in separate documents. The SSH authentication authentication methods are described in separate documents. The
protocol runs on top of the SSH transport layer protocol and provides SSH authentication protocol runs on top of the SSH transport layer
a single authenticated tunnel for the SSH connection protocol. protocol and provides a single authenticated tunnel for the SSH
connection protocol.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. The Authentication Protocol Framework . . . . . . . . . . . . 3 2. The Authentication Protocol Framework . . . . . . . . . . . . 3
2.1 Authentication Requests . . . . . . . . . . . . . . . . . . . 4 2.1 Authentication Requests . . . . . . . . . . . . . . . . . . . 4
2.2 Responses to Authentication Requests . . . . . . . . . . . . . 4 2.2 Responses to Authentication Requests . . . . . . . . . . . . . 5
2.3 The "none" Authentication Request . . . . . . . . . . . . . . 6 2.3 The "none" Authentication Request . . . . . . . . . . . . . . 6
2.4 Completion of User Authentication . . . . . . . . . . . . . . 6 2.4 Completion of User Authentication . . . . . . . . . . . . . . 6
2.5 Banner Message . . . . . . . . . . . . . . . . . . . . . . . . 6 2.5 Banner Message . . . . . . . . . . . . . . . . . . . . . . . . 6
3. Authentication Protocol Message Numbers . . . . . . . . . . . 7 3. Authentication Protocol Message Numbers . . . . . . . . . . . 7
4. Public Key Authentication Method: publickey . . . . . . . . . 7 4. Public Key Authentication Method: publickey . . . . . . . . . 7
5. Password Authentication Method: password . . . . . . . . . . . 9 5. Password Authentication Method: password . . . . . . . . . . . 9
6. Host-Based Authentication: hostbased . . . . . . . . . . . . . 11 6. Host-Based Authentication: hostbased . . . . . . . . . . . . . 11
7. Security Considerations . . . . . . . . . . . . . . . . . . . 12 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12
8. Intellectual Property . . . . . . . . . . . . . . . . . . . . 13 8. Intellectual Property . . . . . . . . . . . . . . . . . . . . 12
9. Additional Information . . . . . . . . . . . . . . . . . . . . 13 9. Additional Information . . . . . . . . . . . . . . . . . . . . 13
References . . . . . . . . . . . . . . . . . . . . . . . . . . 13 References . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 14 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . 14
Full Copyright Statement . . . . . . . . . . . . . . . . . . . 15 Full Copyright Statement . . . . . . . . . . . . . . . . . . . 15
1. Introduction 1. Introduction
The SSH authentication protocol is a general-purpose user The SSH authentication protocol is a general-purpose user
authentication protocol. It is intended to be run over the SSH authentication protocol. It is intended to be run over the SSH
transport layer protocol [SSH-TRANS]. This protocol assumes that the transport layer protocol [SSH-TRANS]. This protocol assumes that
underlying protocols provide integrity and confidentiality the underlying protocols provide integrity and confidentiality
protection. protection.
This document should be read only after reading the SSH architecture This document should be read only after reading the SSH
document [SSH-ARCH]. This document freely uses terminology and architecture document [SSH-ARCH]. This document freely uses
notation from the architecture document without reference or further terminology and notation from the architecture document without
explanation. reference or further explanation.
The service name for this protocol is "ssh-userauth". The service name for this protocol is "ssh-userauth".
When this protocol starts, it receives the session identifier from When this protocol starts, it receives the session identifier from
the lower-level protocol (this is the exchange hash H from the first the lower-level protocol (this is the exchange hash H from the
key exchange). The session identifier uniquely identifies this first key exchange). The session identifier uniquely identifies
session and is suitable for signing in order to prove ownership of a this session and is suitable for signing in order to prove
private key. This protocol also needs to know whether the lower- ownership of a private key. This protocol also needs to know
level protocol provides confidentiality protection. whether the lower-level protocol provides confidentiality
protection.
2. The Authentication Protocol Framework 2. The Authentication Protocol Framework
The server drives the authentication by telling the client which The server drives the authentication by telling the client which
authentication methods can be used to continue the exchange at any authentication methods can be used to continue the exchange at any
given time. The client has the freedom to try the methods listed by given time. The client has the freedom to try the methods listed
the server in any order. This gives the server complete control over by the server in any order. This gives the server complete
the authentication process if desired, but also gives enough control over the authentication process if desired, but also gives
flexibility for the client to use the methods it supports or that are enough flexibility for the client to use the methods it supports
most convenient for the user, when multiple methods are offered by or that are most convenient for the user, when multiple methods
the server. are offered by the server.
Authentication methods are identified by their name, as defined in Authentication methods are identified by their name, as defined in
[SSH-ARCH]. The "none" method is reserved, and MUST NOT be listed as [SSH-ARCH]. The "none" method is reserved, and MUST NOT be listed
supported. However, it MAY be sent by the client. The server MUST as supported. However, it MAY be sent by the client. The server
always reject this request, unless the client is to be allowed in MUST always reject this request, unless the client is to be
without any authentication, in which case the server MUST accept this allowed in without any authentication, in which case the server
request. The main purpose of sending this request is to get the list MUST accept this request. The main purpose of sending this
of supported methods from the server. request is to get the list of supported methods from the server.
The server SHOULD have a timeout for authentication, and disconnect The server SHOULD have a timeout for authentication, and
if the authentication has not been accepted within the timeout disconnect if the authentication has not been accepted within the
period. The RECOMMENDED timeout period is 10 minutes. Additionally, timeout period. The RECOMMENDED timeout period is 10 minutes.
the implementation SHOULD limit the number of failed authentication Additionally, the implementation SHOULD limit the number of failed
attempts a client may perform in a single session (the RECOMMENDED authentication attempts a client may perform in a single session
limit is 20 attempts). If the threshold is exceeded, the server (the RECOMMENDED limit is 20 attempts). If the threshold is
SHOULD disconnect. exceeded, the server SHOULD disconnect.
2.1 Authentication Requests 2.1 Authentication Requests
All authentication requests MUST use the following message format. All authentication requests MUST use the following message format.
Only the first few fields are defined; the remaining fields depend on Only the first few fields are defined; the remaining fields depend
the authentication method. on the authentication method.
byte SSH_MSG_USERAUTH_REQUEST byte SSH_MSG_USERAUTH_REQUEST
string user name (in ISO-10646 UTF-8 encoding [RFC2279]) string user name (in ISO-10646 UTF-8 encoding [RFC2279])
string service name (in US-ASCII) string service name (in US-ASCII)
string method name (US-ASCII) string method name (US-ASCII)
The rest of the packet is method-specific. The rest of the packet is method-specific.
The user name and service are repeated in every new authentication The user name and service are repeated in every new authentication
attempt, and MAY change. The server implementation MUST carefully attempt, and MAY change. The server implementation MUST carefully
check them in every message, and MUST flush any accumulated check them in every message, and MUST flush any accumulated
authentication states if they change. If it is unable to flush some authentication states if they change. If it is unable to flush
authentication state, it MUST disconnect if the user or service name some authentication state, it MUST disconnect if the user or
changes. service name changes.
The service name specifies the service to start after authentication. The service name specifies the service to start after
There may be several different authenticated services provided. If authentication. There may be several different authenticated
the requested service is not available, the server MAY disconnect services provided. If the requested service is not available, the
immediately or at any later time. Sending a proper disconnect server MAY disconnect immediately or at any later time. Sending a
message is RECOMMENDED. In any case, if the service does not exist, proper disconnect message is RECOMMENDED. In any case, if the
authentication MUST NOT be accepted. service does not exist, authentication MUST NOT be accepted.
If the requested user does not exist, the server MAY disconnect, or If the requested user does not exist, the server MAY disconnect,
MAY send a bogus list of acceptable authentication methods, but never or MAY send a bogus list of acceptable authentication methods, but
accept any. This makes it possible for the server to avoid never accept any. This makes it possible for the server to avoid
disclosing information on which accounts exist. In any case, if the disclosing information on which accounts exist. In any case, if
user does not exist, the authentication request MUST NOT be accepted. the user does not exist, the authentication request MUST NOT be
accepted.
While there is usually little point for clients to send requests that While there is usually little point for clients to send requests
the server does not list as acceptable, sending such requests is not that the server does not list as acceptable, sending such requests
an error, and the server SHOULD simply reject requests that it does is not an error, and the server SHOULD simply reject requests that
not recognize. it does not recognize.
An authentication request MAY result in a further exchange of An authentication request MAY result in a further exchange of
messages. All such messages depend on the authentication method messages. All such messages depend on the authentication method
used, and the client MAY at any time continue with a new used, and the client MAY at any time continue with a new
SSH_MSG_USERAUTH_REQUEST message, in which case the server MUST SSH_MSG_USERAUTH_REQUEST message, in which case the server MUST
abandon the previous authentication attempt and continue with the new abandon the previous authentication attempt and continue with the
one. new one.
2.2 Responses to Authentication Requests 2.2 Responses to Authentication Requests
If the server rejects the authentication request, it MUST respond If the server rejects the authentication request, it MUST respond
with the following: with the following:
byte SSH_MSG_USERAUTH_FAILURE byte SSH_MSG_USERAUTH_FAILURE
string authentications that can continue string authentications that can continue
boolean partial success boolean partial success
"Authentications that can continue" is a comma-separated list of "Authentications that can continue" is a comma-separated list of
authentication method names that may productively continue the authentication method names that may productively continue the
authentication dialog. authentication dialog.
It is RECOMMENDED that servers only include those methods in the list It is RECOMMENDED that servers only include those methods in the
that are actually useful. However, it is not illegal to include list that are actually useful. However, it is not illegal to
methods that cannot be used to authenticate the user. include methods that cannot be used to authenticate the user.
Already successfully completed authentications SHOULD NOT be included Already successfully completed authentications SHOULD NOT be
in the list, unless they really should be performed again for some included in the list, unless they really should be performed again
reason. for some reason.
"Partial success" MUST be TRUE if the authentication request to which "Partial success" MUST be TRUE if the authentication request to
this is a response was successful. It MUST be FALSE if the request which this is a response was successful. It MUST be FALSE if the
was not successfully processed. request was not successfully processed.
When the server accepts authentication, it MUST respond with the When the server accepts authentication, it MUST respond with the
following: following:
byte SSH_MSG_USERAUTH_SUCCESS byte SSH_MSG_USERAUTH_SUCCESS
Note that this is not sent after each step in a multi-method Note that this is not sent after each step in a multi-method
authentication sequence, but only when the authentication is authentication sequence, but only when the authentication is
complete. complete.
The client MAY send several authentication requests without waiting The client MAY send several authentication requests without
for responses from previous requests. The server MUST process each waiting for responses from previous requests. The server MUST
request completely and acknowledge any failed requests with a process each request completely and acknowledge any failed
SSH_MSG_USERAUTH_FAILURE message before processing the next request. requests with a SSH_MSG_USERAUTH_FAILURE message before processing
the next request.
A request that results in further exchange of messages will be A request that results in further exchange of messages will be
aborted by a second request. It is not possible to send a second aborted by a second request. It is not possible to send a second
request without waiting for a response from the server, if the first request without waiting for a response from the server, if the
request will result in further exchange of messages. No first request will result in further exchange of messages. No
SSH_MSG_USERAUTH_FAILURE message will be sent for the aborted method. SSH_MSG_USERAUTH_FAILURE message will be sent for the aborted
method.
SSH_MSG_USERAUTH_SUCCESS MUST be sent only once. When SSH_MSG_USERAUTH_SUCCESS MUST be sent only once. When
SSH_MSG_USERAUTH_SUCCESS has been sent, any further authentication SSH_MSG_USERAUTH_SUCCESS has been sent, any further authentication
requests received after that SHOULD be silently ignored. requests received after that SHOULD be silently ignored.
Any non-authentication messages sent by the client after the request Any non-authentication messages sent by the client after the
that resulted in SSH_MSG_USERAUTH_SUCCESS being sent MUST be passed request that resulted in SSH_MSG_USERAUTH_SUCCESS being sent MUST
to the service being run on top of this protocol. Such messages can be passed to the service being run on top of this protocol. Such
be identified by their message numbers (see Section Message Numbers messages can be identified by their message numbers (see Section
(Section 3)). Message Numbers (Section 3)).
2.3 The "none" Authentication Request 2.3 The "none" Authentication Request
A client may request a list of authentication methods that may A client may request a list of authentication methods that may
continue by using the "none" authentication method. continue by using the "none" authentication method.
If no authentication at all is needed for the user, the server MUST If no authentication at all is needed for the user, the server
return SSH_MSG_USERAUTH_SUCCESS. Otherwise, the server MUST return MUST return SSH_MSG_USERAUTH_SUCCESS. Otherwise, the server MUST
SSH_MSG_USERAUTH_FAILURE and MAY return with it a list of return SSH_MSG_USERAUTH_FAILURE and MAY return with it a list of
authentication methods that can continue. authentication methods that can continue.
This method MUST NOT be listed as supported by the server. This method MUST NOT be listed as supported by the server.
2.4 Completion of User Authentication 2.4 Completion of User Authentication
Authentication is complete when the server has responded with Authentication is complete when the server has responded with
SSH_MSG_USERAUTH_SUCCESS; all authentication related messages SSH_MSG_USERAUTH_SUCCESS; all authentication related messages
received after sending this message SHOULD be silently ignored. received after sending this message SHOULD be silently ignored.
After sending SSH_MSG_USERAUTH_SUCCESS, the server starts the After sending SSH_MSG_USERAUTH_SUCCESS, the server starts the
requested service. requested service.
2.5 Banner Message 2.5 Banner Message
In some jurisdictions, sending a warning message before In some jurisdictions, sending a warning message before
authentication may be relevant for getting legal protection. Many authentication may be relevant for getting legal protection. Many
UNIX machines, for example, normally display text from `/etc/issue', UNIX machines, for example, normally display text from
or use "tcp wrappers" or similar software to display a banner before `/etc/issue', or use "tcp wrappers" or similar software to display
issuing a login prompt. a banner before issuing a login prompt.
The SSH server may send a SSH_MSG_USERAUTH_BANNER message at any time The SSH server may send a SSH_MSG_USERAUTH_BANNER message at any
before authentication is successful. This message contains text to time before authentication is successful. This message contains
be displayed to the client user before authentication is attempted. text to be displayed to the client user before authentication is
The format is as follows: attempted. The format is as follows:
byte SSH_MSG_USERAUTH_BANNER byte SSH_MSG_USERAUTH_BANNER
string message (ISO-10646 UTF-8) string message (ISO-10646 UTF-8)
string language tag (as defined in [RFC1766]) string language tag (as defined in [RFC1766])
The client SHOULD by default display the message on the screen. The client SHOULD by default display the message on the screen.
However, since the message is likely to be sent for every login However, since the message is likely to be sent for every login
attempt, and since some client software will need to open a separate attempt, and since some client software will need to open a
window for this warning, the client software may allow the user to separate window for this warning, the client software may allow
explicitly disable the display of banners from the server. The the user to explicitly disable the display of banners from the
message may consist of multiple lines. server. The message may consist of multiple lines.
If the message string is displayed, control character filtering If the message string is displayed, control character filtering
discussed in [SSH-ARCH] SHOULD be used to avoid attacks by sending discussed in [SSH-ARCH] SHOULD be used to avoid attacks by sending
terminal control characters. terminal control characters.
3. Authentication Protocol Message Numbers 3. Authentication Protocol Message Numbers
All message numbers used by this authentication protocol are in the All message numbers used by this authentication protocol are in
range from 50 to 79, which is part of the range reserved for the range from 50 to 79, which is part of the range reserved for
protocols running on top of the SSH transport layer protocol. protocols running on top of the SSH transport layer protocol.
Message numbers of 80 and higher are reserved for protocols running Message numbers of 80 and higher are reserved for protocols
after this authentication protocol, so receiving one of them before running after this authentication protocol, so receiving one of
authentication is complete is an error, to which the server MUST them before authentication is complete is an error, to which the
respond by disconnecting (preferably with a proper disconnect message server MUST respond by disconnecting (preferably with a proper
sent first to ease troubleshooting). disconnect message sent first to ease troubleshooting).
After successful authentication, such messages are passed to the After successful authentication, such messages are passed to the
higher-level service. higher-level service.
These are the general authentication message codes: These are the general authentication message codes:
#define SSH_MSG_USERAUTH_REQUEST 50 #define SSH_MSG_USERAUTH_REQUEST 50
#define SSH_MSG_USERAUTH_FAILURE 51 #define SSH_MSG_USERAUTH_FAILURE 51
#define SSH_MSG_USERAUTH_SUCCESS 52 #define SSH_MSG_USERAUTH_SUCCESS 52
#define SSH_MSG_USERAUTH_BANNER 53 #define SSH_MSG_USERAUTH_BANNER 53
In addition to the above, there is a range of message numbers In addition to the above, there is a range of message numbers
(60..79) reserved for method-specific messages. These messages are (60..79) reserved for method-specific messages. These messages
only sent by the server (client sends only SSH_MSG_USERAUTH_REQUEST are only sent by the server (client sends only
messages). Different authentication methods reuse the same message SSH_MSG_USERAUTH_REQUEST messages). Different authentication
numbers. methods reuse the same message numbers.
4. Public Key Authentication Method: publickey 4. Public Key Authentication Method: publickey
The only REQUIRED authentication method is public key authentication. The only REQUIRED authentication method is public key
All implementations MUST support this method; however, not all users authentication. All implementations MUST support this method;
need to have public keys, and most local policies are not likely to however, not all users need to have public keys, and most local
require public key authentication for all users in the near future. policies are not likely to require public key authentication for
all users in the near future.
With this method, the possession of a private key serves as With this method, the possession of a private key serves as
authentication. This method works by sending a signature created authentication. This method works by sending a signature created
with a private key of the user. The server MUST check that the key with a private key of the user. The server MUST check that the
is a valid authenticator for the user, and MUST check that the key is a valid authenticator for the user, and MUST check that the
signature is valid. If both hold, the authentication request MUST be signature is valid. If both hold, the authentication request MUST
accepted; otherwise it MUST be rejected. (Note that the server MAY be accepted; otherwise it MUST be rejected. (Note that the server
require additional authentications after successful authentication.) MAY require additional authentications after successful
authentication.)
Private keys are often stored in an encrypted form at the client Private keys are often stored in an encrypted form at the client
host, and the user must supply a passphrase before the signature can host, and the user must supply a passphrase before the signature
be generated. Even if they are not, the signing operation involves can be generated. Even if they are not, the signing operation
some expensive computation. To avoid unnecessary processing and user involves some expensive computation. To avoid unnecessary
interaction, the following message is provided for querying whether processing and user interaction, the following message is provided
authentication using the key would be acceptable. for querying whether authentication using the key would be
acceptable.
byte SSH_MSG_USERAUTH_REQUEST byte SSH_MSG_USERAUTH_REQUEST
string user name string user name
string service string service
string "publickey" string "publickey"
boolean FALSE boolean FALSE
string public key algorithm name string public key algorithm name
string public key blob string public key blob
Public key algorithms are defined in the transport layer Public key algorithms are defined in the transport layer
specification [SSH-TRANS]. The public key blob may contain specification [SSH-TRANS]. The public key blob may contain
certificates. certificates.
Any public key algorithm may be offered for use in authentication. Any public key algorithm may be offered for use in authentication.
In particular, the list is not constrained by what was negotiated In particular, the list is not constrained by what was negotiated
during key exchange. If the server does not support some algorithm, during key exchange. If the server does not support some
it MUST simply reject the request. algorithm, it MUST simply reject the request.
The server MUST respond to this message with either The server MUST respond to this message with either
SSH_MSG_USERAUTH_FAILURE or with the following: SSH_MSG_USERAUTH_FAILURE or with the following:
byte SSH_MSG_USERAUTH_PK_OK byte SSH_MSG_USERAUTH_PK_OK
string public key algorithm name from the request string public key algorithm name from the request
string public key blob from the request string public key blob from the request
To perform actual authentication, the client MAY then send a To perform actual authentication, the client MAY then send a
signature generated using the private key. The client MAY send the signature generated using the private key. The client MAY send
signature directly without first verifying whether the key is the signature directly without first verifying whether the key is
acceptable. The signature is sent using the following packet: acceptable. The signature is sent using the following packet:
byte SSH_MSG_USERAUTH_REQUEST byte SSH_MSG_USERAUTH_REQUEST
string user name string user name
string service string service
string "publickey" string "publickey"
boolean TRUE boolean TRUE
string public key algorithm name string public key algorithm name
string public key to be used for authentication string public key to be used for authentication
string signature string signature
skipping to change at page 9, line 17 skipping to change at page 9, line 27
boolean TRUE boolean TRUE
string public key algorithm name string public key algorithm name
string public key to be used for authentication string public key to be used for authentication
When the server receives this message, it MUST check whether the When the server receives this message, it MUST check whether the
supplied key is acceptable for authentication, and if so, it MUST supplied key is acceptable for authentication, and if so, it MUST
check whether the signature is correct. check whether the signature is correct.
If both checks succeed, this method is successful. Note that the If both checks succeed, this method is successful. Note that the
server may require additional authentications. The server MUST server may require additional authentications. The server MUST
respond with SSH_MSG_USERAUTH_SUCCESS (if no more authentications are respond with SSH_MSG_USERAUTH_SUCCESS (if no more authentications
needed), or SSH_MSG_USERAUTH_FAILURE (if the request failed, or more are needed), or SSH_MSG_USERAUTH_FAILURE (if the request failed,
authentications are needed). or more authentications are needed).
The following method-specific message numbers are used by the The following method-specific message numbers are used by the
publickey authentication method. publickey authentication method.
/* Key-based */ /* Key-based */
#define SSH_MSG_USERAUTH_PK_OK 60 #define SSH_MSG_USERAUTH_PK_OK 60
5. Password Authentication Method: password 5. Password Authentication Method: password
Password authentication uses the following packets. Note that a Password authentication uses the following packets. Note that a
skipping to change at page 9, line 42 skipping to change at page 10, line 5
byte SSH_MSG_USERAUTH_REQUEST byte SSH_MSG_USERAUTH_REQUEST
string user name string user name
string service string service
string "password" string "password"
boolean FALSE boolean FALSE
string plaintext password (ISO-10646 UTF-8) string plaintext password (ISO-10646 UTF-8)
Note that the password is encoded in ISO-10646 UTF-8. It is up to Note that the password is encoded in ISO-10646 UTF-8. It is up to
the server how it interprets the password and validates it against the server how it interprets the password and validates it against
the password database. However, if the client reads the password in the password database. However, if the client reads the password
some other encoding (e.g., ISO 8859-1 (ISO Latin1)), it MUST convert in some other encoding (e.g., ISO 8859-1 (ISO Latin1)), it MUST
the password to ISO-10646 UTF-8 before transmitting, and the server convert the password to ISO-10646 UTF-8 before transmitting, and
MUST convert the password to the encoding used on that system for the server MUST convert the password to the encoding used on that
passwords. system for passwords.
Note that even though the cleartext password is transmitted in the Note that even though the cleartext password is transmitted in the
packet, the entire packet is encrypted by the transport layer. Both packet, the entire packet is encrypted by the transport layer.
the server and the client should check whether the underlying Both the server and the client should check whether the underlying
transport layer provides confidentiality (i.e., if encryption is transport layer provides confidentiality (i.e., if encryption is
being used). If no confidentiality is provided (none cipher), being used). If no confidentiality is provided (none cipher),
password authentication SHOULD be disabled. If there is no password authentication SHOULD be disabled. If there is no
confidentiality or no MAC, password change SHOULD be disabled. confidentiality or no MAC, password change SHOULD be disabled.
Normally, the server responds to this message with success or Normally, the server responds to this message with success or
failure. However, if the password has expired the server SHOULD failure. However, if the password has expired the server SHOULD
indicate this by responding with SSH_MSG_USERAUTH_PASSWD_CHANGEREQ. indicate this by responding with
In anycase the server MUST NOT allow an expired password to be used SSH_MSG_USERAUTH_PASSWD_CHANGEREQ. In anycase the server MUST NOT
for authentication. allow an expired password to be used for authentication.
byte SSH_MSG_USERAUTH_PASSWD_CHANGEREQ byte SSH_MSG_USERAUTH_PASSWD_CHANGEREQ
string prompt (ISO-10646 UTF-8) string prompt (ISO-10646 UTF-8)
string language tag (as defined in [RFC1766]) string language tag (as defined in [RFC1766])
In this case, the client MAY continue with a different authentication In this case, the client MAY continue with a different
method, or request a new password from the user and retry password authentication method, or request a new password from the user and
authentication using the following message. The client MAY also send retry password authentication using the following message. The
this message instead of the normal password authentication request client MAY also send this message instead of the normal password
without the server asking for it. authentication request without the server asking for it.
byte SSH_MSG_USERAUTH_REQUEST byte SSH_MSG_USERAUTH_REQUEST
string user name string user name
string service string service
string "password" string "password"
boolean TRUE boolean TRUE
string plaintext old password (ISO-10646 UTF-8) string plaintext old password (ISO-10646 UTF-8)
string plaintext new password (ISO-10646 UTF-8) string plaintext new password (ISO-10646 UTF-8)
The server must reply to request message with The server must reply to request message with
SSH_MSG_USERAUTH_SUCCESS, SSH_MSG_USERAUTH_FAILURE, or another SSH_MSG_USERAUTH_SUCCESS, SSH_MSG_USERAUTH_FAILURE, or another
SSH_MSG_USERAUTH_PASSWD_CHANGEREQ. The meaning of these is as SSH_MSG_USERAUTH_PASSWD_CHANGEREQ. The meaning of these is as
follows: follows:
SSH_MSG_USERAUTH_SUCCESS The password has been changed, and SSH_MSG_USERAUTH_SUCCESS The password has been changed, and
authentication has been successfully completed. authentication has been successfully completed.
SSH_MSG_USERAUTH_FAILURE with partial success The password has SSH_MSG_USERAUTH_FAILURE with partial success The password has
been changed, but more authentications are needed. been changed, but more authentications are needed.
SSH_MSG_USERAUTH_FAILURE without partial success The password has SSH_MSG_USERAUTH_FAILURE without partial success The password
not been changed. Either password changing was not supported, or has not been changed. Either password changing was not
the old password was bad. Note that if the server has already supported, or the old password was bad. Note that if the
sent SSH_MSG_USERAUTH_PASSWD_CHANGEREQ, we know that it supports server has already sent SSH_MSG_USERAUTH_PASSWD_CHANGEREQ, we
changing the password. know that it supports changing the password.
SSH_MSG_USERAUTH_CHANGEREQ The password was not changed because SSH_MSG_USERAUTH_CHANGEREQ The password was not changed because
the new password was not acceptable (e.g. too easy to guess). the new password was not acceptable (e.g. too easy to guess).
The following method-specific message numbers are used by the The following method-specific message numbers are used by the
password authentication method. password authentication method.
#define SSH_MSG_USERAUTH_PASSWD_CHANGEREQ 60 #define SSH_MSG_USERAUTH_PASSWD_CHANGEREQ 60
6. Host-Based Authentication: hostbased 6. Host-Based Authentication: hostbased
Some sites wish to allow authentication based on the host where the Some sites wish to allow authentication based on the host where
user is coming from, and the user name on the remote host. While the user is coming from, and the user name on the remote host.
this form of authentication is not suitable for high-security sites, While this form of authentication is not suitable for high-
it can be very convenient in many environments. This form of security sites, it can be very convenient in many environments.
authentication is OPTIONAL. When used, special care SHOULD be taken This form of authentication is OPTIONAL. When used, special care
to prevent a regular user from obtaining the private host key. SHOULD be taken to prevent a regular user from obtaining the
private host key.
The client requests this form of authentication by sending the The client requests this form of authentication by sending the
following message. It is similar to the UNIX "rhosts" and following message. It is similar to the UNIX "rhosts" and
"hosts.equiv" styles of authentication, except that the identity of "hosts.equiv" styles of authentication, except that the identity
the client host is checked more rigorously. of the client host is checked more rigorously.
This method works by having the client send a signature created with This method works by having the client send a signature created
the private key of the client host, which the server checks with that with the private key of the client host, which the server checks
host's public key. Once the client host's identity is established, with that host's public key. Once the client host's identity is
authorization (but no further authentication) is performed based on established, authorization (but no further authentication) is
the user names on the server and the client, and the client host performed based on the user names on the server and the client,
name. and the client host name.
byte SSH_MSG_USERAUTH_REQUEST byte SSH_MSG_USERAUTH_REQUEST
string user name string user name
string service string service
string "hostbased" string "hostbased"
string public key algorithm for host key string public key algorithm for host key
string public host key and certificates for client host string public host key and certificates for client host
string client host name (FQDN; US-ASCII) string client host name (FQDN; US-ASCII)
string user name on the client host (ISO-10646 UTF-8) string user name on the client host (ISO-10646 UTF-8)
string signature string signature
Public key algorithm names for use in "public key algorithm for
host key" are defined in the transport layer specification. The
"public host key for client host" may include certificates.
Public key algorithm names for use in "public key algorithm for host Signature is a signature with the private host key of the
key" are defined in the transport layer specification. The "public following data, in this order:
host key for client host" may include certificates.
Signature is a signature with the private host key of the following
data, in this order:
string session identifier string session identifier
byte SSH_MSG_USERAUTH_REQUEST byte SSH_MSG_USERAUTH_REQUEST
string user name string user name
string service string service
string "hostbased" string "hostbased"
string public key algorithm for host key string public key algorithm for host key
string public host key and certificates for client host string public host key and certificates for client host
string client host name (FQDN; US-ASCII) string client host name (FQDN; US-ASCII)
string user name on the client host(ISO-10646 UTF-8) string user name on the client host(ISO-10646 UTF-8)
The server MUST verify that the host key actually belongs to the The server MUST verify that the host key actually belongs to the
client host named in the message, that the given user on that host is client host named in the message, that the given user on that host
allowed to log in, and that the signature is a valid signature on the is allowed to log in, and that the signature is a valid signature
appropriate value by the given host key. The server MAY ignore the on the appropriate value by the given host key. The server MAY
client user name, if it wants to authenticate only the client host. ignore the client user name, if it wants to authenticate only the
client host.
It is RECOMMENDED that whenever possible, the server perform It is RECOMMENDED that whenever possible, the server perform
additional checks to verify that the network address obtained from additional checks to verify that the network address obtained from
the (untrusted) network matches the given client host name. This the (untrusted) network matches the given client host name. This
makes exploiting compromised host keys more difficult. Note that makes exploiting compromised host keys more difficult. Note that
this may require special handling for connections coming through a this may require special handling for connections coming through a
firewall. firewall.
7. Security Considerations 7. Security Considerations
The purpose of this protocol is to perform client user The purpose of this protocol is to perform client user
authentication. It assumed that this runs over a secure transport authentication. It assumed that this runs over a secure transport
layer protocol, which has already authenticated the server machine, layer protocol, which has already authenticated the server
established an encrypted communications channel, and computed a machine, established an encrypted communications channel, and
unique session identifier for this session. The transport layer computed a unique session identifier for this session. The
provides forward secrecy for password authentication and other transport layer provides forward secrecy for password
methods that rely on secret data. authentication and other methods that rely on secret data.
The server may go into a "sleep" period after repeated unsuccessful
authentications to make key search harder.
If the transport layer does not provide encryption, authentication
methods that rely on secret data SHOULD be disabled. If it does not
provide MAC protection, requests to change authentication data (e.g.
password change) SHOULD be disabled to avoid an attacker from
modifying the ciphertext without being noticed, rendering the new
authentication data unusable (denial of service).
Several authentication methods with different security
characteristics are allowed. It is up to the server's local policy
to decide which methods (or combinations of methods) it is willing to
accept for each user. Authentication is no stronger than the weakest
combination allowed.
Special care should be taken when designing debug messages. These Full security considerations for this protocol are provided in
messages may reveal surprising amounts of information about the host Section 8 of [SSH-ARCH]
if not properly designed. Debug messages can be disabled (during
user authentication phase) if high security is required.
8. Intellectual Property 8. Intellectual Property
The IETF takes no position regarding the validity or scope of any The IETF takes no position regarding the validity or scope of any
intellectual property or other rights that might be claimed to intellectual property or other rights that might be claimed to
pertain to the implementation or use of the technology described in pertain to the implementation or use of the technology described
this document or the extent to which any license under such rights in this document or the extent to which any license under such
might or might not be available; neither does it represent that it rights might or might not be available; neither does it represent
has made any effort to identify any such rights. Information on the that it has made any effort to identify any such rights.
IETF's procedures with respect to rights in standards-track and Information on the IETF's procedures with respect to rights in
standards-related documentation can be found in BCP-11. Copies of standards-track and standards-related documentation can be found
claims of rights made available for publication and any assurances of in BCP-11. Copies of claims of rights made available for
licenses to be made available, or the result of an attempt made to publication and any assurances of licenses to be made available,
obtain a general license or permission for the use of such or the result of an attempt made to obtain a general license or
proprietary rights by implementers or users of this specification can permission for the use of such proprietary rights by implementers
be obtained from the IETF Secretariat. or users of this specification can be obtained from the IETF
Secretariat.
The IETF has been notified of intellectual property rights claimed in The IETF has been notified of intellectual property rights claimed
regard to some or all of the specification contained in this in regard to some or all of the specification contained in this
document. For more information consult the online list of claimed document. For more information consult the online list of claimed
rights. rights.
9. Additional Information 9. Additional Information
The current document editor is: Darren.Moffat@Sun.COM. Comments on The current document editor is: Darren.Moffat@Sun.COM. Comments
this internet draft should be sent to the IETF SECSH working group, on this internet draft should be sent to the IETF SECSH working
details at: http://ietf.org/html.charters/secsh-charter.html group, details at: http://ietf.org/html.charters/secsh-
charter.html
References References
[RFC1766] Alvestrand, H., "Tags for the Identification of [RFC1766] Alvestrand, H., "Tags for the Identification of
Languages", RFC 1766, March 1995. Languages", RFC 1766, March 1995.
[RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO [RFC2279] Yergeau, F., "UTF-8, a transformation format of
10646", RFC 2279, January 1998. ISO 10646", RFC 2279, January 1998.
[SSH-ARCH] Ylonen, T., "SSH Protocol Architecture", I-D draft- [SSH-ARCH] Ylonen, T., "SSH Protocol Architecture", I-D
ietf-architecture-13.txt, September 2002. draft-ietf-architecture-14.txt, July 2003.
[SSH-TRANS] Ylonen, T., "SSH Transport Layer Protocol", I-D [SSH-TRANS] Ylonen, T., "SSH Transport Layer Protocol", I-D
draft-ietf-transport-15.txt, September 2002. draft-ietf-transport-16.txt, July 2003.
[SSH-USERAUTH] Ylonen, T., "SSH Authentication Protocol", I-D draft- [SSH-USERAUTH] Ylonen, T., "SSH Authentication Protocol", I-D
ietf-userauth-16.txt, September 2002. draft-ietf-userauth-17.txt, July 2003.
[SSH-CONNECT] Ylonen, T., "SSH Connection Protocol", I-D draft- [SSH-CONNECT] Ylonen, T., "SSH Connection Protocol", I-D draft-
ietf-connect-16.txt, September 2002. ietf-connect-17.txt, July 2003.
[SSH-NUMBERS] Lehtinen, S. and D. Moffat, "SSH Protocol Assigned
Numbers", I-D draft-ietf-secsh-assignednumbers-
03.txt, July 2003.
Authors' Addresses Authors' Addresses
Tatu Ylonen Tatu Ylonen
SSH Communications Security Corp SSH Communications Security Corp
Fredrikinkatu 42 Fredrikinkatu 42
HELSINKI FIN-00100 HELSINKI FIN-00100
Finland Finland
EMail: ylo@ssh.com EMail: ylo@ssh.com
skipping to change at page 15, line 9 skipping to change at page 15, line 9
Fredrikinkatu 42 Fredrikinkatu 42
HELSINKI FIN-00100 HELSINKI FIN-00100
Finland Finland
EMail: sjl@ssh.com EMail: sjl@ssh.com
Full Copyright Statement Full Copyright Statement
Copyright (C) The Internet Society (2002). All Rights Reserved. Copyright (C) The Internet Society (2002). All Rights Reserved.
This document and translations of it may be copied and furnished to This document and translations of it may be copied and furnished
others, and derivative works that comment on or otherwise explain it to others, and derivative works that comment on or otherwise
or assist in its implementation may be prepared, copied, published explain it or assist in its implementation may be prepared,
and distributed, in whole or in part, without restriction of any copied, published and distributed, in whole or in part, without
kind, provided that the above copyright notice and this paragraph are restriction of any kind, provided that the above copyright notice
included on all such copies and derivative works. However, this and this paragraph are included on all such copies and derivative
document itself may not be modified in any way, such as by removing works. However, this document itself may not be modified in any
the copyright notice or references to the Internet Society or other way, such as by removing the copyright notice or references to the
Internet organizations, except as needed for the purpose of Internet Society or other Internet organizations, except as needed
developing Internet standards in which case the procedures for for the purpose of developing Internet standards in which case the
copyrights defined in the Internet Standards process must be procedures for copyrights defined in the Internet Standards
followed, or as required to translate it into languages other than process must be followed, or as required to translate it into
English. languages other than English.
The limited permissions granted above are perpetual and will not be The limited permissions granted above are perpetual and will not
revoked by the Internet Society or its successors or assigns. be revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an This document and the information contained herein is provided on
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement Acknowledgement
Funding for the RFC Editor function is currently provided by the Funding for the RFC Editor function is currently provided by the
Internet Society. Internet Society.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/