How do you improve the security of your ssh session against a man-in-the-middle attack?
Make sure you pay attention to the warnings about changes to the server's public key. If you get a warning like this, say "no" and check the public key fingerprint through out-of-band means; don't say "yes" unless you have verified the public key fingerprint somehow.
If you never connect to new hosts, you can set
Read the section VERIFYING HOST KEYS of the ssh man page.
Read How do RSA fingerprints protect from MITM attacks? on this site.
Use a SSH private key, not a password, to authenticate.
Always authenticate with public keys (better yet, turn off password authentication entirely in
Here is a short explanation that goes into more detail: http://www.gremwell.com/ssh-mitm-public-key-authentication