How to transfer files using secure copy protocol (SCP)

Home > Search > How-to
  by

Secure copy protocol (SCP) can be used to transfer a file from one computer to another. For example, let's say you want to transfer example.jpg from Machine 1 to Machine 2. The machine the file is being transfered to must be an SSH server. Before using SCP, it is usually best to ensure you can connect to an SSH server.

 


Windows

If Machine 1 is a Windows computer, you would use the command line prompt or PowerShell. In this example, the following example transfers example.jpg from Machine 1 to Machine 2.

[john.doe@server1 ~]# scp C:\users\john.doe\example.jpg jane.doe@machine2:C:\users\jane.doe\
example.jpg        100$ 12  0.7KB/s  00:02

 


Mac / Linux

If Machine 1 is a Mac or Linux computer, you would use the Terminal. In this example, example.jpg is transferred from server1 to server2 (put).

[john.doe@server1 ~]# scp /home/john.doe/example.jpg jane.doe@server2:/home/jane.doe/
example.jpg        100$ 12  0.7KB/s  00:02

 

In this example, example.jpg is transferred from server2 to server1 (get).

[john.doe@server1 ~]# scp jane.doe@server2:/home/jane.doe/example.jpg /home/john.doe
example.jpg        100$ 12  0.7KB/s  00:02

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




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




Comments