Nilesh Agrawal Nilesh Agrawal - 1 month ago 5x
Linux Question

How can I get a folder from remote machine to local machine?

I am trying

scp -r usernameipaddress:/path /pathwhereIwanttocopy
, but I am getting it as connection refused.

How can I get it? How can I get connected?


The -r flag should work. In your example you seem to be forgetting the name of the folder you want to copy. Try:

scp -r nameOfFolderToCopy username@ipaddress:/path/to/copy/

to copy a folder from your local computer to a remote one. Or

scp -r username@ipaddress:/path/of/folder/to/copy /target/local/directory

to copy a folder from a remote machine to your local one.