Networking | Programming | Security | Linux | Computer Science | About

How the SSH protocol works

The operation of the SSH protocol can be summarized in the following steps:

  1. The client initiates a TCP connection on port 22 of the service. This port is the one that uses the protocol by default, although as we will see in the following steps, it can be modified.

  2. The client and the server agree on the version of the protocol to be used, as well as the encryption algorithm used for the exchange of information.

  3. The server, which has two keys (one private and one public), sends its public key to the client. 4. When the client receives the key sent by the server, it compares it with the one stored to verify its authenticity. The SSH protocol requires the client to confirm it the first time.

  4. With the public key of the server in its possession, the client generates a random session key, creating a message that contains that key and the algorithm that was selected for the encryption of the information. All this information is sent to the server, which makes use of the public key that was sent in an earlier step in an encrypted form.

  5. If everything is correct, the client is authenticated, initiating the session to communicate with the server.

Published on Sat 17 June 2017 by Alex Reynolds in Networking with tag(s): ssh