How can I get a folder from remote machine to local machine? [closed] How can I get a folder from remote machine to local machine? [closed] linux linux

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


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.


You may also want to check out rsync. It has lots of options for handling duplicates, permissions etc.

rsync -r username@computer:/path/to/source /path/to/dest

or for upload

rsync -r /path/to/source username@computer:/path/to/dest


If you have a folder called working in your user directory, all you need is:

scp -r username@ipaddress:working ./

It's likely you'll get "Permission Denied" with this:

scp -r username@ipaddress:/working ./

Can you check to see if the ssh service is running on the remote machine? If you can login, try:

ps -aux | grep sshd