I'm logged into my remote server as root, I want to copy a folder to my local machine. What is wrong with my code below please ?

scp -r myfolder is my local machine's IP address. I keep getting the message :

cp: cannot create directory '': No such file or directory

I can see clearly on my local machine that copyofmyfolder exists, in the correct location.


The error is a missing :.

You are copying a filename on your local machine starting with the name

You probably intended scp -r myfolder
(notice the IP or hostname followed by :)

  • That's much better, that message is gone, but now I get : ssh: connect to host port 22: Connection timed out lost connection do I need to have ssh installed to do this transfer?No other way? – CHarris Aug 12 '16 at 23:31
  • 1
    You need a client on one side and something to accept the connection on the other side. If the receiving side was a BSD or linux I would say you needed to make sure sshd was running. On Windows: no idea. – Hennes Aug 12 '16 at 23:33
  • Yes, I run on Windows. I am using Cygwin, which I believe emulates a Linux environment. – CHarris Aug 12 '16 at 23:39
  • Possible relevant reading: serverfault.com/questions/648855/… – Hennes Aug 12 '16 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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