Quick Links
Key Takeaways
- SCP is a secure and simple way to copy files between Linux computers using SSH. It is easy to use and can be a safe means of transferring files.
- SCP has been considered deprecated since OpenSSH version 8.8, and modern implementations default to using SFTP for file transfers. However, the syntax remains the same.
- While rsync is preferred over scp, scp is still a suitable option for copying files between computers on a self-contained network. SSH must be running on all computers involved in the transfer.
The scp command makes copying files between Linux computers easy and secure. It uses SSH security, but best of all, it is simple. If you can use cp, you can use scp.
What is scp and the Secure Copy Protocol?
Let's define a couple of terms: there's SCP and there's scp. The uppercase SCP stands for the Secure Copy Protocol. The lowercase scp stands for secure cp. In other words, SCP is a protocol and scp is a program.
scp was designed to be a safe and secure means of copying files between remote Linux computers. It uses SSH to establish secure connections. SSH, or secure shell, is a cryptographic network protocol often used to access and log in to remote Linux computers. On Linux distributions, SSH functionality is provided by OpenSSH.
SCP is somewhat long in the tooth, and concerns have been aired concerning its use in the present day. Since OpenSSH version 8.8, SCP has been considered deprecated. Modern implementations of scp default to using the Secure File Transfer Protocol by default. SSH is still used for the secure connection, but the file transfers are handled by SFTP. This is all invisible and happens magically under the hood, and the scp syntax has remained the same.
Thersyncprogram is preferred over scp , but you may encounter a computer that doesn't have rsync installed, and for which you don't have root privileges meaning you can't go ahead and install it. For copying files from computer to computer on a self-contained network, scp is perfectly fine. For scp to work, you must have SSH running on all of the computers you'll be copying to and from.
To see the version of OpenSSH installed on your computer, type:
ssh -V