When you are working with remote Linux system or server, you might want to download some files from the machine to your machine, or you may want to copy some files from your machine to the remote machine.
Always, there is possibility that you can upload the file to some site and later download to other machine from the site. But Linux has an easy option to copy files form or to server — SCP — that’s Secure Copy.
Secure copy protocol is a means of securely transferring computer files between two hosts.
To copy a file from remote machine to your local machine, use command as below:
scp user@host:/home/user/abc.zip ~/Documents/
To copy any files from your local machine to remote host, use the below command:
scp /home/user/abc.key user@host:/home/user/
If you are using a different port for SSH/SCP specify with -P as below:
scp -P 5412 ...