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*38a52bd3SEd Maste.\" $OpenBSD: scp.1,v 1.110 2022/09/19 21:39:16 djm Exp $ 12511b41d2SMark Murray.\" 13*38a52bd3SEd Maste.Dd $Mdocdate: September 19 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 3147dd1d1bSDag-Erling Smørgrav.Ar source ... target 32511b41d2SMark Murray.Sh DESCRIPTION 33511b41d2SMark Murray.Nm 34a8f6863aSKris Kennawaycopies files between hosts on a network. 3519261079SEd Maste.Pp 36a8f6863aSKris KennawayIt uses 37511b41d2SMark Murray.Xr ssh 1 38511b41d2SMark Murrayfor data transfer, and uses the same authentication and provides the 3919261079SEd Mastesame security as a login session. 4019261079SEd Maste.Pp 41511b41d2SMark Murray.Nm 42511b41d2SMark Murraywill ask for passwords or passphrases if they are needed for 43511b41d2SMark Murrayauthentication. 44511b41d2SMark Murray.Pp 4547dd1d1bSDag-Erling SmørgravThe 4647dd1d1bSDag-Erling Smørgrav.Ar source 4747dd1d1bSDag-Erling Smørgravand 4847dd1d1bSDag-Erling Smørgrav.Ar target 4947dd1d1bSDag-Erling Smørgravmay be specified as a local pathname, a remote host with optional path 5047dd1d1bSDag-Erling Smørgravin the form 5147dd1d1bSDag-Erling Smørgrav.Sm off 5247dd1d1bSDag-Erling Smørgrav.Oo user @ Oc host : Op path , 5347dd1d1bSDag-Erling Smørgrav.Sm on 5447dd1d1bSDag-Erling Smørgravor a URI in the form 5547dd1d1bSDag-Erling Smørgrav.Sm off 5647dd1d1bSDag-Erling Smørgrav.No scp:// Oo user @ Oc host Oo : port Oc Op / path . 5747dd1d1bSDag-Erling Smørgrav.Sm on 58d4af9e69SDag-Erling SmørgravLocal file names can be made explicit using absolute or relative pathnames 59d4af9e69SDag-Erling Smørgravto avoid 60d4af9e69SDag-Erling Smørgrav.Nm 61d4af9e69SDag-Erling Smørgravtreating file names containing 62d4af9e69SDag-Erling Smørgrav.Sq :\& 63d4af9e69SDag-Erling Smørgravas host specifiers. 6447dd1d1bSDag-Erling Smørgrav.Pp 6547dd1d1bSDag-Erling SmørgravWhen copying between two remote hosts, if the URI format is used, a 6647dd1d1bSDag-Erling Smørgrav.Ar port 6719261079SEd Mastecannot be specified on the 6847dd1d1bSDag-Erling Smørgrav.Ar target 6947dd1d1bSDag-Erling Smørgravif the 7019261079SEd Maste.Fl R 7147dd1d1bSDag-Erling Smørgravoption is used. 72511b41d2SMark Murray.Pp 73511b41d2SMark MurrayThe options are as follows: 74511b41d2SMark Murray.Bl -tag -width Ds 754a421b63SDag-Erling Smørgrav.It Fl 3 764a421b63SDag-Erling SmørgravCopies between two remote hosts are transferred through the local host. 774a421b63SDag-Erling SmørgravWithout this option the data is copied directly between the two remote 784a421b63SDag-Erling Smørgravhosts. 79fb5aabcbSEd MasteNote that, when using the legacy SCP protocol (via the 80fb5aabcbSEd Maste.Fl O 81fb5aabcbSEd Masteflag), this option 8219261079SEd Masteselects batch mode for the second host as 8319261079SEd Maste.Nm 8419261079SEd Mastecannot ask for passwords or passphrases for both hosts. 8519261079SEd MasteThis mode is the default. 86511b41d2SMark Murray.It Fl 4 87511b41d2SMark MurrayForces 88511b41d2SMark Murray.Nm 89511b41d2SMark Murrayto use IPv4 addresses only. 90511b41d2SMark Murray.It Fl 6 91511b41d2SMark MurrayForces 92511b41d2SMark Murray.Nm 93511b41d2SMark Murrayto use IPv6 addresses only. 9419261079SEd Maste.It Fl A 9519261079SEd MasteAllows forwarding of 9619261079SEd Maste.Xr ssh-agent 1 9719261079SEd Masteto the remote system. 9819261079SEd MasteThe default is not to forward an authentication agent. 99efcad6b7SDag-Erling Smørgrav.It Fl B 100efcad6b7SDag-Erling SmørgravSelects batch mode (prevents asking for passwords or passphrases). 101efcad6b7SDag-Erling Smørgrav.It Fl C 102efcad6b7SDag-Erling SmørgravCompression enable. 103efcad6b7SDag-Erling SmørgravPasses the 104efcad6b7SDag-Erling Smørgrav.Fl C 105efcad6b7SDag-Erling Smørgravflag to 106efcad6b7SDag-Erling Smørgrav.Xr ssh 1 107efcad6b7SDag-Erling Smørgravto enable compression. 108efcad6b7SDag-Erling Smørgrav.It Fl c Ar cipher 109efcad6b7SDag-Erling SmørgravSelects the cipher to use for encrypting the data transfer. 110efcad6b7SDag-Erling SmørgravThis option is directly passed to 111efcad6b7SDag-Erling Smørgrav.Xr ssh 1 . 11219261079SEd Maste.It Fl D Ar sftp_server_path 11319261079SEd MasteWhen using the SFTP protocol support via 114fb5aabcbSEd Maste.Fl M , 11519261079SEd 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 215*38a52bd3SEd 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. 281b66f2d16SKris Kennaway.El 2824a421b63SDag-Erling Smørgrav.Sh EXIT STATUS 283761efaa7SDag-Erling Smørgrav.Ex -std scp 284511b41d2SMark Murray.Sh SEE ALSO 2851e8db6e2SBrian Feldman.Xr sftp 1 , 286511b41d2SMark Murray.Xr ssh 1 , 287511b41d2SMark Murray.Xr ssh-add 1 , 288511b41d2SMark Murray.Xr ssh-agent 1 , 289511b41d2SMark Murray.Xr ssh-keygen 1 , 290ee21a45fSDag-Erling Smørgrav.Xr ssh_config 5 , 29119261079SEd Maste.Xr sftp-server 8 , 292511b41d2SMark Murray.Xr sshd 8 293d95e11bfSDag-Erling Smørgrav.Sh HISTORY 294d95e11bfSDag-Erling Smørgrav.Nm 295a0ee8cc6SDag-Erling Smørgravis based on the rcp program in 296f7167e0eSDag-Erling Smørgrav.Bx 297f7167e0eSDag-Erling Smørgravsource code from the Regents of the University of California. 298fb5aabcbSEd Maste.Pp 299fb5aabcbSEd MasteSince OpenSSH 9.0, 300fb5aabcbSEd Maste.Nm 301*38a52bd3SEd Mastehas used the SFTP protocol for transfers by default. 302d95e11bfSDag-Erling Smørgrav.Sh AUTHORS 303e4a9863fSDag-Erling Smørgrav.An Timo Rinne Aq Mt tri@iki.fi 304e4a9863fSDag-Erling Smørgrav.An Tatu Ylonen Aq Mt ylo@cs.hut.fi 305e9e8876aSEd Maste.Sh CAVEATS 306fb5aabcbSEd MasteThe legacy SCP protocol (selected by the 307fb5aabcbSEd Maste.Fl O 308fb5aabcbSEd Masteflag) requires execution of the remote user's shell to perform 309e9e8876aSEd Maste.Xr glob 3 310e9e8876aSEd Mastepattern matching. 311e9e8876aSEd MasteThis requires careful quoting of any characters that have special meaning to 312e9e8876aSEd Mastethe remote shell, such as quote characters. 313