Re: Explanation of SSH

From: Richard E. Silverman (res_at_qoxp.net)
Date: 06/26/04

  • Next message: Carlos N: "Limit which ports are forwarded ---- and thanks to all!"
    Date: 26 Jun 2004 16:12:51 -0400
    
    

    > ]Please either point me to a web page; or enable my understanding of
    > ]the following; or even both.

    http://www.snailbook.com/protocols.html

    > ]Steps in SSH connection setup;
    > ]1. Client issues SSH command and names server
    > ]2. "Shopper" says "server sends back its public host and server keys
    > ]to client". You what? Surely there is only one public key it sends
    > ]back, and "host and server keys" means just one public key?
    >
    > Usually.

    No, this is wrong. First, be aware that there are two major versions of
    the SSH protocol, 1 and 2. It sounds as if the description you read is of
    SSH-1, which is unfortunate because SSH-1 is long since deprecated and
    falling out of use (albeit slowly). In SSH-1, the "host key" is the
    long-term asymmetric keypair used to identify an SSH server, while the
    "server key" is an ephemeral keypair -- typically replaced once per hour
    by the server, never stored anywhere, and used to provide forward secrecy
    for the symmetric keying material.

    > ]3. Client adds server key(s?) to its knownhosts file if it isn't there
    > ]already.

    It's important to distinguish between how SSH (the protocol) works, and
    the details of particular implementations. The protocol says nothing
    about "known-host files," or even how to store keys on disk. An SSH
    client should verify that the host key it receives corresponds to the
    machine the user intended to contact. One simple way is to have a file of
    name/key associations: the known-hosts file. If the key at hand is
    missing, an SSH client may give the user the option of adding the present
    key/name association to the file -- perhaps the key's fingerprint
    is available to check, or perhaps the user is willing to incur the risk of
    an MITM attack on this connection, given the circumstances.

    The known-hosts mechanism is simple, but clumsy and unscalable. In
    environments where more infrastructure is available, SSH can fall back on
    existing services for host (and user) authentication/authorization:
    e.g. Kerberos or an X.509 PKI.

    > ]4. Shopper says, "Client generates 256 bit random number which it
    > ]encrypts using server and client public keys." What is the 256 bit
    > ]random number? Is this the client's private key?

    No; you're confusing two separate phases of the SSH protocol. The
    description is still talking about setup of the secure channel, in which
    only the host is authenticated. If the client has an asymmetric keypair,
    it's for user authentication, which hasn't happened yet -- and it may not
    have such a key, if for instance it uses password authentication rather
    than publickey.

    The "256-bit key" is the shared secret for securing communication on this
    SSH connection.

    Also, again, this description is of SSH-1; SSH-2 is modular with respect
    to this part of the protocol (the "key exchange" portion of SSH-TRANS), so
    different things might happen -- and even the most common exchange method
    in SSH-2 is more sophisticated and secure than this.

    -- 
      Richard Silverman
      res@qoxp.net
    

  • Next message: Carlos N: "Limit which ports are forwarded ---- and thanks to all!"

    Relevant Pages

    • Re: ssh security question
      ... In my case - the client is a windows client and the ssh is embedded into the windows nx client. ... Is there any reason I can't run ssh-keygen on the server and copy the private key to the client - and the public key to the "authorised" directory? ... sniffer can catch your passwords, and it would make it trivial to log in ...
      (SSH)
    • Re: Publishing a SSH Server
      ... Your unix box cannot reply to SSH request, ... Create a client address set for your unix box (ip address from to are the ... Jim Harrison [ISA SE] ... In that case the server is a SecureNET client but still it doesn't work.... ...
      (microsoft.public.isa.publishing)
    • Re: FC6 VPN
      ... Then you can run any application you would like off the server by simply running it, or if you want to run a whole session, use gnomesession. ... ssh client that supports X forwarding, which is want you want to be looking at. ... SSH allows you to forward any local port to any remote port. ... If you need to connect to, say a windows share, you would forward your local port to the linux server through the ssh tunnel. ...
      (Fedora)
    • Re: Password less login between client & server, server & client
      ... password less logins on both the ssh client and ssh server. ... Login as the user that is making the connection. ...
      (comp.security.ssh)
    • Re: Is it possible to tunnel X-Window data across many servers?
      ... SSH Version 1.2.30, protocol version 1.5. ... Waiting for server public key. ... QA_servB.com: Remote: X11 forwarding disabled in server configuration file. ...
      (comp.security.ssh)