Unix | Securely transfer files in shell (scp/rsync)
On Unix OSes (which includes MacOS), you can use the scp
tool [1] to securely transfer any files from a remote machine that you can SSH [2] into.
For a more advanced tool that has additional options and finer control over the details of the transfer process, use the rsync
tool [3] instead, with the --rsh=ssh
option enabled.
Resources: