xref: /freebsd/crypto/openssh/scp.1 (revision e9e8876a4d6afc1ad5315faaa191b25121a813d7)
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*e9e8876aSEd Maste.\" $OpenBSD: scp.1,v 1.105 2021/09/20 06:53:56 djm Exp $
12511b41d2SMark Murray.\"
13*e9e8876aSEd Maste.Dd $Mdocdate: September 20 2021 $
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.
79*e9e8876aSEd MasteNote that, when using the original SCP protocol (the default), this option
8019261079SEd Masteselects batch mode for the second host as
8119261079SEd Maste.Nm
8219261079SEd Mastecannot ask for passwords or passphrases for both hosts.
8319261079SEd MasteThis mode is the default.
84511b41d2SMark Murray.It Fl 4
85511b41d2SMark MurrayForces
86511b41d2SMark Murray.Nm
87511b41d2SMark Murrayto use IPv4 addresses only.
88511b41d2SMark Murray.It Fl 6
89511b41d2SMark MurrayForces
90511b41d2SMark Murray.Nm
91511b41d2SMark Murrayto use IPv6 addresses only.
9219261079SEd Maste.It Fl A
9319261079SEd MasteAllows forwarding of
9419261079SEd Maste.Xr ssh-agent 1
9519261079SEd Masteto the remote system.
9619261079SEd MasteThe default is not to forward an authentication agent.
97efcad6b7SDag-Erling Smørgrav.It Fl B
98efcad6b7SDag-Erling SmørgravSelects batch mode (prevents asking for passwords or passphrases).
99efcad6b7SDag-Erling Smørgrav.It Fl C
100efcad6b7SDag-Erling SmørgravCompression enable.
101efcad6b7SDag-Erling SmørgravPasses the
102efcad6b7SDag-Erling Smørgrav.Fl C
103efcad6b7SDag-Erling Smørgravflag to
104efcad6b7SDag-Erling Smørgrav.Xr ssh 1
105efcad6b7SDag-Erling Smørgravto enable compression.
106efcad6b7SDag-Erling Smørgrav.It Fl c Ar cipher
107efcad6b7SDag-Erling SmørgravSelects the cipher to use for encrypting the data transfer.
108efcad6b7SDag-Erling SmørgravThis option is directly passed to
109efcad6b7SDag-Erling Smørgrav.Xr ssh 1 .
11019261079SEd Maste.It Fl D Ar sftp_server_path
11119261079SEd MasteWhen using the SFTP protocol support via
112*e9e8876aSEd Maste.Fl s ,
11319261079SEd Masteconnect directly to a local SFTP server program rather than a
11419261079SEd Masteremote one via
11519261079SEd Maste.Xr ssh 1 .
11619261079SEd MasteThis option may be useful in debugging the client and server.
117efcad6b7SDag-Erling Smørgrav.It Fl F Ar ssh_config
118efcad6b7SDag-Erling SmørgravSpecifies an alternative
119efcad6b7SDag-Erling Smørgravper-user configuration file for
120efcad6b7SDag-Erling Smørgrav.Nm ssh .
121efcad6b7SDag-Erling SmørgravThis option is directly passed to
122efcad6b7SDag-Erling Smørgrav.Xr ssh 1 .
123efcad6b7SDag-Erling Smørgrav.It Fl i Ar identity_file
124d4af9e69SDag-Erling SmørgravSelects the file from which the identity (private key) for public key
125efcad6b7SDag-Erling Smørgravauthentication is read.
126efcad6b7SDag-Erling SmørgravThis option is directly passed to
127efcad6b7SDag-Erling Smørgrav.Xr ssh 1 .
12819261079SEd Maste.It Fl J Ar destination
12919261079SEd MasteConnect to the target host by first making an
13019261079SEd Maste.Nm
13119261079SEd Masteconnection to the jump host described by
13219261079SEd Maste.Ar destination
13319261079SEd Masteand then establishing a TCP forwarding to the ultimate destination from
13419261079SEd Mastethere.
13519261079SEd MasteMultiple jump hops may be specified separated by comma characters.
13619261079SEd MasteThis is a shortcut to specify a
13719261079SEd Maste.Cm ProxyJump
13819261079SEd Masteconfiguration directive.
13919261079SEd MasteThis option is directly passed to
14019261079SEd Maste.Xr ssh 1 .
141efcad6b7SDag-Erling Smørgrav.It Fl l Ar limit
142efcad6b7SDag-Erling SmørgravLimits the used bandwidth, specified in Kbit/s.
14319261079SEd Maste.It Fl O
144*e9e8876aSEd MasteUse the original SCP protocol for file transfers instead of the SFTP protocol.
14519261079SEd MasteForcing the use of the SCP protocol may be necessary for servers that do
146*e9e8876aSEd Mastenot implement SFTP, for backwards-compatibility for particular filename
147*e9e8876aSEd Mastewildcard patterns and for expanding paths with a
148*e9e8876aSEd Maste.Sq ~
149*e9e8876aSEd Masteprefix for older SFTP servers.
15019261079SEd MasteThis mode is the default.
151efcad6b7SDag-Erling Smørgrav.It Fl o Ar ssh_option
152efcad6b7SDag-Erling SmørgravCan be used to pass options to
153efcad6b7SDag-Erling Smørgrav.Nm ssh
154efcad6b7SDag-Erling Smørgravin the format used in
155efcad6b7SDag-Erling Smørgrav.Xr ssh_config 5 .
156efcad6b7SDag-Erling SmørgravThis is useful for specifying options
157efcad6b7SDag-Erling Smørgravfor which there is no separate
158efcad6b7SDag-Erling Smørgrav.Nm scp
159efcad6b7SDag-Erling Smørgravcommand-line flag.
160efcad6b7SDag-Erling SmørgravFor full details of the options listed below, and their possible values, see
161efcad6b7SDag-Erling Smørgrav.Xr ssh_config 5 .
162efcad6b7SDag-Erling Smørgrav.Pp
163efcad6b7SDag-Erling Smørgrav.Bl -tag -width Ds -offset indent -compact
164efcad6b7SDag-Erling Smørgrav.It AddressFamily
165efcad6b7SDag-Erling Smørgrav.It BatchMode
166efcad6b7SDag-Erling Smørgrav.It BindAddress
16747dd1d1bSDag-Erling Smørgrav.It BindInterface
168f7167e0eSDag-Erling Smørgrav.It CanonicalDomains
169f7167e0eSDag-Erling Smørgrav.It CanonicalizeFallbackLocal
170f7167e0eSDag-Erling Smørgrav.It CanonicalizeHostname
171f7167e0eSDag-Erling Smørgrav.It CanonicalizeMaxDots
172f7167e0eSDag-Erling Smørgrav.It CanonicalizePermittedCNAMEs
1732f513db7SEd Maste.It CASignatureAlgorithms
174acc1a9efSDag-Erling Smørgrav.It CertificateFile
175efcad6b7SDag-Erling Smørgrav.It CheckHostIP
176efcad6b7SDag-Erling Smørgrav.It Ciphers
177efcad6b7SDag-Erling Smørgrav.It Compression
178efcad6b7SDag-Erling Smørgrav.It ConnectionAttempts
179d74d50a8SDag-Erling Smørgrav.It ConnectTimeout
180d74d50a8SDag-Erling Smørgrav.It ControlMaster
181d74d50a8SDag-Erling Smørgrav.It ControlPath
182462c32cbSDag-Erling Smørgrav.It ControlPersist
183efcad6b7SDag-Erling Smørgrav.It GlobalKnownHostsFile
184efcad6b7SDag-Erling Smørgrav.It GSSAPIAuthentication
185efcad6b7SDag-Erling Smørgrav.It GSSAPIDelegateCredentials
1865e8dbd04SDag-Erling Smørgrav.It HashKnownHosts
187efcad6b7SDag-Erling Smørgrav.It Host
18819261079SEd Maste.It HostbasedAcceptedAlgorithms
189efcad6b7SDag-Erling Smørgrav.It HostbasedAuthentication
190efcad6b7SDag-Erling Smørgrav.It HostKeyAlgorithms
191efcad6b7SDag-Erling Smørgrav.It HostKeyAlias
19219261079SEd Maste.It Hostname
19352028650SDag-Erling Smørgrav.It IdentitiesOnly
194076ad2f8SDag-Erling Smørgrav.It IdentityAgent
195076ad2f8SDag-Erling Smørgrav.It IdentityFile
1964a421b63SDag-Erling Smørgrav.It IPQoS
197462c32cbSDag-Erling Smørgrav.It KbdInteractiveAuthentication
1985e8dbd04SDag-Erling Smørgrav.It KbdInteractiveDevices
1994a421b63SDag-Erling Smørgrav.It KexAlgorithms
20019261079SEd Maste.It KnownHostsCommand
201efcad6b7SDag-Erling Smørgrav.It LogLevel
202efcad6b7SDag-Erling Smørgrav.It MACs
203efcad6b7SDag-Erling Smørgrav.It NoHostAuthenticationForLocalhost
204efcad6b7SDag-Erling Smørgrav.It NumberOfPasswordPrompts
205efcad6b7SDag-Erling Smørgrav.It PasswordAuthentication
206b15c8340SDag-Erling Smørgrav.It PKCS11Provider
207efcad6b7SDag-Erling Smørgrav.It Port
208efcad6b7SDag-Erling Smørgrav.It PreferredAuthentications
209efcad6b7SDag-Erling Smørgrav.It ProxyCommand
210076ad2f8SDag-Erling Smørgrav.It ProxyJump
21119261079SEd Maste.It PubkeyAcceptedAlgorithms
212efcad6b7SDag-Erling Smørgrav.It PubkeyAuthentication
213021d409fSDag-Erling Smørgrav.It RekeyLimit
214d74d50a8SDag-Erling Smørgrav.It SendEnv
215efcad6b7SDag-Erling Smørgrav.It ServerAliveInterval
216efcad6b7SDag-Erling Smørgrav.It ServerAliveCountMax
217190cef3dSDag-Erling Smørgrav.It SetEnv
218efcad6b7SDag-Erling Smørgrav.It StrictHostKeyChecking
219efcad6b7SDag-Erling Smørgrav.It TCPKeepAlive
220bc5531deSDag-Erling Smørgrav.It UpdateHostKeys
221efcad6b7SDag-Erling Smørgrav.It User
222efcad6b7SDag-Erling Smørgrav.It UserKnownHostsFile
223efcad6b7SDag-Erling Smørgrav.It VerifyHostKeyDNS
224efcad6b7SDag-Erling Smørgrav.El
225efcad6b7SDag-Erling Smørgrav.It Fl P Ar port
226efcad6b7SDag-Erling SmørgravSpecifies the port to connect to on the remote host.
227efcad6b7SDag-Erling SmørgravNote that this option is written with a capital
228efcad6b7SDag-Erling Smørgrav.Sq P ,
229efcad6b7SDag-Erling Smørgravbecause
230efcad6b7SDag-Erling Smørgrav.Fl p
231*e9e8876aSEd Masteis already reserved for preserving the times and mode bits of the file.
232efcad6b7SDag-Erling Smørgrav.It Fl p
233*e9e8876aSEd MastePreserves modification times, access times, and file mode bits from the
234*e9e8876aSEd Mastesource file.
235efcad6b7SDag-Erling Smørgrav.It Fl q
236d4af9e69SDag-Erling SmørgravQuiet mode: disables the progress meter as well as warning and diagnostic
237d4af9e69SDag-Erling Smørgravmessages from
238d4af9e69SDag-Erling Smørgrav.Xr ssh 1 .
23919261079SEd Maste.It Fl R
24019261079SEd MasteCopies between two remote hosts are performed by connecting to the origin
24119261079SEd Mastehost and executing
24219261079SEd Maste.Nm
24319261079SEd Mastethere.
24419261079SEd MasteThis requires that
24519261079SEd Maste.Nm
24619261079SEd Masterunning on the origin host can authenticate to the destination host without
24719261079SEd Masterequiring a password.
248efcad6b7SDag-Erling Smørgrav.It Fl r
249efcad6b7SDag-Erling SmørgravRecursively copy entire directories.
250d4af9e69SDag-Erling SmørgravNote that
251d4af9e69SDag-Erling Smørgrav.Nm
252d4af9e69SDag-Erling Smørgravfollows symbolic links encountered in the tree traversal.
253efcad6b7SDag-Erling Smørgrav.It Fl S Ar program
254efcad6b7SDag-Erling SmørgravName of
255efcad6b7SDag-Erling Smørgrav.Ar program
256efcad6b7SDag-Erling Smørgravto use for the encrypted connection.
257efcad6b7SDag-Erling SmørgravThe program must understand
258efcad6b7SDag-Erling Smørgrav.Xr ssh 1
259efcad6b7SDag-Erling Smørgravoptions.
26019261079SEd Maste.It Fl s
261*e9e8876aSEd MasteUse the SFTP protocol for transfers rather than the original scp protocol.
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.
298d95e11bfSDag-Erling Smørgrav.Sh AUTHORS
299e4a9863fSDag-Erling Smørgrav.An Timo Rinne Aq Mt tri@iki.fi
300e4a9863fSDag-Erling Smørgrav.An Tatu Ylonen Aq Mt ylo@cs.hut.fi
301*e9e8876aSEd Maste.Sh CAVEATS
302*e9e8876aSEd MasteThe original SCP protocol (used by default) requires execution of the
303*e9e8876aSEd Masteremote user's shell to perform
304*e9e8876aSEd Maste.Xr glob 3
305*e9e8876aSEd Mastepattern matching.
306*e9e8876aSEd MasteThis requires careful quoting of any characters that have special meaning to
307*e9e8876aSEd Mastethe remote shell, such as quote characters.
308