Closed aveach closed 5 years ago
FWIW, I tried using pssh.clients.native.single.SSHClient.scp_send
as well and same scenario. No exceptions are raised but the file is not on the remote machine.
>>> from pssh.clients.native.single import SSHClient
>>> s = SSHClient("ap", "root", "")
>>> s.scp_send("../Desktop/client.py", "/tmp")
>>> r = s.run_command("ls /tmp")
>>> print(*r[2])
log_tmp.log
Hi there,
Seems like the code is trying to write a file to a directory. The destination path needs to be a file.
Authentication method does not play any part in how SCP or any other functionality works - if client is authenticated it's all the same.
Does this not work?
python3 scp_write.py ~/Desktop/client.py /tmp/client.py
wow... I swear I tried that. 🤦♂
Thanks @pkittenis, sorry for the churn
I'm writing a very simple wrapper for ssh2-python and trying to get scp to work (neither
scp_send64
norscp_recv2
seem to be working).For simplicity (in case I was doing something stupid in my wrapper) I modified one line in
example/scp_write.py
to useuserauth_password
instead as follows:and although it shows the transfer completes sucessfully:
The file never actually shows up on the remote machine. (This works without issue using standard scp in a terminal)