5

I have some files on my laptop which I want to copy them on a remote cluster. To this end, I use PuTTy to SSH the remote cluster. Then to copy files, I use PuTTy terminal and after logging to the remote system, I write the below instruction,

scp -r ~/Desktop/AFU/ username@host:~/SVM

aiming copy all files in folder C:Users\name\Desktop\AFU in my laptop to a folder named SVM on the remote cluster.

However, it does not work and I get the error:

/home/username/Desktop/AFU: No such file or directory.

Could you please help me? The operating system on my laptop is Windows 8.1.

  • 1
    I don't knwo Windows and I'm quite surprised by your source directory: ~/Desktop/AFU/. Why not C:\Users\name\Desktop\AFU? Does Putty replace ~ with your home directory? Or are you using CygWin? BTW, tell us (by editing your question, not in the comments) what does not work. What is the error message? – xhienne Jan 14 '17 at 12:01
  • what console are you using on the windows system? Did you confirm that the shortcut ~ is correctly resolved on windows? – Timothy Truckle Jan 14 '17 at 12:03
  • When I open Putty, after entering the host name, I press OK button and then a terminal is opened. After entering my password, I connect to the remote cluster. About ~ I am not sure what it does. After running the command I get the error: /home/username/Desktop/AFU: No such file or directory. Also, when I write the complete address, i.e. C:\Users\name\Desktop\AFU I get an error which says ssh could not resolve hostname C: Name or service not found. – user4704857 Jan 14 '17 at 12:13
  • 4
    I'm voting to close this question as off-topic because it is about how to use scp on Windows. – Alexander Jan 14 '17 at 12:40
  • 1
    Are you trying to say that you ssh to remote cluster and fire the scp command on remote cluster where ~/Desktop/AFU doesn't exist but exists on you laptop machine? – pranav Jan 14 '17 at 13:17
8

The scp command you're trying to run is not only wrong, but won't work anyway because it presumes your laptop is running a SSH server.

To do what you want, there's a much simpler way: use WinSCP on your laptop to connect to the remote cluster (it works similarly to PuTTY), then upload the files you want -- in your case, files from C:Users\name\Desktop\AFU in your laptop to ~/SVM on the remote cluster.

7

On your windows machine, use the pscp command that comes with Putty.

Logging into a remote system and then expecting the remote system to find files on your local system will not work (luckily!).

2

From putty's homepage I believe you can download pscp which is a windows scp command application. It works as scp but from the windows side. So, something like this in a cmd windows on the Windows machine:

pscp -r C:/Users/<username>/Desktop/AFU username@linuxhost:~/SVM

Taken from the head, but something like that.

Not the answer you're looking for? Browse other questions tagged or ask your own question.