Paramiko authentication failed / authentication exception

I'm using python paramiko, to connect to an SFTP portal. But, every time I run this code it fails with this error

paramiko.ssh_exception.AuthenticationException: Authentication failed.

This is the code I'm using:

import paramiko

host = ''
port = 1022
username = 'username'
password = 'password!'

transport = paramiko.Transport((host,port))
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.get('/files/csv/example.csv', '/Users/User/Desktop')

What am I doing wrong? any help with this is highly appreciated.

Read more here:

Content Attribution

This content was originally published by Supreeth Tamvada at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: