Copy Files using SCP without Remote Log In
Sometimes you need to copy a file from or to a remote hosts. We use the scp command not only in a different but efficient way to copy the file from or to the remote hosts not logging into that remote host.
The syntax is as follows-
* Copy from Remote Host:
$ scp username@<remote-host-name/IP>:<remote-host-file-name-with-location> <path-you-want-to-keep-file>
$ scp email@example.com:/home/jamee/jamee.gz /home/shopno
* Copy to Remote Host:
$ scp <file-name-with-location> <remote-host-name/IP>:<remote-host-path-you-want-to-keep-file>
$ scp /home/jamee/jamee.gz firstname.lastname@example.org:/home/shopno/
Just add a ” -r ” before directory name in case of copying a diretory.