Scp from Linux to Windows machine using jumphost
If you have OpenSSH 8.0 and newer, you can use -J
(jump) switch:
scp -r -i user_202201281017.pub -J user@jumphost_ip_address user@file_present_at_original_server:/home/user/check-job-status.sh .
With older version, but at least 7.3, use ProxyJump
directive:
scp ... -o ProxyJump=user@jumphost_ip_address
For more options, see Does OpenSSH support multihop login?
With Windows build of OpenSSH (Win32-OpenSSH), you need the latest version in any case, as earlier versions had broken jump host support. They fail with:
CreateProcessW failed error:2 posix_spawn: No such file or directory
copy files from linux to windows
you should be able to script smbclient as part of a script
smbclient -A authfile //windows_machine/D$ -c 'cd \\PATH\TO\Directory; get "Filename.txt" myfile.txt'
where authfile would be
username = <myusername>
password = <mypassword>
This would assume File Sharing enabled on the Windows Machine, and samba installed on the linux side. //windows_machine/D$
is the D Share. but you could replace it with whatever share you create.
or you could install an FTP server on your windows machine and can either script an FTP client or use something like curl || wget
Related Topics
How to Remove the Bom from a Utf-8 File
Creating a Bootable Iso Image with Custom Bootloader
Command Line Utility to Print Statistics of Numbers in Linux
What Is Path //, How Is It Different from /
Linux Removing Folders Older Than 1 Year and More Than 3 Files
How to Determine If a Detached Pthread Is Alive
Search and Replace with Sed When Dots and Underscores Are Present
Identify User in a Bash Script Called by Sudo
Faster Forking of Large Processes on Linux
Prevent File Descriptors Inheritance During Linux Fork
What Is the Default Register State When Program Launches (Asm, Linux)
How to Find the Maximum Stack Size
How to Avoid Transparent_Hugepage/Defrag Warning from Mongodb
Is There an Invalid Pthread_T Id
How to Detect the Physical Connected State of a Network Cable/Connector