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 = 'https://sftp-portal.com'
port = 1022
username = 'username'
password = 'password!'

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

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



Read more here: https://stackoverflow.com/questions/65704635/paramiko-authentication-failed-authentication-exception

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: