Discussion:
[Fab-user] Paramiko transport error
Thomas Templeton
2018-01-16 22:38:04 UTC
Permalink
Hello,

I've encountered an issue that resembles this one:

https://stackoverflow.com/questions/40557778/fabric-encountering-auth-issue-with-paramiko

Using identical fabfiles in a shared directory between two machines, simple
run('uname -a') works fine when run from one, produces error when run from
the other.

working machine:
os: RH v 7.2
python: 2.7.5
fab --version:
Fabric 1.14.0
Paramiko 2.4.0

non-working machine:
os: RH v 7.3
python: 2.7.5
fab --version:
Fabric 1.14.0
Paramiko 2.4.0

The only difference in the above is Red Hat minor version number.
ssh -t [hostname] "/bin/bash -l -c \"uname -a\"" returns correct output on
either machine.

Here is the fabfile (the simplest possible that reproduces the error):

import logging
logging.basicConfig(level=logging.DEBUG)

from fabric.api import env, run, task

env.hosts = [[omitted]]
env.user = [omitted]
env.port = [omitted]
env.key_filename = [omitted]

@task
def remote_uname():
run('uname -a')


output:

$ fab remote_uname
[hostname] Executing task 'remote_uname'
[hostname] run: uname -a
DEBUG:paramiko.transport:starting thread (client mode): [omitted]
DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_2.4.0
DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-OpenSSH_6.0
INFO:paramiko.transport:Connected (version 2.0, client OpenSSH_6.0)
DEBUG:paramiko.transport:kex algos:[u'ecdh-sha2-nistp256',
u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521',
u'diffie-hellman-group-exchange-sha256',
u'diffie-hellman-group-exchange-sha1', u'diffie-hellman-group14-sha1',
u'diffie-hellman-group1-sha1'] server key:[u'ssh-rsa', u'ssh-dss'] client
encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256',
u'arcfour128', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc',
u'aes192-cbc', u'aes256-cbc', u'arcfour', u'rijndael-***@lysator.liu.se']
server encrypt:[u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'arcfour256',
u'arcfour128', u'aes128-cbc', u'3des-cbc', u'blowfish-cbc', u'cast128-cbc',
u'aes192-cbc', u'aes256-cbc', u'arcfour', u'rijndael-***@lysator.liu.se']
client mac:[u'hmac-md5', u'hmac-sha1', u'umac-***@openssh.com',
u'hmac-sha2-256', u'hmac-sha2-256-96', u'hmac-sha2-512',
u'hmac-sha2-512-96', u'hmac-ripemd160', u'hmac-***@openssh.com',
u'hmac-sha1-96', u'hmac-md5-96'] server mac:[u'hmac-md5', u'hmac-sha1',
u'umac-***@openssh.com', u'hmac-sha2-256', u'hmac-sha2-256-96',
u'hmac-sha2-512', u'hmac-sha2-512-96', u'hmac-ripemd160',
u'hmac-***@openssh.com', u'hmac-sha1-96', u'hmac-md5-96'] client
compress:[u'none'] server compress:[u'none'] client lang:[u''] server
lang:[u''] kex follows?False
DEBUG:paramiko.transport:Kex agreed: ecdh-sha2-nistp256
DEBUG:paramiko.transport:HostKey agreed: ssh-rsa
DEBUG:paramiko.transport:Cipher agreed: aes128-ctr
DEBUG:paramiko.transport:MAC agreed: hmac-sha2-256
DEBUG:paramiko.transport:Compression agreed: none
DEBUG:paramiko.transport:kex engine KexNistp256 specified hash_algo
<built-in function openssl_sha256>
DEBUG:paramiko.transport:Switch to new keys ...
DEBUG:paramiko.transport:Trying discovered key [omitted] in [omitted]

DEBUG:paramiko.transport:EOF in transport thread

From what I have seen (https://github.com/paramiko/paramiko/issues/878,
https://github.com/paramiko/paramiko/issues/1098), issues like this are not
easy to diagnose.

Thanks

Clay
Nick Timkovich
2018-01-16 23:42:50 UTC
Permalink
Post by Thomas Templeton
os: RH v 7.2
Probably not terribly helpful, but it seems to run OK for me on CentOS 7.4.

I have a vague recollection of bizarre errors that were fixed by updating
some headers, but that might have been for PyOpenSSL, which doesn't seem to
be a dependency when I just installed Fabric in a fresh virtualenv.

Nick

Loading...