1.\" 2.\" scp.1 3.\" 4.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 5.\" 6.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 7.\" All rights reserved 8.\" 9.\" Created: Sun May 7 00:14:37 1995 ylo 10.\" 11.\" $OpenBSD: scp.1,v 1.89 2020/04/30 18:28:37 jmc Exp $ 12.\" 13.Dd $Mdocdate: April 30 2020 $ 14.Dt SCP 1 15.Os 16.Sh NAME 17.Nm scp 18.Nd OpenSSH secure file copy 19.Sh SYNOPSIS 20.Nm scp 21.Op Fl 346BCpqrTv 22.Op Fl c Ar cipher 23.Op Fl F Ar ssh_config 24.Op Fl i Ar identity_file 25.Op Fl J Ar destination 26.Op Fl l Ar limit 27.Op Fl o Ar ssh_option 28.Op Fl P Ar port 29.Op Fl S Ar program 30.Ar source ... target 31.Sh DESCRIPTION 32.Nm 33copies files between hosts on a network. 34It uses 35.Xr ssh 1 36for data transfer, and uses the same authentication and provides the 37same security as 38.Xr ssh 1 . 39.Nm 40will ask for passwords or passphrases if they are needed for 41authentication. 42.Pp 43The 44.Ar source 45and 46.Ar target 47may be specified as a local pathname, a remote host with optional path 48in the form 49.Sm off 50.Oo user @ Oc host : Op path , 51.Sm on 52or a URI in the form 53.Sm off 54.No scp:// Oo user @ Oc host Oo : port Oc Op / path . 55.Sm on 56Local file names can be made explicit using absolute or relative pathnames 57to avoid 58.Nm 59treating file names containing 60.Sq :\& 61as host specifiers. 62.Pp 63When copying between two remote hosts, if the URI format is used, a 64.Ar port 65may only be specified on the 66.Ar target 67if the 68.Fl 3 69option is used. 70.Pp 71The options are as follows: 72.Bl -tag -width Ds 73.It Fl 3 74Copies between two remote hosts are transferred through the local host. 75Without this option the data is copied directly between the two remote 76hosts. 77Note that this option disables the progress meter and selects batch mode 78for the second host, since 79.Nm 80cannot ask for passwords or passphrases for both hosts. 81.It Fl 4 82Forces 83.Nm 84to use IPv4 addresses only. 85.It Fl 6 86Forces 87.Nm 88to use IPv6 addresses only. 89.It Fl B 90Selects batch mode (prevents asking for passwords or passphrases). 91.It Fl C 92Compression enable. 93Passes the 94.Fl C 95flag to 96.Xr ssh 1 97to enable compression. 98.It Fl c Ar cipher 99Selects the cipher to use for encrypting the data transfer. 100This option is directly passed to 101.Xr ssh 1 . 102.It Fl F Ar ssh_config 103Specifies an alternative 104per-user configuration file for 105.Nm ssh . 106This option is directly passed to 107.Xr ssh 1 . 108.It Fl i Ar identity_file 109Selects the file from which the identity (private key) for public key 110authentication is read. 111This option is directly passed to 112.Xr ssh 1 . 113.It Fl J Ar destination 114Connect to the target host by first making an 115.Nm 116connection to the jump host described by 117.Ar destination 118and then establishing a TCP forwarding to the ultimate destination from 119there. 120Multiple jump hops may be specified separated by comma characters. 121This is a shortcut to specify a 122.Cm ProxyJump 123configuration directive. 124This option is directly passed to 125.Xr ssh 1 . 126.It Fl l Ar limit 127Limits the used bandwidth, specified in Kbit/s. 128.It Fl o Ar ssh_option 129Can be used to pass options to 130.Nm ssh 131in the format used in 132.Xr ssh_config 5 . 133This is useful for specifying options 134for which there is no separate 135.Nm scp 136command-line flag. 137For full details of the options listed below, and their possible values, see 138.Xr ssh_config 5 . 139.Pp 140.Bl -tag -width Ds -offset indent -compact 141.It AddressFamily 142.It BatchMode 143.It BindAddress 144.It BindInterface 145.It CanonicalDomains 146.It CanonicalizeFallbackLocal 147.It CanonicalizeHostname 148.It CanonicalizeMaxDots 149.It CanonicalizePermittedCNAMEs 150.It CASignatureAlgorithms 151.It CertificateFile 152.It ChallengeResponseAuthentication 153.It CheckHostIP 154.It Ciphers 155.It Compression 156.It ConnectionAttempts 157.It ConnectTimeout 158.It ControlMaster 159.It ControlPath 160.It ControlPersist 161.It GlobalKnownHostsFile 162.It GSSAPIAuthentication 163.It GSSAPIDelegateCredentials 164.It HashKnownHosts 165.It Host 166.It HostbasedAuthentication 167.It HostbasedKeyTypes 168.It HostKeyAlgorithms 169.It HostKeyAlias 170.It Hostname 171.It IdentitiesOnly 172.It IdentityAgent 173.It IdentityFile 174.It IPQoS 175.It KbdInteractiveAuthentication 176.It KbdInteractiveDevices 177.It KexAlgorithms 178.It LogLevel 179.It MACs 180.It NoHostAuthenticationForLocalhost 181.It NumberOfPasswordPrompts 182.It PasswordAuthentication 183.It PKCS11Provider 184.It Port 185.It PreferredAuthentications 186.It ProxyCommand 187.It ProxyJump 188.It PubkeyAcceptedKeyTypes 189.It PubkeyAuthentication 190.It RekeyLimit 191.It SendEnv 192.It ServerAliveInterval 193.It ServerAliveCountMax 194.It SetEnv 195.It StrictHostKeyChecking 196.It TCPKeepAlive 197.It UpdateHostKeys 198.It User 199.It UserKnownHostsFile 200.It VerifyHostKeyDNS 201.El 202.It Fl P Ar port 203Specifies the port to connect to on the remote host. 204Note that this option is written with a capital 205.Sq P , 206because 207.Fl p 208is already reserved for preserving the times and modes of the file. 209.It Fl p 210Preserves modification times, access times, and modes from the 211original file. 212.It Fl q 213Quiet mode: disables the progress meter as well as warning and diagnostic 214messages from 215.Xr ssh 1 . 216.It Fl r 217Recursively copy entire directories. 218Note that 219.Nm 220follows symbolic links encountered in the tree traversal. 221.It Fl S Ar program 222Name of 223.Ar program 224to use for the encrypted connection. 225The program must understand 226.Xr ssh 1 227options. 228.It Fl T 229Disable strict filename checking. 230By default when copying files from a remote host to a local directory 231.Nm 232checks that the received filenames match those requested on the command-line 233to prevent the remote end from sending unexpected or unwanted files. 234Because of differences in how various operating systems and shells interpret 235filename wildcards, these checks may cause wanted files to be rejected. 236This option disables these checks at the expense of fully trusting that 237the server will not send unexpected filenames. 238.It Fl v 239Verbose mode. 240Causes 241.Nm 242and 243.Xr ssh 1 244to print debugging messages about their progress. 245This is helpful in 246debugging connection, authentication, and configuration problems. 247.El 248.Sh EXIT STATUS 249.Ex -std scp 250.Sh SEE ALSO 251.Xr sftp 1 , 252.Xr ssh 1 , 253.Xr ssh-add 1 , 254.Xr ssh-agent 1 , 255.Xr ssh-keygen 1 , 256.Xr ssh_config 5 , 257.Xr sshd 8 258.Sh HISTORY 259.Nm 260is based on the rcp program in 261.Bx 262source code from the Regents of the University of California. 263.Sh AUTHORS 264.An Timo Rinne Aq Mt tri@iki.fi 265.An Tatu Ylonen Aq Mt ylo@cs.hut.fi 266