Reputation: 21
I am using paramiko to establish an SFTP connection with a public/private key exchange. They key is an SSH2 RSA key. When I try to connect I'm receiving the error BadAuthenticationType: Bad authentication type (allowed_types=['']). Does anyone have an idea what might be causing this?
key = paramiko.RSAKey.from_private_key_file(key, password=passphrase)
transport = paramiko.Transport((host, port))
transport.start_client()
transport.auth_publickey(username, key)
sftp = paramiko.SFTPClient.from_transport(transport)
Upvotes: 2
Views: 5728
Reputation: 53
According to the documentation for Paramiko, the server you're trying to connect to isn't configured properly (it doesn't allow public-key authentication for the user you're using to connect). Here is a link to the portion of the documentation that I referenced, hopefully it will be of use. http://www.lag.net/paramiko/docs/paramiko.Transport-class.html#auth_publickey
I recommend that you check your server config and make sure everything is set up properly.
Upvotes: 2