So, the first thing I discovered was that Paramiko was outdated and did not receive support.
Now it is known as the ssh package, at least under Ubuntu and has another supporting one (bitprophet)
Here is an example session using it:
$ ./ssh_demo.py Hostname: 192.168.1.10 *** Host key OK. Username [bryan]: root Trying ssh-agent key eee5638f390e1698898984b10adfa9317 ... success! *** Here we go! Linux top.secret.com 2.9.37-1-amd64
This does not answer the question of why the fabric is not authenticated against the correct ssh-agent representation. Therefore, the question remains open.
Update:
Thanks to Morgan's prompt, I got a little better with this problem. As he suggested, I turned on ssh protocols by adding the following to the beginning of the fabfile.py file
from fabric.api import * import ssh ssh.util.log_to_file("paramiko.log", 10)
I also tracked the server log. In doing so, I found that the user I specified is ignored, and instead uses the local username.
On server:
tail -f /var/log/auth.log Mar 28 11:12:36 xxxxxxxxxxx sshd[17652]: Invalid user bryan from xxx.xxx.xxx.xxx
Locally:
tail -f paramiko.log DEB [20120328-11:39:29.038] thr=1 ssh.transport: starting thread (client mode): 0x8dfc66cL INF [20120328-11:39:29.066] thr=1 ssh.transport: Connected (version 2.0, client OpenSSH_5.5p1) DEB [20120328-11:39:29.093] thr=1 ssh.transport: kex algos:['diffie-hellman-group-exchange-sha256', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] server key:['ssh-rsa', 'ssh-dss'] client encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'arcfour256', 'arcfour128', 'aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'aes192-cbc', 'aes256-cbc', 'arcfour', ' rijndael-cbc@lysator.liu.se '] server encrypt:['aes128-ctr', 'aes192-ctr', 'aes256-ctr', 'arcfour256', 'arcfour128', 'aes128-cbc', '3des-cbc', 'blowfish-cbc', 'cast128-cbc', 'aes192-cbc', 'aes256-cbc', 'arcfour', ' rijndael-cbc@lysator.liu.se '] client mac:['hmac-md5', 'hmac-sha1', ' umac-64@openssh.com ', 'hmac-ripemd160', ' hmac-ripemd160@openssh.com ', 'hmac-sha1-96', 'hmac-md5-96'] server mac:['hmac-md5', 'hmac-sha1', ' umac-64@openssh.com ', 'hmac-ripemd160', ' hmac-ripemd160@openssh.com ', 'hmac-sha1-96', 'hmac-md5-96'] client compress:['none', ' zlib@openssh.com '] server compress:['none', ' zlib@openssh.com '] client lang:[''] server lang:[''] kex follows?False DEB [20120328-11:39:29.093] thr=1 ssh.transport: Ciphers agreed: local=aes128-ctr, remote=aes128-ctr DEB [20120328-11:39:29.093] thr=1 ssh.transport: using kex diffie-hellman-group1-sha1; server key type ssh-rsa; cipher: local aes128-ctr, remote aes128-ctr; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none DEB [20120328-11:39:29.183] thr=1 ssh.transport: Switch to new keys ... DEB [20120328-11:39:29.224] thr=2 ssh.transport: Trying SSH agent key cda5638f390e166864444b1093b91017 DEB [20120328-11:39:29.272] thr=1 ssh.transport: userauth is OK INF [20120328-11:39:53.310] thr=1 ssh.transport: Authentication (publickey) failed. DEB [20120328-11:41:29.076] thr=1 ssh.transport: EOF in transport thread
Hmm, this is strange, I ran a command like: fab diskfree -H xxx.xxx.xxx.xxx -u root
But what is it?
$ cat ./fabfile.py from fabric.api import * import ssh ssh.util.log_to_file("paramiko.log", 10) env.user = 'bryan' def host_type(): run('uname -s') def diskfree(): run('df -h')
Hmm
env.user = 'bryan'
Could this be the cause of the problem? Could ssh error messages be misleading to me?
I deleted the line and it worked, so I think this is the answer.