This new block should be refactored into a separate method, like Chef::Knife::Ssh#configure_session.

It's confusing here what's really happening, such as what source wins the knife config or the ssh config. If you read carefully you can figure it out, but trying to clean that up or add comments should help.