312 CHAPTER 19: SSH TERMINAL SERVICES
Figure 91 Establish an SSH channel through a WAN
To establish an SSH authentication secure connection, the server and the client
must go through the following five phases:
1 Version number negotiation:
â– The client sends a TCP connection request.
â– After the TCP connection is established, the server and the client negotiate the
version number.
â– If the negotiation succeeds, the key algorithm negotiation phase starts;
otherwise, the server tears down the TCP connection.
2 Key algorithm negotiation:
â– The server generates an RSA key pair and a 8-byte number randomly, and
sends the public key to the client.
â– Both the server and the client use the public key module of the server and the
8-byte number as parameters,and calculate a 16-byte session ID via the same
algorithm.
â– The client uses the public key from the server and the random number
generated locally as parameters to calculate the session key.
â– Using the public key from the server, the client encrypts the random number
for calculating the session key and sends the result to the server.
â– Using the local private key, the server decrypts the data sent by the client and
obtains the random number used by the client.
â– Using the local public key and the random number sent by the client as
parameters, the server calculates the session key via the same algorithm as the
one employed by the client.
On completion of the above steps, the server and the client obtains the same
session key. During the session, both ends use the same session key to perform
encryption and decryption, thereby guaranteeing the security of data transfer.
Local switch
Local Ethernet
WAN
Server
SSH client
PC
Laptop
Laptop
Workstation
Workstation
Remote Ethernet
Remote switch
Server
SSH server
Local Ethernet
WAN
Server
PC
SSH
PC
Laptop
Laptop
Workstation
Remote Ethernet
Server
SSH