Bootstrap FreeKB - Linux Commands - scp (transfer files using secure copy protocol)
Linux Commands - scp (transfer files using secure copy protocol)

Updated:   |  Linux Commands articles

On a Linux System, the most popular ways to transfer a file from one Linux system to another Linux system are:

For example, scp or rsync 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.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 7ab8ac in the box below so that we can be sure you are a human.