1511b41d2SMark Murray.\" 2511b41d2SMark Murray.\" scp.1 3511b41d2SMark Murray.\" 4511b41d2SMark Murray.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 5511b41d2SMark Murray.\" 6511b41d2SMark Murray.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 7511b41d2SMark Murray.\" All rights reserved 8511b41d2SMark Murray.\" 9511b41d2SMark Murray.\" Created: Sun May 7 00:14:37 1995 ylo 10511b41d2SMark Murray.\" 11*f374ba41SEd Maste.\" $OpenBSD: scp.1,v 1.112 2022/12/16 07:13:22 djm Exp $ 12511b41d2SMark Murray.\" 13*f374ba41SEd Maste.Dd $Mdocdate: December 16 2022 $ 14511b41d2SMark Murray.Dt SCP 1 15511b41d2SMark Murray.Os 16511b41d2SMark Murray.Sh NAME 17511b41d2SMark Murray.Nm scp 1819261079SEd Maste.Nd OpenSSH secure file copy 19511b41d2SMark Murray.Sh SYNOPSIS 20511b41d2SMark Murray.Nm scp 2119261079SEd Maste.Op Fl 346ABCOpqRrsTv 22511b41d2SMark Murray.Op Fl c Ar cipher 2319261079SEd Maste.Op Fl D Ar sftp_server_path 24efcad6b7SDag-Erling Smørgrav.Op Fl F Ar ssh_config 25511b41d2SMark Murray.Op Fl i Ar identity_file 2619261079SEd Maste.Op Fl J Ar destination 27d0c8c0bcSDag-Erling Smørgrav.Op Fl l Ar limit 28ae1f160dSDag-Erling Smørgrav.Op Fl o Ar ssh_option 29efcad6b7SDag-Erling Smørgrav.Op Fl P Ar port 30efcad6b7SDag-Erling Smørgrav.Op Fl S Ar program 31*f374ba41SEd Maste.Op Fl X Ar sftp_option 3247dd1d1bSDag-Erling Smørgrav.Ar source ... target 33511b41d2SMark Murray.Sh DESCRIPTION 34511b41d2SMark Murray.Nm 35a8f6863aSKris Kennawaycopies files between hosts on a network. 3619261079SEd Maste.Pp 37*f374ba41SEd Maste.Nm 38*f374ba41SEd Masteuses the SFTP protocol over a 39511b41d2SMark Murray.Xr ssh 1 40*f374ba41SEd Masteconnection for data transfer, and uses the same authentication and provides 41*f374ba41SEd Mastethe same security as a login session. 4219261079SEd Maste.Pp 43511b41d2SMark Murray.Nm 44511b41d2SMark Murraywill ask for passwords or passphrases if they are needed for 45511b41d2SMark Murrayauthentication. 46511b41d2SMark Murray.Pp 4747dd1d1bSDag-Erling SmørgravThe 4847dd1d1bSDag-Erling Smørgrav.Ar source 4947dd1d1bSDag-Erling Smørgravand 5047dd1d1bSDag-Erling Smørgrav.Ar target 5147dd1d1bSDag-Erling Smørgravmay be specified as a local pathname, a remote host with optional path 5247dd1d1bSDag-Erling Smørgravin the form 5347dd1d1bSDag-Erling Smørgrav.Sm off 5447dd1d1bSDag-Erling Smørgrav.Oo user @ Oc host : Op path , 5547dd1d1bSDag-Erling Smørgrav.Sm on 5647dd1d1bSDag-Erling Smørgravor a URI in the form 5747dd1d1bSDag-Erling Smørgrav.Sm off 5847dd1d1bSDag-Erling Smørgrav.No scp:// Oo user @ Oc host Oo : port Oc Op / path . 5947dd1d1bSDag-Erling Smørgrav.Sm on 60d4af9e69SDag-Erling SmørgravLocal file names can be made explicit using absolute or relative pathnames 61d4af9e69SDag-Erling Smørgravto avoid 62d4af9e69SDag-Erling Smørgrav.Nm 63d4af9e69SDag-Erling Smørgravtreating file names containing 64d4af9e69SDag-Erling Smørgrav.Sq :\& 65d4af9e69SDag-Erling Smørgravas host specifiers. 6647dd1d1bSDag-Erling Smørgrav.Pp 6747dd1d1bSDag-Erling SmørgravWhen copying between two remote hosts, if the URI format is used, a 6847dd1d1bSDag-Erling Smørgrav.Ar port 6919261079SEd Mastecannot be specified on the 7047dd1d1bSDag-Erling Smørgrav.Ar target 7147dd1d1bSDag-Erling Smørgravif the 7219261079SEd Maste.Fl R 7347dd1d1bSDag-Erling Smørgravoption is used. 74511b41d2SMark Murray.Pp 75511b41d2SMark MurrayThe options are as follows: 76511b41d2SMark Murray.Bl -tag -width Ds 774a421b63SDag-Erling Smørgrav.It Fl 3 784a421b63SDag-Erling SmørgravCopies between two remote hosts are transferred through the local host. 794a421b63SDag-Erling SmørgravWithout this option the data is copied directly between the two remote 804a421b63SDag-Erling Smørgravhosts. 81fb5aabcbSEd MasteNote that, when using the legacy SCP protocol (via the 82fb5aabcbSEd Maste.Fl O 83fb5aabcbSEd Masteflag), this option 8419261079SEd Masteselects batch mode for the second host as 8519261079SEd Maste.Nm 8619261079SEd Mastecannot ask for passwords or passphrases for both hosts. 8719261079SEd MasteThis mode is the default. 88511b41d2SMark Murray.It Fl 4 89511b41d2SMark MurrayForces 90511b41d2SMark Murray.Nm 91511b41d2SMark Murrayto use IPv4 addresses only. 92511b41d2SMark Murray.It Fl 6 93511b41d2SMark MurrayForces 94511b41d2SMark Murray.Nm 95511b41d2SMark Murrayto use IPv6 addresses only. 9619261079SEd Maste.It Fl A 9719261079SEd MasteAllows forwarding of 9819261079SEd Maste.Xr ssh-agent 1 9919261079SEd Masteto the remote system. 10019261079SEd MasteThe default is not to forward an authentication agent. 101efcad6b7SDag-Erling Smørgrav.It Fl B 102efcad6b7SDag-Erling SmørgravSelects batch mode (prevents asking for passwords or passphrases). 103efcad6b7SDag-Erling Smørgrav.It Fl C 104efcad6b7SDag-Erling SmørgravCompression enable. 105efcad6b7SDag-Erling SmørgravPasses the 106efcad6b7SDag-Erling Smørgrav.Fl C 107efcad6b7SDag-Erling Smørgravflag to 108efcad6b7SDag-Erling Smørgrav.Xr ssh 1 109efcad6b7SDag-Erling Smørgravto enable compression. 110efcad6b7SDag-Erling Smørgrav.It Fl c Ar cipher 111efcad6b7SDag-Erling SmørgravSelects the cipher to use for encrypting the data transfer. 112efcad6b7SDag-Erling SmørgravThis option is directly passed to 113efcad6b7SDag-Erling Smørgrav.Xr ssh 1 . 11419261079SEd Maste.It Fl D Ar sftp_server_path 115*f374ba41SEd MasteConnect directly to a local SFTP server program rather than a 11619261079SEd Masteremote one via 11719261079SEd Maste.Xr ssh 1 . 11819261079SEd MasteThis option may be useful in debugging the client and server. 119efcad6b7SDag-Erling Smørgrav.It Fl F Ar ssh_config 120efcad6b7SDag-Erling SmørgravSpecifies an alternative 121efcad6b7SDag-Erling Smørgravper-user configuration file for 122efcad6b7SDag-Erling Smørgrav.Nm ssh . 123efcad6b7SDag-Erling SmørgravThis option is directly passed to 124efcad6b7SDag-Erling Smørgrav.Xr ssh 1 . 125efcad6b7SDag-Erling Smørgrav.It Fl i Ar identity_file 126d4af9e69SDag-Erling SmørgravSelects the file from which the identity (private key) for public key 127efcad6b7SDag-Erling Smørgravauthentication is read. 128efcad6b7SDag-Erling SmørgravThis option is directly passed to 129efcad6b7SDag-Erling Smørgrav.Xr ssh 1 . 13019261079SEd Maste.It Fl J Ar destination 13119261079SEd MasteConnect to the target host by first making an 13219261079SEd Maste.Nm 13319261079SEd Masteconnection to the jump host described by 13419261079SEd Maste.Ar destination 13519261079SEd Masteand then establishing a TCP forwarding to the ultimate destination from 13619261079SEd Mastethere. 13719261079SEd MasteMultiple jump hops may be specified separated by comma characters. 13819261079SEd MasteThis is a shortcut to specify a 13919261079SEd Maste.Cm ProxyJump 14019261079SEd Masteconfiguration directive. 14119261079SEd MasteThis option is directly passed to 14219261079SEd Maste.Xr ssh 1 . 143efcad6b7SDag-Erling Smørgrav.It Fl l Ar limit 144efcad6b7SDag-Erling SmørgravLimits the used bandwidth, specified in Kbit/s. 14519261079SEd Maste.It Fl O 146fb5aabcbSEd MasteUse the legacy SCP protocol for file transfers instead of the SFTP protocol. 14719261079SEd MasteForcing the use of the SCP protocol may be necessary for servers that do 148e9e8876aSEd Mastenot implement SFTP, for backwards-compatibility for particular filename 149e9e8876aSEd Mastewildcard patterns and for expanding paths with a 150e9e8876aSEd Maste.Sq ~ 151e9e8876aSEd Masteprefix for older SFTP servers. 152efcad6b7SDag-Erling Smørgrav.It Fl o Ar ssh_option 153efcad6b7SDag-Erling SmørgravCan be used to pass options to 154efcad6b7SDag-Erling Smørgrav.Nm ssh 155efcad6b7SDag-Erling Smørgravin the format used in 156efcad6b7SDag-Erling Smørgrav.Xr ssh_config 5 . 157efcad6b7SDag-Erling SmørgravThis is useful for specifying options 158efcad6b7SDag-Erling Smørgravfor which there is no separate 159efcad6b7SDag-Erling Smørgrav.Nm scp 160efcad6b7SDag-Erling Smørgravcommand-line flag. 161efcad6b7SDag-Erling SmørgravFor full details of the options listed below, and their possible values, see 162efcad6b7SDag-Erling Smørgrav.Xr ssh_config 5 . 163efcad6b7SDag-Erling Smørgrav.Pp 164efcad6b7SDag-Erling Smørgrav.Bl -tag -width Ds -offset indent -compact 165efcad6b7SDag-Erling Smørgrav.It AddressFamily 166efcad6b7SDag-Erling Smørgrav.It BatchMode 167efcad6b7SDag-Erling Smørgrav.It BindAddress 16847dd1d1bSDag-Erling Smørgrav.It BindInterface 169f7167e0eSDag-Erling Smørgrav.It CanonicalDomains 170f7167e0eSDag-Erling Smørgrav.It CanonicalizeFallbackLocal 171f7167e0eSDag-Erling Smørgrav.It CanonicalizeHostname 172f7167e0eSDag-Erling Smørgrav.It CanonicalizeMaxDots 173f7167e0eSDag-Erling Smørgrav.It CanonicalizePermittedCNAMEs 1742f513db7SEd Maste.It CASignatureAlgorithms 175acc1a9efSDag-Erling Smørgrav.It CertificateFile 176efcad6b7SDag-Erling Smørgrav.It CheckHostIP 177efcad6b7SDag-Erling Smørgrav.It Ciphers 178efcad6b7SDag-Erling Smørgrav.It Compression 179efcad6b7SDag-Erling Smørgrav.It ConnectionAttempts 180d74d50a8SDag-Erling Smørgrav.It ConnectTimeout 181d74d50a8SDag-Erling Smørgrav.It ControlMaster 182d74d50a8SDag-Erling Smørgrav.It ControlPath 183462c32cbSDag-Erling Smørgrav.It ControlPersist 184efcad6b7SDag-Erling Smørgrav.It GlobalKnownHostsFile 185efcad6b7SDag-Erling Smørgrav.It GSSAPIAuthentication 186efcad6b7SDag-Erling Smørgrav.It GSSAPIDelegateCredentials 1875e8dbd04SDag-Erling Smørgrav.It HashKnownHosts 188efcad6b7SDag-Erling Smørgrav.It Host 18919261079SEd Maste.It HostbasedAcceptedAlgorithms 190efcad6b7SDag-Erling Smørgrav.It HostbasedAuthentication 191efcad6b7SDag-Erling Smørgrav.It HostKeyAlgorithms 192efcad6b7SDag-Erling Smørgrav.It HostKeyAlias 19319261079SEd Maste.It Hostname 19452028650SDag-Erling Smørgrav.It IdentitiesOnly 195076ad2f8SDag-Erling Smørgrav.It IdentityAgent 196076ad2f8SDag-Erling Smørgrav.It IdentityFile 1974a421b63SDag-Erling Smørgrav.It IPQoS 198462c32cbSDag-Erling Smørgrav.It KbdInteractiveAuthentication 1995e8dbd04SDag-Erling Smørgrav.It KbdInteractiveDevices 2004a421b63SDag-Erling Smørgrav.It KexAlgorithms 20119261079SEd Maste.It KnownHostsCommand 202efcad6b7SDag-Erling Smørgrav.It LogLevel 203efcad6b7SDag-Erling Smørgrav.It MACs 204efcad6b7SDag-Erling Smørgrav.It NoHostAuthenticationForLocalhost 205efcad6b7SDag-Erling Smørgrav.It NumberOfPasswordPrompts 206efcad6b7SDag-Erling Smørgrav.It PasswordAuthentication 207b15c8340SDag-Erling Smørgrav.It PKCS11Provider 208efcad6b7SDag-Erling Smørgrav.It Port 209efcad6b7SDag-Erling Smørgrav.It PreferredAuthentications 210efcad6b7SDag-Erling Smørgrav.It ProxyCommand 211076ad2f8SDag-Erling Smørgrav.It ProxyJump 21219261079SEd Maste.It PubkeyAcceptedAlgorithms 213efcad6b7SDag-Erling Smørgrav.It PubkeyAuthentication 214021d409fSDag-Erling Smørgrav.It RekeyLimit 21538a52bd3SEd Maste.It RequiredRSASize 216d74d50a8SDag-Erling Smørgrav.It SendEnv 217efcad6b7SDag-Erling Smørgrav.It ServerAliveInterval 218efcad6b7SDag-Erling Smørgrav.It ServerAliveCountMax 219190cef3dSDag-Erling Smørgrav.It SetEnv 220efcad6b7SDag-Erling Smørgrav.It StrictHostKeyChecking 221efcad6b7SDag-Erling Smørgrav.It TCPKeepAlive 222bc5531deSDag-Erling Smørgrav.It UpdateHostKeys 223efcad6b7SDag-Erling Smørgrav.It User 224efcad6b7SDag-Erling Smørgrav.It UserKnownHostsFile 225efcad6b7SDag-Erling Smørgrav.It VerifyHostKeyDNS 226efcad6b7SDag-Erling Smørgrav.El 227efcad6b7SDag-Erling Smørgrav.It Fl P Ar port 228efcad6b7SDag-Erling SmørgravSpecifies the port to connect to on the remote host. 229efcad6b7SDag-Erling SmørgravNote that this option is written with a capital 230efcad6b7SDag-Erling Smørgrav.Sq P , 231efcad6b7SDag-Erling Smørgravbecause 232efcad6b7SDag-Erling Smørgrav.Fl p 233e9e8876aSEd Masteis already reserved for preserving the times and mode bits of the file. 234efcad6b7SDag-Erling Smørgrav.It Fl p 235e9e8876aSEd MastePreserves modification times, access times, and file mode bits from the 236e9e8876aSEd Mastesource file. 237efcad6b7SDag-Erling Smørgrav.It Fl q 238d4af9e69SDag-Erling SmørgravQuiet mode: disables the progress meter as well as warning and diagnostic 239d4af9e69SDag-Erling Smørgravmessages from 240d4af9e69SDag-Erling Smørgrav.Xr ssh 1 . 24119261079SEd Maste.It Fl R 24219261079SEd MasteCopies between two remote hosts are performed by connecting to the origin 24319261079SEd Mastehost and executing 24419261079SEd Maste.Nm 24519261079SEd Mastethere. 24619261079SEd MasteThis requires that 24719261079SEd Maste.Nm 24819261079SEd Masterunning on the origin host can authenticate to the destination host without 24919261079SEd Masterequiring a password. 250efcad6b7SDag-Erling Smørgrav.It Fl r 251efcad6b7SDag-Erling SmørgravRecursively copy entire directories. 252d4af9e69SDag-Erling SmørgravNote that 253d4af9e69SDag-Erling Smørgrav.Nm 254d4af9e69SDag-Erling Smørgravfollows symbolic links encountered in the tree traversal. 255efcad6b7SDag-Erling Smørgrav.It Fl S Ar program 256efcad6b7SDag-Erling SmørgravName of 257efcad6b7SDag-Erling Smørgrav.Ar program 258efcad6b7SDag-Erling Smørgravto use for the encrypted connection. 259efcad6b7SDag-Erling SmørgravThe program must understand 260efcad6b7SDag-Erling Smørgrav.Xr ssh 1 261efcad6b7SDag-Erling Smørgravoptions. 262afde5170SEd Maste.It Fl T 263afde5170SEd MasteDisable strict filename checking. 264afde5170SEd MasteBy default when copying files from a remote host to a local directory 265afde5170SEd Maste.Nm 266afde5170SEd Mastechecks that the received filenames match those requested on the command-line 267afde5170SEd Masteto prevent the remote end from sending unexpected or unwanted files. 268afde5170SEd MasteBecause of differences in how various operating systems and shells interpret 269afde5170SEd Mastefilename wildcards, these checks may cause wanted files to be rejected. 270afde5170SEd MasteThis option disables these checks at the expense of fully trusting that 271afde5170SEd Mastethe server will not send unexpected filenames. 272efcad6b7SDag-Erling Smørgrav.It Fl v 273efcad6b7SDag-Erling SmørgravVerbose mode. 274efcad6b7SDag-Erling SmørgravCauses 275efcad6b7SDag-Erling Smørgrav.Nm 276efcad6b7SDag-Erling Smørgravand 277efcad6b7SDag-Erling Smørgrav.Xr ssh 1 278efcad6b7SDag-Erling Smørgravto print debugging messages about their progress. 279efcad6b7SDag-Erling SmørgravThis is helpful in 280efcad6b7SDag-Erling Smørgravdebugging connection, authentication, and configuration problems. 281*f374ba41SEd Maste.It Fl X Ar sftp_option 282*f374ba41SEd MasteSpecify an option that controls aspects of SFTP protocol behaviour. 283*f374ba41SEd MasteThe valid options are: 284*f374ba41SEd Maste.Bl -tag -width Ds 285*f374ba41SEd Maste.It Cm nrequests Ns = Ns Ar value 286*f374ba41SEd MasteControls how many concurrent SFTP read or write requests may be in progress 287*f374ba41SEd Masteat any point in time during a download or upload. 288*f374ba41SEd MasteBy default 64 requests may be active concurrently. 289*f374ba41SEd Maste.It Cm buffer Ns = Ns Ar value 290*f374ba41SEd MasteControls the maximum buffer size for a single SFTP read/write operation used 291*f374ba41SEd Masteduring download or upload. 292*f374ba41SEd MasteBy default a 32KB buffer is used. 293*f374ba41SEd Maste.El 294b66f2d16SKris Kennaway.El 2954a421b63SDag-Erling Smørgrav.Sh EXIT STATUS 296761efaa7SDag-Erling Smørgrav.Ex -std scp 297511b41d2SMark Murray.Sh SEE ALSO 2981e8db6e2SBrian Feldman.Xr sftp 1 , 299511b41d2SMark Murray.Xr ssh 1 , 300511b41d2SMark Murray.Xr ssh-add 1 , 301511b41d2SMark Murray.Xr ssh-agent 1 , 302511b41d2SMark Murray.Xr ssh-keygen 1 , 303ee21a45fSDag-Erling Smørgrav.Xr ssh_config 5 , 30419261079SEd Maste.Xr sftp-server 8 , 305511b41d2SMark Murray.Xr sshd 8 306d95e11bfSDag-Erling Smørgrav.Sh HISTORY 307d95e11bfSDag-Erling Smørgrav.Nm 308a0ee8cc6SDag-Erling Smørgravis based on the rcp program in 309f7167e0eSDag-Erling Smørgrav.Bx 310f7167e0eSDag-Erling Smørgravsource code from the Regents of the University of California. 311fb5aabcbSEd Maste.Pp 312fb5aabcbSEd MasteSince OpenSSH 9.0, 313fb5aabcbSEd Maste.Nm 31438a52bd3SEd Mastehas used the SFTP protocol for transfers by default. 315d95e11bfSDag-Erling Smørgrav.Sh AUTHORS 316e4a9863fSDag-Erling Smørgrav.An Timo Rinne Aq Mt tri@iki.fi 317e4a9863fSDag-Erling Smørgrav.An Tatu Ylonen Aq Mt ylo@cs.hut.fi 318e9e8876aSEd Maste.Sh CAVEATS 319fb5aabcbSEd MasteThe legacy SCP protocol (selected by the 320fb5aabcbSEd Maste.Fl O 321fb5aabcbSEd Masteflag) requires execution of the remote user's shell to perform 322e9e8876aSEd Maste.Xr glob 3 323e9e8876aSEd Mastepattern matching. 324e9e8876aSEd MasteThis requires careful quoting of any characters that have special meaning to 325e9e8876aSEd Mastethe remote shell, such as quote characters. 326