How are Ciphers, MACs and Key exchange algorithms negotiated by OpenSSH?

You can see more precise details of how the various algorithms are negotiated in RFC 4253, Section 7.1, but basically:

  • The algorithms in ssh_config (or the user's ~/.ssh/config) and in sshd_config are ranked by preference, highest to lowest.
  • The server chooses the first algorithm on the client's list that it also supports. Hence, the choice is biased towards the client's preferences.

The Cipher and MAC algorithms do show up in verbose output, e.g.

debug1: kex: server->client aes128-ctr [email protected] [email protected]
debug1: kex: client->server aes128-ctr [email protected] [email protected]

Last I checked, OpenSSH does not say what exact Kex algorithm it chooses though. Maybe this will change in the future.