How to Use SCP
SCP (Secure Copy Protocol) is a command-line utility used to securely transfer files between a local and a remote host. It uses SSH (Secure Shell) for the data transfer and provides encryption and authentication.
Basic Syntax of SCP
Where:
options: the options you can use with SCP:-P: the port number to connect to on the remote host.-r: recursively copies entire directories.-p: preserves the modification times, access times, and modes from the original file.-v: enables verbose mode and shows detailed progress information.
source_file_name: the name of the file, including the path, that you want to copy.username: the username on the destination host.destination_host: the IP address or hostname of the destination host.destination_folder: the directory the file is copied to on the destination machine.
Examples
Copy a File to a Remote Server
Copy a Directory to a Remote Server
Copy a File Using a Specific Port
Note
The -P option sets the port on the destination system (the remote host) where the SSH server is running. By default, SCP uses port 22, the standard SSH port. The SSH server on the remote host may be configured to listen on a different port.
More Options
These are basic examples of using SCP. SCP offers many more options for advanced use, such as compression, limiting bandwidth, and specifying private key files.
You can explore them in the SCP manual:

