[paramiko] authentication failed

mike mik3l3374 at gmail.com
Wed Dec 13 07:41:27 PST 2006


hi
i have this code from the demo. I wanted to connect using only public key
authentication
try:
    k = paramiko.RSAKey(filename='test_rsa') #test_rsa is priv key
    t = paramiko.Transport(("host", port))
    t.connect(username="user",pkey=k) #using only public key authentication
    sftp = paramiko.SFTPClient.from_transport(t)

    # dirlist on remote host
    dirlist = sftp.listdir('.')
    print "Dirlist:", dirlist
    t.close()

except Exception, e:
    print '*** Caught exception: %s: %s' % (e.__class__, e)
    traceback.print_exc()
    try:
        t.close()
    except:
        pass
    sys.exit(1)


when i ran it, it give me this error:

*** Caught exception: paramiko.AuthenticationException: Authentication
failed.
Traceback (most recent call last):
  File "./test.py", line 24, in ?
    t.connect(username="user",pkey=k)
  File "/usr/python/lib/python2.4/site-packages/paramiko/transport.py", line
854, in connect
    self.auth_publickey(username, pkey)
  File "/usr/python/lib/python2.4/site-packages/paramiko/transport.py", line
1081, in auth_publickey
    return self.auth_handler.wait_for_response(my_event)
  File "/usr/python/lib/python2.4/site-packages/paramiko/auth_handler.py",
line 174, in wait_for_response
    raise e
AuthenticationException: Authentication failed.


the error log shows:

 remote aes128-cbc; mac: local hmac-sha1, remote hmac-sha1; compression:
local none, remote none
DEB [20061213-23:39:31.225] thr=1   paramiko.transport: Switch to new keys
...
DEB [20061213-23:39:31.230] thr=2   paramiko.transport: Attempting
public-key auth...
DEB [20061213-23:39:31.318] thr=1   paramiko.transport: userauth is OK
INF [20061213-23:39:31.699] thr=1   paramiko.transport: Authentication
(publickey) failed.
DEB [20061213-23:39:31.810] thr=1   paramiko.transport: EOF in transport
thread

What am i doing wrong?
thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lag.net/pipermail/paramiko/attachments/20061213/63c935d0/attachment.htm 


More information about the paramiko mailing list