]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/scp.1
tcp: Rack compressed ack path updates the recv window too easily
[FreeBSD/FreeBSD.git] / crypto / openssh / scp.1
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.100 2021/08/11 14:07:54 naddy Exp $
12 .\"
13 .Dd $Mdocdate: August 11 2021 $
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 346ABCOpqRrsTv
22 .Op Fl c Ar cipher
23 .Op Fl D Ar sftp_server_path
24 .Op Fl F Ar ssh_config
25 .Op Fl i Ar identity_file
26 .Op Fl J Ar destination
27 .Op Fl l Ar limit
28 .Op Fl o Ar ssh_option
29 .Op Fl P Ar port
30 .Op Fl S Ar program
31 .Ar source ... target
32 .Sh DESCRIPTION
33 .Nm
34 copies files between hosts on a network.
35 .Pp
36 It uses
37 .Xr ssh 1
38 for data transfer, and uses the same authentication and provides the
39 same security as a login session.
40 The scp protocol requires execution of the remote user's shell to perform
41 .Xr glob 3
42 pattern matching.
43 .Pp
44 .Nm
45 will ask for passwords or passphrases if they are needed for
46 authentication.
47 .Pp
48 The
49 .Ar source
50 and
51 .Ar target
52 may be specified as a local pathname, a remote host with optional path
53 in the form
54 .Sm off
55 .Oo user @ Oc host : Op path ,
56 .Sm on
57 or a URI in the form
58 .Sm off
59 .No scp:// Oo user @ Oc host Oo : port Oc Op / path .
60 .Sm on
61 Local file names can be made explicit using absolute or relative pathnames
62 to avoid
63 .Nm
64 treating file names containing
65 .Sq :\&
66 as host specifiers.
67 .Pp
68 When copying between two remote hosts, if the URI format is used, a
69 .Ar port
70 cannot be specified on the
71 .Ar target
72 if the
73 .Fl R
74 option is used.
75 .Pp
76 The options are as follows:
77 .Bl -tag -width Ds
78 .It Fl 3
79 Copies between two remote hosts are transferred through the local host.
80 Without this option the data is copied directly between the two remote
81 hosts.
82 Note that, when using the legacy SCP protocol (the default), this option
83 selects batch mode for the second host as
84 .Nm
85 cannot ask for passwords or passphrases for both hosts.
86 This mode is the default.
87 .It Fl 4
88 Forces
89 .Nm
90 to use IPv4 addresses only.
91 .It Fl 6
92 Forces
93 .Nm
94 to use IPv6 addresses only.
95 .It Fl A
96 Allows forwarding of
97 .Xr ssh-agent 1
98 to the remote system.
99 The default is not to forward an authentication agent.
100 .It Fl B
101 Selects batch mode (prevents asking for passwords or passphrases).
102 .It Fl C
103 Compression enable.
104 Passes the
105 .Fl C
106 flag to
107 .Xr ssh 1
108 to enable compression.
109 .It Fl c Ar cipher
110 Selects the cipher to use for encrypting the data transfer.
111 This option is directly passed to
112 .Xr ssh 1 .
113 .It Fl D Ar sftp_server_path
114 When using the SFTP protocol support via
115 .Fl M ,
116 connect directly to a local SFTP server program rather than a
117 remote one via
118 .Xr ssh 1 .
119 This option may be useful in debugging the client and server.
120 .It Fl F Ar ssh_config
121 Specifies an alternative
122 per-user configuration file for
123 .Nm ssh .
124 This option is directly passed to
125 .Xr ssh 1 .
126 .It Fl i Ar identity_file
127 Selects the file from which the identity (private key) for public key
128 authentication is read.
129 This option is directly passed to
130 .Xr ssh 1 .
131 .It Fl J Ar destination
132 Connect to the target host by first making an
133 .Nm
134 connection to the jump host described by
135 .Ar destination
136 and then establishing a TCP forwarding to the ultimate destination from
137 there.
138 Multiple jump hops may be specified separated by comma characters.
139 This is a shortcut to specify a
140 .Cm ProxyJump
141 configuration directive.
142 This option is directly passed to
143 .Xr ssh 1 .
144 .It Fl l Ar limit
145 Limits the used bandwidth, specified in Kbit/s.
146 .It Fl O
147 Use the legacy SCP protocol for file transfers instead of the SFTP protocol.
148 Forcing the use of the SCP protocol may be necessary for servers that do
149 not implement SFTP or for backwards-compatibility for particular filename
150 wildcard patterns.
151 This mode is the default.
152 .It Fl o Ar ssh_option
153 Can be used to pass options to
154 .Nm ssh
155 in the format used in
156 .Xr ssh_config 5 .
157 This is useful for specifying options
158 for which there is no separate
159 .Nm scp
160 command-line flag.
161 For full details of the options listed below, and their possible values, see
162 .Xr ssh_config 5 .
163 .Pp
164 .Bl -tag -width Ds -offset indent -compact
165 .It AddressFamily
166 .It BatchMode
167 .It BindAddress
168 .It BindInterface
169 .It CanonicalDomains
170 .It CanonicalizeFallbackLocal
171 .It CanonicalizeHostname
172 .It CanonicalizeMaxDots
173 .It CanonicalizePermittedCNAMEs
174 .It CASignatureAlgorithms
175 .It CertificateFile
176 .It CheckHostIP
177 .It Ciphers
178 .It Compression
179 .It ConnectionAttempts
180 .It ConnectTimeout
181 .It ControlMaster
182 .It ControlPath
183 .It ControlPersist
184 .It GlobalKnownHostsFile
185 .It GSSAPIAuthentication
186 .It GSSAPIDelegateCredentials
187 .It HashKnownHosts
188 .It Host
189 .It HostbasedAcceptedAlgorithms
190 .It HostbasedAuthentication
191 .It HostKeyAlgorithms
192 .It HostKeyAlias
193 .It Hostname
194 .It IdentitiesOnly
195 .It IdentityAgent
196 .It IdentityFile
197 .It IPQoS
198 .It KbdInteractiveAuthentication
199 .It KbdInteractiveDevices
200 .It KexAlgorithms
201 .It KnownHostsCommand
202 .It LogLevel
203 .It MACs
204 .It NoHostAuthenticationForLocalhost
205 .It NumberOfPasswordPrompts
206 .It PasswordAuthentication
207 .It PKCS11Provider
208 .It Port
209 .It PreferredAuthentications
210 .It ProxyCommand
211 .It ProxyJump
212 .It PubkeyAcceptedAlgorithms
213 .It PubkeyAuthentication
214 .It RekeyLimit
215 .It SendEnv
216 .It ServerAliveInterval
217 .It ServerAliveCountMax
218 .It SetEnv
219 .It StrictHostKeyChecking
220 .It TCPKeepAlive
221 .It UpdateHostKeys
222 .It User
223 .It UserKnownHostsFile
224 .It VerifyHostKeyDNS
225 .El
226 .It Fl P Ar port
227 Specifies the port to connect to on the remote host.
228 Note that this option is written with a capital
229 .Sq P ,
230 because
231 .Fl p
232 is already reserved for preserving the times and modes of the file.
233 .It Fl p
234 Preserves modification times, access times, and modes from the
235 original file.
236 .It Fl q
237 Quiet mode: disables the progress meter as well as warning and diagnostic
238 messages from
239 .Xr ssh 1 .
240 .It Fl R
241 Copies between two remote hosts are performed by connecting to the origin
242 host and executing
243 .Nm
244 there.
245 This requires that
246 .Nm
247 running on the origin host can authenticate to the destination host without
248 requiring a password.
249 .It Fl r
250 Recursively copy entire directories.
251 Note that
252 .Nm
253 follows symbolic links encountered in the tree traversal.
254 .It Fl S Ar program
255 Name of
256 .Ar program
257 to use for the encrypted connection.
258 The program must understand
259 .Xr ssh 1
260 options.
261 .It Fl s
262 Use the SFTP protocol for file transfers instead of the legacy SCP protocol.
263 Using SFTP avoids invoking a shell on the remote side and provides
264 more predictable filename handling, as the SCP protocol
265 relied on the remote shell for expanding
266 .Xr glob 3
267 wildcards.
268 .Pp
269 A near-future release of OpenSSH will make the SFTP protocol the default.
270 This option will be deleted before the end of 2022.
271 .It Fl T
272 Disable strict filename checking.
273 By default when copying files from a remote host to a local directory
274 .Nm
275 checks that the received filenames match those requested on the command-line
276 to prevent the remote end from sending unexpected or unwanted files.
277 Because of differences in how various operating systems and shells interpret
278 filename wildcards, these checks may cause wanted files to be rejected.
279 This option disables these checks at the expense of fully trusting that
280 the server will not send unexpected filenames.
281 .It Fl v
282 Verbose mode.
283 Causes
284 .Nm
285 and
286 .Xr ssh 1
287 to print debugging messages about their progress.
288 This is helpful in
289 debugging connection, authentication, and configuration problems.
290 .El
291 .Sh EXIT STATUS
292 .Ex -std scp
293 .Sh SEE ALSO
294 .Xr sftp 1 ,
295 .Xr ssh 1 ,
296 .Xr ssh-add 1 ,
297 .Xr ssh-agent 1 ,
298 .Xr ssh-keygen 1 ,
299 .Xr ssh_config 5 ,
300 .Xr sftp-server 8 ,
301 .Xr sshd 8
302 .Sh HISTORY
303 .Nm
304 is based on the rcp program in
305 .Bx
306 source code from the Regents of the University of California.
307 .Sh AUTHORS
308 .An Timo Rinne Aq Mt tri@iki.fi
309 .An Tatu Ylonen Aq Mt ylo@cs.hut.fi