xref: /freebsd/crypto/openssh/scp.1 (revision 19261079b74319502c6ffa1249920079f0f69a72)
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*19261079SEd Maste.\" $OpenBSD: scp.1,v 1.100 2021/08/11 14:07:54 naddy Exp $
12511b41d2SMark Murray.\"
13*19261079SEd Maste.Dd $Mdocdate: August 11 2021 $
14511b41d2SMark Murray.Dt SCP 1
15511b41d2SMark Murray.Os
16511b41d2SMark Murray.Sh NAME
17511b41d2SMark Murray.Nm scp
18*19261079SEd Maste.Nd OpenSSH secure file copy
19511b41d2SMark Murray.Sh SYNOPSIS
20511b41d2SMark Murray.Nm scp
21*19261079SEd Maste.Op Fl 346ABCOpqRrsTv
22511b41d2SMark Murray.Op Fl c Ar cipher
23*19261079SEd 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
26*19261079SEd 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.
35*19261079SEd Maste.Pp
36a8f6863aSKris KennawayIt uses
37511b41d2SMark Murray.Xr ssh 1
38511b41d2SMark Murrayfor data transfer, and uses the same authentication and provides the
39*19261079SEd Mastesame security as a login session.
40*19261079SEd MasteThe scp protocol requires execution of the remote user's shell to perform
41*19261079SEd Maste.Xr glob 3
42*19261079SEd Mastepattern matching.
43*19261079SEd Maste.Pp
44511b41d2SMark Murray.Nm
45511b41d2SMark Murraywill ask for passwords or passphrases if they are needed for
46511b41d2SMark Murrayauthentication.
47511b41d2SMark Murray.Pp
4847dd1d1bSDag-Erling SmørgravThe
4947dd1d1bSDag-Erling Smørgrav.Ar source
5047dd1d1bSDag-Erling Smørgravand
5147dd1d1bSDag-Erling Smørgrav.Ar target
5247dd1d1bSDag-Erling Smørgravmay be specified as a local pathname, a remote host with optional path
5347dd1d1bSDag-Erling Smørgravin the form
5447dd1d1bSDag-Erling Smørgrav.Sm off
5547dd1d1bSDag-Erling Smørgrav.Oo user @ Oc host : Op path ,
5647dd1d1bSDag-Erling Smørgrav.Sm on
5747dd1d1bSDag-Erling Smørgravor a URI in the form
5847dd1d1bSDag-Erling Smørgrav.Sm off
5947dd1d1bSDag-Erling Smørgrav.No scp:// Oo user @ Oc host Oo : port Oc Op / path .
6047dd1d1bSDag-Erling Smørgrav.Sm on
61d4af9e69SDag-Erling SmørgravLocal file names can be made explicit using absolute or relative pathnames
62d4af9e69SDag-Erling Smørgravto avoid
63d4af9e69SDag-Erling Smørgrav.Nm
64d4af9e69SDag-Erling Smørgravtreating file names containing
65d4af9e69SDag-Erling Smørgrav.Sq :\&
66d4af9e69SDag-Erling Smørgravas host specifiers.
6747dd1d1bSDag-Erling Smørgrav.Pp
6847dd1d1bSDag-Erling SmørgravWhen copying between two remote hosts, if the URI format is used, a
6947dd1d1bSDag-Erling Smørgrav.Ar port
70*19261079SEd Mastecannot be specified on the
7147dd1d1bSDag-Erling Smørgrav.Ar target
7247dd1d1bSDag-Erling Smørgravif the
73*19261079SEd Maste.Fl R
7447dd1d1bSDag-Erling Smørgravoption is used.
75511b41d2SMark Murray.Pp
76511b41d2SMark MurrayThe options are as follows:
77511b41d2SMark Murray.Bl -tag -width Ds
784a421b63SDag-Erling Smørgrav.It Fl 3
794a421b63SDag-Erling SmørgravCopies between two remote hosts are transferred through the local host.
804a421b63SDag-Erling SmørgravWithout this option the data is copied directly between the two remote
814a421b63SDag-Erling Smørgravhosts.
82*19261079SEd MasteNote that, when using the legacy SCP protocol (the default), this option
83*19261079SEd Masteselects batch mode for the second host as
84*19261079SEd Maste.Nm
85*19261079SEd Mastecannot ask for passwords or passphrases for both hosts.
86*19261079SEd MasteThis mode is the default.
87511b41d2SMark Murray.It Fl 4
88511b41d2SMark MurrayForces
89511b41d2SMark Murray.Nm
90511b41d2SMark Murrayto use IPv4 addresses only.
91511b41d2SMark Murray.It Fl 6
92511b41d2SMark MurrayForces
93511b41d2SMark Murray.Nm
94511b41d2SMark Murrayto use IPv6 addresses only.
95*19261079SEd Maste.It Fl A
96*19261079SEd MasteAllows forwarding of
97*19261079SEd Maste.Xr ssh-agent 1
98*19261079SEd Masteto the remote system.
99*19261079SEd MasteThe default is not to forward an authentication agent.
100efcad6b7SDag-Erling Smørgrav.It Fl B
101efcad6b7SDag-Erling SmørgravSelects batch mode (prevents asking for passwords or passphrases).
102efcad6b7SDag-Erling Smørgrav.It Fl C
103efcad6b7SDag-Erling SmørgravCompression enable.
104efcad6b7SDag-Erling SmørgravPasses the
105efcad6b7SDag-Erling Smørgrav.Fl C
106efcad6b7SDag-Erling Smørgravflag to
107efcad6b7SDag-Erling Smørgrav.Xr ssh 1
108efcad6b7SDag-Erling Smørgravto enable compression.
109efcad6b7SDag-Erling Smørgrav.It Fl c Ar cipher
110efcad6b7SDag-Erling SmørgravSelects the cipher to use for encrypting the data transfer.
111efcad6b7SDag-Erling SmørgravThis option is directly passed to
112efcad6b7SDag-Erling Smørgrav.Xr ssh 1 .
113*19261079SEd Maste.It Fl D Ar sftp_server_path
114*19261079SEd MasteWhen using the SFTP protocol support via
115*19261079SEd Maste.Fl M ,
116*19261079SEd Masteconnect directly to a local SFTP server program rather than a
117*19261079SEd Masteremote one via
118*19261079SEd Maste.Xr ssh 1 .
119*19261079SEd MasteThis option may be useful in debugging the client and server.
120efcad6b7SDag-Erling Smørgrav.It Fl F Ar ssh_config
121efcad6b7SDag-Erling SmørgravSpecifies an alternative
122efcad6b7SDag-Erling Smørgravper-user configuration file for
123efcad6b7SDag-Erling Smørgrav.Nm ssh .
124efcad6b7SDag-Erling SmørgravThis option is directly passed to
125efcad6b7SDag-Erling Smørgrav.Xr ssh 1 .
126efcad6b7SDag-Erling Smørgrav.It Fl i Ar identity_file
127d4af9e69SDag-Erling SmørgravSelects the file from which the identity (private key) for public key
128efcad6b7SDag-Erling Smørgravauthentication is read.
129efcad6b7SDag-Erling SmørgravThis option is directly passed to
130efcad6b7SDag-Erling Smørgrav.Xr ssh 1 .
131*19261079SEd Maste.It Fl J Ar destination
132*19261079SEd MasteConnect to the target host by first making an
133*19261079SEd Maste.Nm
134*19261079SEd Masteconnection to the jump host described by
135*19261079SEd Maste.Ar destination
136*19261079SEd Masteand then establishing a TCP forwarding to the ultimate destination from
137*19261079SEd Mastethere.
138*19261079SEd MasteMultiple jump hops may be specified separated by comma characters.
139*19261079SEd MasteThis is a shortcut to specify a
140*19261079SEd Maste.Cm ProxyJump
141*19261079SEd Masteconfiguration directive.
142*19261079SEd MasteThis option is directly passed to
143*19261079SEd Maste.Xr ssh 1 .
144efcad6b7SDag-Erling Smørgrav.It Fl l Ar limit
145efcad6b7SDag-Erling SmørgravLimits the used bandwidth, specified in Kbit/s.
146*19261079SEd Maste.It Fl O
147*19261079SEd MasteUse the legacy SCP protocol for file transfers instead of the SFTP protocol.
148*19261079SEd MasteForcing the use of the SCP protocol may be necessary for servers that do
149*19261079SEd Mastenot implement SFTP or for backwards-compatibility for particular filename
150*19261079SEd Mastewildcard patterns.
151*19261079SEd MasteThis mode is the default.
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
189*19261079SEd Maste.It HostbasedAcceptedAlgorithms
190efcad6b7SDag-Erling Smørgrav.It HostbasedAuthentication
191efcad6b7SDag-Erling Smørgrav.It HostKeyAlgorithms
192efcad6b7SDag-Erling Smørgrav.It HostKeyAlias
193*19261079SEd 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
201*19261079SEd 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
212*19261079SEd Maste.It PubkeyAcceptedAlgorithms
213efcad6b7SDag-Erling Smørgrav.It PubkeyAuthentication
214021d409fSDag-Erling Smørgrav.It RekeyLimit
215d74d50a8SDag-Erling Smørgrav.It SendEnv
216efcad6b7SDag-Erling Smørgrav.It ServerAliveInterval
217efcad6b7SDag-Erling Smørgrav.It ServerAliveCountMax
218190cef3dSDag-Erling Smørgrav.It SetEnv
219efcad6b7SDag-Erling Smørgrav.It StrictHostKeyChecking
220efcad6b7SDag-Erling Smørgrav.It TCPKeepAlive
221bc5531deSDag-Erling Smørgrav.It UpdateHostKeys
222efcad6b7SDag-Erling Smørgrav.It User
223efcad6b7SDag-Erling Smørgrav.It UserKnownHostsFile
224efcad6b7SDag-Erling Smørgrav.It VerifyHostKeyDNS
225efcad6b7SDag-Erling Smørgrav.El
226efcad6b7SDag-Erling Smørgrav.It Fl P Ar port
227efcad6b7SDag-Erling SmørgravSpecifies the port to connect to on the remote host.
228efcad6b7SDag-Erling SmørgravNote that this option is written with a capital
229efcad6b7SDag-Erling Smørgrav.Sq P ,
230efcad6b7SDag-Erling Smørgravbecause
231efcad6b7SDag-Erling Smørgrav.Fl p
232a0ee8cc6SDag-Erling Smørgravis already reserved for preserving the times and modes of the file.
233efcad6b7SDag-Erling Smørgrav.It Fl p
234efcad6b7SDag-Erling SmørgravPreserves modification times, access times, and modes from the
235efcad6b7SDag-Erling Smørgravoriginal file.
236efcad6b7SDag-Erling Smørgrav.It Fl q
237d4af9e69SDag-Erling SmørgravQuiet mode: disables the progress meter as well as warning and diagnostic
238d4af9e69SDag-Erling Smørgravmessages from
239d4af9e69SDag-Erling Smørgrav.Xr ssh 1 .
240*19261079SEd Maste.It Fl R
241*19261079SEd MasteCopies between two remote hosts are performed by connecting to the origin
242*19261079SEd Mastehost and executing
243*19261079SEd Maste.Nm
244*19261079SEd Mastethere.
245*19261079SEd MasteThis requires that
246*19261079SEd Maste.Nm
247*19261079SEd Masterunning on the origin host can authenticate to the destination host without
248*19261079SEd Masterequiring a password.
249efcad6b7SDag-Erling Smørgrav.It Fl r
250efcad6b7SDag-Erling SmørgravRecursively copy entire directories.
251d4af9e69SDag-Erling SmørgravNote that
252d4af9e69SDag-Erling Smørgrav.Nm
253d4af9e69SDag-Erling Smørgravfollows symbolic links encountered in the tree traversal.
254efcad6b7SDag-Erling Smørgrav.It Fl S Ar program
255efcad6b7SDag-Erling SmørgravName of
256efcad6b7SDag-Erling Smørgrav.Ar program
257efcad6b7SDag-Erling Smørgravto use for the encrypted connection.
258efcad6b7SDag-Erling SmørgravThe program must understand
259efcad6b7SDag-Erling Smørgrav.Xr ssh 1
260efcad6b7SDag-Erling Smørgravoptions.
261*19261079SEd Maste.It Fl s
262*19261079SEd MasteUse the SFTP protocol for file transfers instead of the legacy SCP protocol.
263*19261079SEd MasteUsing SFTP avoids invoking a shell on the remote side and provides
264*19261079SEd Mastemore predictable filename handling, as the SCP protocol
265*19261079SEd Masterelied on the remote shell for expanding
266*19261079SEd Maste.Xr glob 3
267*19261079SEd Mastewildcards.
268*19261079SEd Maste.Pp
269*19261079SEd MasteA near-future release of OpenSSH will make the SFTP protocol the default.
270*19261079SEd MasteThis option will be deleted before the end of 2022.
271afde5170SEd Maste.It Fl T
272afde5170SEd MasteDisable strict filename checking.
273afde5170SEd MasteBy default when copying files from a remote host to a local directory
274afde5170SEd Maste.Nm
275afde5170SEd Mastechecks that the received filenames match those requested on the command-line
276afde5170SEd Masteto prevent the remote end from sending unexpected or unwanted files.
277afde5170SEd MasteBecause of differences in how various operating systems and shells interpret
278afde5170SEd Mastefilename wildcards, these checks may cause wanted files to be rejected.
279afde5170SEd MasteThis option disables these checks at the expense of fully trusting that
280afde5170SEd Mastethe server will not send unexpected filenames.
281efcad6b7SDag-Erling Smørgrav.It Fl v
282efcad6b7SDag-Erling SmørgravVerbose mode.
283efcad6b7SDag-Erling SmørgravCauses
284efcad6b7SDag-Erling Smørgrav.Nm
285efcad6b7SDag-Erling Smørgravand
286efcad6b7SDag-Erling Smørgrav.Xr ssh 1
287efcad6b7SDag-Erling Smørgravto print debugging messages about their progress.
288efcad6b7SDag-Erling SmørgravThis is helpful in
289efcad6b7SDag-Erling Smørgravdebugging connection, authentication, and configuration problems.
290b66f2d16SKris Kennaway.El
2914a421b63SDag-Erling Smørgrav.Sh EXIT STATUS
292761efaa7SDag-Erling Smørgrav.Ex -std scp
293511b41d2SMark Murray.Sh SEE ALSO
2941e8db6e2SBrian Feldman.Xr sftp 1 ,
295511b41d2SMark Murray.Xr ssh 1 ,
296511b41d2SMark Murray.Xr ssh-add 1 ,
297511b41d2SMark Murray.Xr ssh-agent 1 ,
298511b41d2SMark Murray.Xr ssh-keygen 1 ,
299ee21a45fSDag-Erling Smørgrav.Xr ssh_config 5 ,
300*19261079SEd Maste.Xr sftp-server 8 ,
301511b41d2SMark Murray.Xr sshd 8
302d95e11bfSDag-Erling Smørgrav.Sh HISTORY
303d95e11bfSDag-Erling Smørgrav.Nm
304a0ee8cc6SDag-Erling Smørgravis based on the rcp program in
305f7167e0eSDag-Erling Smørgrav.Bx
306f7167e0eSDag-Erling Smørgravsource code from the Regents of the University of California.
307d95e11bfSDag-Erling Smørgrav.Sh AUTHORS
308e4a9863fSDag-Erling Smørgrav.An Timo Rinne Aq Mt tri@iki.fi
309e4a9863fSDag-Erling Smørgrav.An Tatu Ylonen Aq Mt ylo@cs.hut.fi
310