(This may be a repost of the message sent yesterday before I joined the
paramiko mailing list. Excuse the duplication if that is case).

 

 

Has anybody been able to use puttygen generated key information to
successfully obtain and use a paramiko.SFTPClient instance?

 

Environmental info:

        OS      : Windows Server 2003

        Python  : 2.6.5

        pycrypto: 2.1.0

        paramiko: 1.7.6 (Fanny)

 

I'm trying to automate some SFTP work that is now done manually via
Filezilla.  

The private/public key info was generated via puttygen.  

I've been able to use puttygen's 'Conversion' facility to convert the 

putty format DSS private key into OpenSSH format.  

I was able to use the private key info in that file to obtain a
paramiko.DSSKey() instance via a

 

   target_dss_private_key =
paramiko.DSSKey.from_private_key_file(<filename>) statement.

 

However, the call to transport.connect(username=username,
password=password, pkey=target_dss_private_key)  (both username and
password are zero-length strings) resulted in an exception being
generated:

 

*** Caught exception: <class 'paramiko.BadAuthenticationType'>: Bad
authentication type (allowed_types=['publickey']) trying to establish
connection

Traceback (most recent call last):

  File "scget.py", line 213, in obtainDownloadCandidates

    transport.connect(username=user, password=password, pkey=pkey)

  File "C:\Python26\lib\site-packages\paramiko\transport.py", line 1004,
in connect

    self.auth_password(username, password)

  File "C:\Python26\lib\site-packages\paramiko\transport.py", line 1165,
in auth_password

    return self.auth_handler.wait_for_response(my_event)

  File "C:\Python26\lib\site-packages\paramiko\auth_handler.py", line
174, in wait_for_response

    raise e

BadAuthenticationType: Bad authentication type
(allowed_types=['publickey'])

 

 

Do I need to get the hostkey converted from puttygen related format to
OpenSSH format to use as the hostkey argument in the connect call?  

If so, what are the commonly used ways of converting a hostkey in Putty
format to the OpenSSH format?

 

Are there other factors I'm overlooking in attempting to get this to
work?

 

Thanks in advance,

 

Kip Lehman

 

Klehman<at>medvantage.com

 

 

_______________________________________________
paramiko mailing list
paramiko@lag.net
http://www.lag.net/cgi-bin/mailman/listinfo/paramiko

Reply via email to