As a system administrator or Linux power user, you will regularly need to securely transfer data and backup files between local and remote systems or between two remote systems. The SCP command line utility will assist you in accomplishing this.
In this guide, I'll provide step-by-step instructions on the usage of this tool and in-depth descriptions of the most popular SCP command line options.
SCP short for secure copy protocol is a file transfer network protocol that makes it simple and secure to copy files between two remote systems or between a remote system and a local host.
SCP employs the SSH (Secure Shell) protocol for authentication and encryption, ensuring that the information transmitted is secure from malicious actors.
Before we begin using the SCP (secure copy) command, let's go over the basic syntax.
The syntax for the SCP command is as follows:
SCP [options] [source username@source IP address]:/[directory and file name] [destination username@destination IP address]:/[destination directory]
The SCP command has several command line options that change its behavior. The most commonly used ones are:
You now understand what the SCP command is and what it is used for. In the sections that follow, we will go over some practical examples of how to use this tool to transfer files.