Amazon interview question

Explain how ssh works in technical details