A signature on the exchange hash value derived from the newly established shared secret value is used to authenticate the server to the client. Servers
MUST be authenticated using digital signatures. The public key algorithm implemented
MUST be ecdsa-sha2-nistp384 or rsa-sha2-512. The RSA public key modulus
MUST be 3072 or 4096 bits in size; clients
MUST NOT accept RSA signatures from a public key modulus of any other size.
The following public key algorithms
MUST be used:
The client
MUST verify that the presented key is a valid authenticator for the server before verifying the server signature. If possible, validation
SHOULD be done using certificates. Otherwise, the client
MUST validate the presented public key through some other secure, possibly off-line mechanism. Implementations
MUST NOT employ a "Trust on First Use (TOFU)" security model where a client accepts the first public host key presented to it from a not-yet-verified server. Use of a TOFU model would allow an intermediate adversary to present itself to the client as the server.
Where X.509 v3 Certificates are used, their use
MUST comply with [
RFC 8603].
The Secure Shell Transport Layer Protocol authenticates the server to the host but does not authenticate the user (or the user's host) to the server. All users
MUST be authenticated,
MUST follow [
RFC 4252], and
SHOULD be authenticated using a public key method. Users
MAY authenticate using passwords. Other methods of authentication
MUST not be used, including "none".
When authenticating with public key, the following public key algorithms
MUST be used:
The server
MUST verify that the public key is a valid authenticator for the user. If possible, validation
SHOULD be done using certificates. Otherwise, the server must validate the public key through another secure, possibly off-line mechanism.
Where X.509 v3 Certificates are used, their use
MUST comply with [
RFC 8603].
If authenticating with RSA, the client's public key modulus
MUST be 3072 or 4096 bits in size, and the server
MUST NOT accept signatures from an RSA public key modulus of any other size.
To facilitate client authentication with RSA using SHA-512, clients and servers
SHOULD implement the server-sig-algs extension, as specified in [
RFC 8308]. In that case, in the SSH_MSG_KEXINIT, the client
SHALL include the indicator ext-info-c to the kex_algorithms field, and the server
SHOULD respond with an SSH_MSG_EXT_INFO message containing the server-sig-algs extension. The server
MUST list only ecdsa-sha2-nistp384 and/or rsa-sha2-512 as the acceptable public key algorithms in this response.
If authenticating by passwords, it is essential that passwords have sufficient entropy to protect against dictionary attacks. During authentication, the password
MUST be protected in the established encrypted communications channel. Additional guidelines are provided in [
SP80063].