I want to know what happens behind the scenes in establishing a ssh connection, i mean till we land on the shell in a Linux from a Linux machine. I know that password is not sent in plain text in a ssh connection. So what do they do to encrypt the connection. Here i am assuming that i have not generated my public/private keys. I use password for authentication. So i think there cant be a exchange of keys before securing the connection. I searched on google and in serverfault but no hits. The closest i got to in serverfault was this post What exactly does ssh send when performing key negotiation? .
The above post assumes the user is connecting via pubic key exchange. But i am looking for a case of securing the connection without the public/private keys. How does it encrypt the connection even before i enter the password. What does it use to secure the connection so that password is not send plain text ?
|
| ||||
|
feedback
|
|
When you install SSH and start it for the first time, it will generate public and private keys for the machine, which are the same for every user. Upon connection, both machines will exchange their public key parts (in plain text) and use them to encrypt the communication between the hosts. After the key exchange, the communication will switch to encrypted mode. In every users | |||
|
feedback
|
|
RFC 4252 explains how authentication using SSH works and which steps are involved in it. Of course, the specification is cumbersome to read, so the easiest way might be running This is what it looks like for a sample case (I changed user and host names). Using
| |||
|
feedback
|