Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Transport' object has no attribute 'rng' #6

Open
jjwon0 opened this issue Jun 18, 2014 · 0 comments
Open

'Transport' object has no attribute 'rng' #6

jjwon0 opened this issue Jun 18, 2014 · 0 comments

Comments

@jjwon0
Copy link

jjwon0 commented Jun 18, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant