def get_key_auth_cb(key_filepath):
def auth_cb(ssh):<EOL><INDENT>key = ssh_pki_import_privkey_file(key_filepath)<EOL>ssh.userauth_publickey(key)<EOL><DEDENT>return auth_cb<EOL>
This is just a convenience function for key-based login.