1

There are already quite a few topics on this issue here on StackOverflow

However, I have spent the last 3 hours trying all of them, but am unable to fix this.

I am trying to copy a file from my laptop to a remote linux server

My laptop uses Windows 8.1

The remote server is Debian.

I am connected to the Linux server via a PUTTY.

If I was using a linux machine, it would be as easy as A-B-C

But, as my laptop is Windows...............well.........

Here is the command I've tried :

pscp C:\Users\Michael Storm\Desktop\Folder\public_key.ppk mstorm@my.linux.server:/home/mstorm

mstorm --- my username on the linux server (and also my home-directory)

public_key.ppk --- the file I'm trying to copy to the linux server

C:\Users\Michael Storm\Desktop\Folder\public_key.ppk --- the filepath (on my laptop)

(Just to be clear : there is a space-break between "public_key.ppk" and "mstorm". This forum carried over the second half of my command to the next line)

This command gave me the error : UNKNOWN COMMAND PSCP

So, I changed "PSCP" to "SCP", and I got the error :

ssh: Could not resolve hostname C: Name or service not known Permission denied (publickey). lost connection

In addition, I should mention : I cannot use any File Transfer clients (like FileZilla, or WinSCP), because : I connect to the linux server via a public key. There is no password.

FTP clients require a password to connect.

phpnewbie2015
  • 346
  • 1
  • 3
  • 15
  • Do not use letter C: http://stackoverflow.com/questions/8975798/scp-w-ssh-copying-a-local-file-from-windows-to-a-remote-server-using-scp – MTP Nov 23 '15 at 17:30
  • I removed the "C", and got this : Permission denied (publickey). lost connection So, I'm guessing I do not have the proper rights? – phpnewbie2015 Nov 23 '15 at 17:34
  • Filezilla can handle publick keys. See https://wiki.filezilla-project.org/Howto – LaszloLadanyi Nov 23 '15 at 18:03
  • 1
    Possible duplicate of [Using putty to scp from windows to Linux](http://stackoverflow.com/questions/21587036/using-putty-to-scp-from-windows-to-linux) – Anthony Geoghegan Nov 23 '15 at 18:08

1 Answers1

2

As windows does not have direct ssh connection, you cannot do it. Let me give an example, assume that you have multi OS(windows, Centos) installed in single machine. You can mount windows partition in Linux. Thus you can see your windows file from Linux. And you can easly copy or delete windows files from Linux. However you cannot easly mount Linux partitions to Windows. However there is some 3th party applications that you can do(I have never tried!)

For your simple question, you can use WinSCP. Install WinSCP to your Windows and make connection to your Linux. It is like putty with GUI. You can make direct connection to your linux and copy your files from Linux to Windows and vice-versa.

goGud
  • 3,647
  • 7
  • 31
  • 58