You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm hopeful that this is PEBCAK but I can't seem to resolve it no matter what I try.
Any attempts to scp_send a file to a windows host seem to fail on anything other than a relative filepath with no directory structures, all other paths panic at runtime with value: Error { code: Session(-28), msg: "failed to send file" }'.
For example the following code works but it places 'remote' in $HOME of the user and literally includes the single tics in the filename:
let tcp = TcpStream::connect("IP.ADDR.OF.HOST:22").unwrap();
let mut sess = Session::new().unwrap();
sess.set_tcp_stream(tcp);
sess.handshake().unwrap();
sess.userauth_password(r"DOMAIN\username", "DomainUserPassword").unwrap();
let buf = std::path::PathBuf::from("remote");
let mut remote_file = sess.scp_send(buf.as_path(),
0o644, 10, None).unwrap();
remote_file.write(b"1234567890").unwrap();
remote_file.send_eof().unwrap();
remote_file.wait_eof().unwrap();
remote_file.close().unwrap();
remote_file.wait_close().unwrap();
ANY other pattern passed fails with this error including paths expecting that relative path to remain true. Scp to the host works fine from both linux and windows terminals. I see in the Event Viewer logs that there is no authentication issue so I'm kind of at a loss.
Examples of other paths I have attempted and this list is not exhaustive:
I'm running into a similar issue where the deposited file's name is surrounded by literal apostrophies. As a stop-gap measure, I can remotely execute a rename command to remove them; but this is a bandaid at best.
I'm hopeful that this is PEBCAK but I can't seem to resolve it no matter what I try.
Any attempts to
scp_send
a file to a windows host seem to fail on anything other than a relative filepath with no directory structures, all other paths panic at runtime withvalue: Error { code: Session(-28), msg: "failed to send file" }'
.For example the following code works but it places 'remote' in
$HOME
of the user and literally includes the single tics in the filename:ANY other pattern passed fails with this error including paths expecting that relative path to remain true. Scp to the host works fine from both linux and windows terminals. I see in the Event Viewer logs that there is no authentication issue so I'm kind of at a loss.
Examples of other paths I have attempted and this list is not exhaustive:
The text was updated successfully, but these errors were encountered: