I’ve had to do this often when backing up logs from remote servers.
To copy a folder with all its contents, make sure to use the -r (recursive) flag with scp.
Here’s the command that always works for me:
bash
Copy
Edit
scp -r user@remote:/path/to/foo /home/user/Desktop
This grabs the entire foo directory, including all subfolders and files, and places it right on your desktop.
Just replace user and remote with your actual SSH username and server address. Also, if you’re on a different port (say 2222), don’t forget to add -P 2222.
Hope this helps!