Force the use of pub key files for the main SSH user.

Also moves SSH2 functions into the auth file to make the code cleaner
in other places and handle errors more gracefully.