You can transfer files from Windows to Linux using SCP, and vice versa.
From Windows to Linux
An SSH client is already enabled by default in the latest version of Windows 10, so there is no need to install any software on Windows. However, make sure SSH server is up and running on Linux.
Open a command prompt (cmd.exe) and enter the following command:
scp [filepath] [user]@[IP addr]:[filepath]
Example: scp C:/Users/username/Desktop/ubuntu.iso [email protected]:/home/ubuntu/Desktop/
To transfer all file in a folder:
scp [filepath]/* [user]@[IP addr]:[filepath]
Example: scp C:/Users/username/Desktop/* [email protected]:/home/ubuntu/Desktop/
From Linux to Windows
Likewise, to transfer files from Linux to Windows, you may need to install SSH server on Windows because it is not installed by default.
Using the same command, we can transfer files from Linux to Windows:
scp [filepath] [user]@[IP addr]:[filepath]
Example: scp /home/ubuntu/Desktop/textfile.txt [email protected]:C:/Users/username/Desktop/
To transfer all file in a folder:
scp [filepath]/* [user]@[IP addr]:[filepath]
Example: scp /home/ubuntu/Desktop/* [email protected]:C:/Users/username/Desktop/
There you go, transferring files between Windows and Linux using SCP is a piece of cake. Simply make sure that
#1) SSH server is up and running.
#2) Firewall is not blocking the SSH inbound request