Copy Directories via SSH – How to Guide

cpdirectoryssh

I am connected with ssh and I want to copy a directory from my local to our remote server; how can I do that?
I have read several post using scp but that doesn't worked for me. Some posts suggested using rsync but in my case I just wants to copy one directory.

Best Answer

If you want to copy a directory from machine a to b while logged into a:

scp -r /path/to/directory user@ipaddress:/path/to/destination

If you want to copy a directory from machine a to b while logged into b:

scp -r user@ipaddress:/path/to/directory /path/to/destination

I don't quite understand what you mean by "doesn't clicked to me", I have used this method countless times before.

Related Question