The following series of events help protect the integrity of SSH communication.
SSH Connection Sequence
1) A cryptographic handshake is made with the server
2) The connection between client and remote server is encrypted using symmetric cipher
3) Client authenticates itself
4) Client can now interact safely with remote server over encrypted connection