Secure copy protocol (SCP) can be used to transfer a file from one Linux system to another Linux system. For example, the scp command could be used to transfer example.jpg from Machine 1 to Machine 2, or vice versa.
The Secure FTP (SFTP) command can be used to securely transfer files between Mac, Linux and Windows systems.
upload / push / PUT
In this example, example.jpg is transferred from server1 to server2.
[john.doe@server1 ~]# scp '/home/john.doe/example.jpg' jane.doe@server2:'/home/jane.doe'
example.jpg 100$ 12 0.7KB/s 00:02
download / pull / GET
In this example, example.jpg is transferred from server2 to server1.
[john.doe@server1 ~]# scp jane.doe@server2:'/home/jane.doe/example.jpg' '/home/john.doe'
example.jpg 100$ 12 0.7KB/s 00:02
Passwordless Authentication
Refer to public key authentication with OpenSSH (passwordless auth) for the steps on how to connect using a public private keypair.