Using the code below I am able to connect to the transport but I receive a "Unable to open channel" error when trying to open the sftpclient. I have used this very same code to connect to one other server but I am not familiar enough with the protocol to see if there could be any server side or external factors affecting my ability to establish this connection.
key = paramiko.RSAKey.from_private_key_file(keyfile)
transport = paramiko.Transport((host, port))
transport.connect(username = user, password = password, pkey = key)
print("transport connect")
sftp = paramiko.SFTPClient.from_transport(transport)
print("sftp client connect")
sftp.close()
transport.close()
These are the logs:
2021-07-23 15:29:09,234 - INFO - Connected (version 2.0, client GoAnywhere6.4.3)
2021-07-23 15:29:10,130 - INFO - Auth banner: b'Welcome! Please login.\n'
2021-07-23 15:29:10,237 - INFO - Authentication continues...
2021-07-23 15:29:10,358 - WARNING - Oops, unhandled type 3 ('unimplemented')
2021-07-23 15:29:41,592 - INFO - Disconnect (code 11): Idle connection
2021-07-23 15:29:41,593 - ERROR - Unhandled Events:
Traceback (most recent call last):
File "D:\Python Scripts\Test.py", line 57, in <module>
sftp = paramiko.SFTPClient.from_transport(transport)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\paramiko\sftp_client.py", line 165, in from_transport
window_size=window_size, max_packet_size=max_packet_size
File "C:\Program Files (x86)\Python37-32\lib\site-packages\paramiko\transport.py", line 806, in open_session
timeout=timeout,
File "C:\Program Files (x86)\Python37-32\lib\site-packages\paramiko\transport.py", line 933, in open_channel
raise e
paramiko.ssh_exception.SSHException: Unable to open channel.