forked from paramiko/paramiko
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I'm trying to SSH to a server that requires kerberos for login (normally using kinit; ssh -K). However, with both this and the newer branch (python-gssapi-0.6.1) I am running into this error. My code is below:
try:
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.WarningPolicy())
print('*** Connecting to {0}@{1}***'.format(USERNAME, HOSTNAME))
if not UseGSSAPI or (not UseGSSAPI and not DoGSSAPIKeyExchange):
client.connect(HOSTNAME, PORT, USERNAME, PASSWORD)
else:
# SSPI works only with the FQDN of the target host
hostname = socket.getfqdn(HOSTNAME)
try:
client.connect(hostname, PORT, USERNAME, gss_auth=UseGSSAPI,
gss_kex=DoGSSAPIKeyExchange)
except Exception as e:
# always enters this exception clause
print('*** Caught exception: %s: %s' % (e.__class__, e))
client.connect(hostname, PORT, USERNAME, PASSWORD)
stdin, stdout, stderr = client.exec_command('hadoop fs -ls')
for line in stdout:
print line.strip('\n')
client.close()
The error occurs in client.connect -- it always catches an exception there, and I believe that since the command I'm trying to run requires kerberos authentication I am getting an error.
My log is here.
Metadata
Metadata
Assignees
Labels
No labels