I have just read a portion of the article entitled: "How to upload a file from Windows to Linux?" In that article, there was a link to WinSCP. I downloaded that program, but I need to know if it is possible to transfer a file from Microsoft Windows 10 ( c:/ ) to my Debian Linux version 9.5 operating system. The prompt under my Debian version 9.5 Linux operating system is Russell@Russell1-PC: $. (I have Windows Subsystem for Linux (WSL) configured on my personal computer). In the "Host name:" field of the WinSCP dialog box (using SFTP), I enter Russell@Russell1-PC, then I enter the username and password for my Debian version 9.5 Linux account, but I get the error message: "Network error. Connection to Russell1-PC refused."

What should I do differently?

closed as too broad by Rui F Ribeiro, Jesse_b, Romeo Ninov, schily, Archemar Jul 20 '18 at 14:21

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Does the debian machine have a unique IP or does it share one with your windows system? Either way I'm guessing there is a better way to transfer files than SCP considering these machines likely share a hard drive. – Jesse_b Jul 19 '18 at 14:43
  • From your Linux machine you can use smbclient to transfer files from windows to your Linux. – YoMismo Jul 19 '18 at 15:44
  • See this tutorial - siteground.com/tutorials/ssh/winscp. Sounds like you need to confirm that you have the correct login/password to get into the Linux system. – slm Jul 19 '18 at 19:14
  • Since I have Windows Subsystem for Linux configured on my personal computer, this means that Microsoft Windows 10 and Debian Linux version 9.5 share the same computer ( which I am sure you all know ). After further consideration, I am not so sure WinSCP will solve the problem ( there is no remote computer involved ). I have tried the command "cp -f -R -L -p 'c:/path ( Windows )' /path/to/Linux ( Debian )" from the Linux command line, but receive the error message: "cp: cannot stat 'c:/path ( Windows )' : No such file or directory." Any suggestions? – user301393 Jul 19 '18 at 19:32
  • 1

You do not need to use WinSCP neither any other network application.

From WSL you can access the Windows partition via /mnt, e.g. the contents of c:\mypath are accessible via Linux under /mnt/c/mypath.

So to copy a file from your Windows 10 home directory to your Linux home directory, use this command:

cp /mnt/c/Users/Russell/myfile.txt ~/

Just remember not to modify any Linux file via Windows, as explained here.

  • Thank you dr01. That is what I was looking for. I am assuming "~/" is the Debian version 9.5 Linux root directory, and that it must be typed in as it appears? Also, for a recursive application, I am assuming the command would be: "cp -R /mnt/c/Users/Russell/* ~/" ? Thank you for your help. – user301393 Jul 20 '18 at 11:34
  • No, ~/ is the current user directory. And yes, you can use recursive copy. – dr01 Jul 20 '18 at 12:10