How to copy files from Linux to Windows using PSCP

0 Comments

If you are looking for a way to copy files directly from Linux to windows I strongly recommend using a “pscp” command. This command which is by default part of Linux but in Windows environment it requires the necessary libraries. These can be downloaded here.

Upon downloading please place the file inside this path: C:Windows\System32.

You can test if the new command works by:

  1. Starting CMD as Administrator
  2. Starting PowerShell by typing ‘Powershell’
  3. Type: pscp

You should receive a similar return:

Now you can start copying files from Linux to Windows using the following syntax

C:\>pscp user@192.168.100.5:/Home/<yourusername>examplefile.txt C:\temp

After pressing enter you will be prompted to accept ssh certificate (make sure that ssh is enabled on your Linux installation, if not follow this link) and you will be asked to enter the ‘sudo’ linux user password.

After doing this the desired file will be copied over port 22 into C:\temp. Here, instead of C:\temp, you are allowed to type any path to a desired folder on windows installation.

How to copy Files from Windows to Linux?

In order to achieve this just reverse the syntax. Using the example above type the following:

C:\> pscp c:\temp\examplefile.txt user@192.168.100.5:/home/<yourusername>examplefile.txt

SSH over Internet

If you are intending to ssh your linux installation from the internet, make sure to forward port 22 to your Linux IP address.

Although this means of managing your server is possible. I do not recommend it due to security reasons. Firstly it open your server vulnerable to port scans, secondly the ssh ist not secure enough enough to sleep tightly in my opinion.

As alternative means I strongly suggest to use SSH over VPN (Virtual Private Network). Since you already have a Linux Server, it should not pose too much difficulties on setting up your own VPN Server, which will allow you to enter your own local network from all over the word 🙂

Please follow this link to learn how to install and configure a private VPN Server based on OpenVPN.

Categories:

Leave a Reply

Your email address will not be published. Required fields are marked *