<div>hi</div>
<div> </div>
<div>I am connecting to a SFTP server using only public key authentication</div>
<div> </div>
<div>here is my code:</div>
<div>.... </div>
<div> path = os.path.join("somepath", '.ssh', 'id_rsa_a')</div>
<div> try:<br> t = paramiko.Transport((svr, PORT))<br> t.connect(hostkey=None, username='', password=None,pkey=path)<br> sftp = paramiko.SFTPClient.from_transport(t)<br> try:<br>
sftp.put(fil)<br> except Exception, v:<br> print v<br>except:</div>
<div> some other codes........ </div>
<div> </div>
<div> </div>
<div>and here is the error i get at t.connect():</div>
<div> </div>
<div>DEB [20061211-12:07:50.238] thr=1 paramiko.transport: using kex diffie-hellman-group1-sha1; server key type ssh-dss; c<br>ipher: local 3des-cbc, remote 3des-cbc; mac: local hmac-sha1, remote hmac-sha1; compression: local none, remote none
<br>DEB [20061211-12:07:52.731] thr=1 paramiko.transport: Switch to new keys ...<br>DEB [20061211-12:07:52.734] thr=2 paramiko.transport: Attempting public-key auth...<br>DEB [20061211-12:07:52.948] thr=1 paramiko.transport
: userauth is OK<br>ERR [20061211-12:07:52.948] thr=1 paramiko.transport: Unknown exception: 'str' object has no attribute 'get_name'<br>ERR [20061211-12:07:52.950] thr=1 paramiko.transport: Traceback (most recent call last):
<br>ERR [20061211-12:07:52.950] thr=1 paramiko.transport: File "/usr/python/lib/python2.4/site-packages/paramiko/transpo<br>rt.py", line 1369, in run<br>ERR [20061211-12:07:52.950] thr=1 paramiko.transport
: File "/usr/python/lib/python2.4/site-packages/paramiko/auth_ha<br>ndler.py", line 203, in _parse_service_accept<br>ERR [20061211-12:07:52.951] thr=1 paramiko.transport: AttributeError: 'str' object has no attribute 'get_name'
<br>ERR [20061211-12:07:52.951] thr=1 paramiko.transport:</div>
<div> </div>
<div> </div>
<div> </div>
<div>May i know how to resolve this??</div>
<div>thanks</div>