Secure File Copy (scp)
Use scp to transfer files securely between the local computer and a remote host, or to transfer files securely between two remote hosts.
Both source and destination file names can include host and user specifications to indicate that files are to be copied to or from that host. Copies between two remote hosts are permitted. Wildcards are supported. When recursion is off (the default), name substitution occurs on file names only, not directories. When recursion is enabled (using -r), name substitution includes files and directories. By default, existing files are overwritten. To control overwrite behavior, use --overwrite.
Because scp uses authentication and encryption provided by ssh, a Secure Shell server must be running on the remote computer. Settings for scp connections are controlled by the ssh client configuration file. For details about these settings, see Client Configuration Keywords.
You can also use the -o option to configure settings on the scp command line. Command line options override configuration file settings.
The following samples show how you can use scp to transfer files securely — between a local computer and remote host, or between two remote hosts.