SCP from Remote Host to Local Directory (including all Files and Directories)

To SCP from a remote host, to a local directory, including all files and directories (recursively) you can use the following command:

scp -r -i <path to key> <username>@<remotehost>:~/* .

In the above we’re copying all files from the user’s home directory to the (current) local directory. So doing this as a real world example:

scp -r i c:\users\tristan\.ssh\tristan.key tristan@192.168.1.10:~/* .

Leave a comment