Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot upload file to remote server #248

Open
joeydan1 opened this issue Mar 26, 2022 · 0 comments
Open

cannot upload file to remote server #248

joeydan1 opened this issue Mar 26, 2022 · 0 comments

Comments

@joeydan1
Copy link

I am creating a scripts which to upload some files to remote server by a gateway server as below codes and met some errors, not sure if some things are missed, thanks.

gateway_session = SSHSession(gateway_ip, gateway_username, password=gateway_password).open()

remote_session = gateway_session.get_remote_session(remote_host_ip, remote_host_username, password=remote_host_password)

remote_session.put('/path/to/local_file', '/path/to/remote_file')

Error Message:

Traceback (most recent call last):
File "/usr/local/python3.7/lib/python3.7/site-packages/paramiko/sftp_client.py", line 130, in init
server_version = self._send_version()
File "/usr/local/python3.7/lib/python3.7/site-packages/paramiko/sftp.py", line 134, in _send_version
t, data = self._read_packet()
File "/usr/local/python3.7/lib/python3.7/site-packages/paramiko/sftp.py", line 201, in _read_packet
x = self._read_all(4)
File "/usr/local/python3.7/lib/python3.7/site-packages/paramiko/sftp.py", line 188, in _read_all
raise EOFError()
EOFError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test.py", line 26, in
print(remote_session.put('/fa/autoFa/fail_info', '/home/fail_info'))
File "/usr/local/python3.7/lib/python3.7/site-packages/jumpssh/session.py", line 618, in put
use_sudo=use_sudo, owner=owner, permissions=permissions, username=username, silent=True)
File "/usr/local/python3.7/lib/python3.7/site-packages/jumpssh/session.py", line 706, in file
sftp_client = self.get_sftp_client()
File "/usr/local/python3.7/lib/python3.7/site-packages/jumpssh/session.py", line 551, in get_sftp_client
return paramiko.sftp_client.SFTPClient.from_transport(self.ssh_transport)
File "/usr/local/python3.7/lib/python3.7/site-packages/paramiko/sftp_client.py", line 170, in from_transport
return cls(chan)
File "/usr/local/python3.7/lib/python3.7/site-packages/paramiko/sftp_client.py", line 132, in init
raise SSHException("EOF during negotiation")
paramiko.ssh_exception.SSHException: EOF during negotiation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant