I'm trying to connect to am SFTP server through Paramiko. I don't have a host key. The following code is my attempt and it's giving me an error that says:
paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
I notice that port is usually 22 in other given examples, but the SFTP port I was given is 21. And when I tried 22, it gave me another error saying
Unable to connect to port 22
Thank you in advance for your guidance and insight. Please let me know if I could provide more information.
from paramiko.client import SSHClient
from paramiko import AutoAddPolicy
client = SSHClient()
client.set_missing_host_key_policy(AutoAddPolicy())
client.connect(hostname="a_private_ip",
port=21,
username="user",
password="xxx")
sftp_handle = client.open_sftp()