SSH cleanup and fixes

Removed deprecated functions of libssh and obtain public key
from private key file. Fixes #262.