xref: /freebsd/crypto/openssh/scp.1 (revision 6829dae12bb055451fa467da4589c43bd03b1e64)
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.80 2018/07/19 10:28:47 dtucker Exp $
12.\"
13.Dd $Mdocdate: July 19 2018 $
14.Dt SCP 1
15.Os
16.Sh NAME
17.Nm scp
18.Nd secure copy (remote file copy program)
19.Sh SYNOPSIS
20.Nm scp
21.Op Fl 346BCpqrTv
22.Op Fl c Ar cipher
23.Op Fl F Ar ssh_config
24.Op Fl i Ar identity_file
25.Op Fl l Ar limit
26.Op Fl o Ar ssh_option
27.Op Fl P Ar port
28.Op Fl S Ar program
29.Ar source ... target
30.Sh DESCRIPTION
31.Nm
32copies files between hosts on a network.
33It uses
34.Xr ssh 1
35for data transfer, and uses the same authentication and provides the
36same security as
37.Xr ssh 1 .
38.Nm
39will ask for passwords or passphrases if they are needed for
40authentication.
41.Pp
42The
43.Ar source
44and
45.Ar target
46may be specified as a local pathname, a remote host with optional path
47in the form
48.Sm off
49.Oo user @ Oc host : Op path ,
50.Sm on
51or a URI in the form
52.Sm off
53.No scp:// Oo user @ Oc host Oo : port Oc Op / path .
54.Sm on
55Local file names can be made explicit using absolute or relative pathnames
56to avoid
57.Nm
58treating file names containing
59.Sq :\&
60as host specifiers.
61.Pp
62When copying between two remote hosts, if the URI format is used, a
63.Ar port
64may only be specified on the
65.Ar target
66if the
67.Fl 3
68option is used.
69.Pp
70The options are as follows:
71.Bl -tag -width Ds
72.It Fl 3
73Copies between two remote hosts are transferred through the local host.
74Without this option the data is copied directly between the two remote
75hosts.
76Note that this option disables the progress meter.
77.It Fl 4
78Forces
79.Nm
80to use IPv4 addresses only.
81.It Fl 6
82Forces
83.Nm
84to use IPv6 addresses only.
85.It Fl B
86Selects batch mode (prevents asking for passwords or passphrases).
87.It Fl C
88Compression enable.
89Passes the
90.Fl C
91flag to
92.Xr ssh 1
93to enable compression.
94.It Fl c Ar cipher
95Selects the cipher to use for encrypting the data transfer.
96This option is directly passed to
97.Xr ssh 1 .
98.It Fl F Ar ssh_config
99Specifies an alternative
100per-user configuration file for
101.Nm ssh .
102This option is directly passed to
103.Xr ssh 1 .
104.It Fl i Ar identity_file
105Selects the file from which the identity (private key) for public key
106authentication is read.
107This option is directly passed to
108.Xr ssh 1 .
109.It Fl l Ar limit
110Limits the used bandwidth, specified in Kbit/s.
111.It Fl o Ar ssh_option
112Can be used to pass options to
113.Nm ssh
114in the format used in
115.Xr ssh_config 5 .
116This is useful for specifying options
117for which there is no separate
118.Nm scp
119command-line flag.
120For full details of the options listed below, and their possible values, see
121.Xr ssh_config 5 .
122.Pp
123.Bl -tag -width Ds -offset indent -compact
124.It AddressFamily
125.It BatchMode
126.It BindAddress
127.It BindInterface
128.It CanonicalDomains
129.It CanonicalizeFallbackLocal
130.It CanonicalizeHostname
131.It CanonicalizeMaxDots
132.It CanonicalizePermittedCNAMEs
133.It CertificateFile
134.It ChallengeResponseAuthentication
135.It CheckHostIP
136.It Ciphers
137.It Compression
138.It ConnectionAttempts
139.It ConnectTimeout
140.It ControlMaster
141.It ControlPath
142.It ControlPersist
143.It GlobalKnownHostsFile
144.It GSSAPIAuthentication
145.It GSSAPIDelegateCredentials
146.It HashKnownHosts
147.It Host
148.It HostbasedAuthentication
149.It HostbasedKeyTypes
150.It HostKeyAlgorithms
151.It HostKeyAlias
152.It HostName
153.It IdentitiesOnly
154.It IdentityAgent
155.It IdentityFile
156.It IPQoS
157.It KbdInteractiveAuthentication
158.It KbdInteractiveDevices
159.It KexAlgorithms
160.It LogLevel
161.It MACs
162.It NoHostAuthenticationForLocalhost
163.It NumberOfPasswordPrompts
164.It PasswordAuthentication
165.It PKCS11Provider
166.It Port
167.It PreferredAuthentications
168.It ProxyCommand
169.It ProxyJump
170.It PubkeyAcceptedKeyTypes
171.It PubkeyAuthentication
172.It RekeyLimit
173.It SendEnv
174.It ServerAliveInterval
175.It ServerAliveCountMax
176.It SetEnv
177.It StrictHostKeyChecking
178.It TCPKeepAlive
179.It UpdateHostKeys
180.It User
181.It UserKnownHostsFile
182.It VerifyHostKeyDNS
183.El
184.It Fl P Ar port
185Specifies the port to connect to on the remote host.
186Note that this option is written with a capital
187.Sq P ,
188because
189.Fl p
190is already reserved for preserving the times and modes of the file.
191.It Fl p
192Preserves modification times, access times, and modes from the
193original file.
194.It Fl q
195Quiet mode: disables the progress meter as well as warning and diagnostic
196messages from
197.Xr ssh 1 .
198.It Fl r
199Recursively copy entire directories.
200Note that
201.Nm
202follows symbolic links encountered in the tree traversal.
203.It Fl S Ar program
204Name of
205.Ar program
206to use for the encrypted connection.
207The program must understand
208.Xr ssh 1
209options.
210.It Fl T
211Disable strict filename checking.
212By default when copying files from a remote host to a local directory
213.Nm
214checks that the received filenames match those requested on the command-line
215to prevent the remote end from sending unexpected or unwanted files.
216Because of differences in how various operating systems and shells interpret
217filename wildcards, these checks may cause wanted files to be rejected.
218This option disables these checks at the expense of fully trusting that
219the server will not send unexpected filenames.
220.It Fl v
221Verbose mode.
222Causes
223.Nm
224and
225.Xr ssh 1
226to print debugging messages about their progress.
227This is helpful in
228debugging connection, authentication, and configuration problems.
229.El
230.Sh EXIT STATUS
231.Ex -std scp
232.Sh SEE ALSO
233.Xr sftp 1 ,
234.Xr ssh 1 ,
235.Xr ssh-add 1 ,
236.Xr ssh-agent 1 ,
237.Xr ssh-keygen 1 ,
238.Xr ssh_config 5 ,
239.Xr sshd 8
240.Sh HISTORY
241.Nm
242is based on the rcp program in
243.Bx
244source code from the Regents of the University of California.
245.Sh AUTHORS
246.An Timo Rinne Aq Mt tri@iki.fi
247.An Tatu Ylonen Aq Mt ylo@cs.hut.fi
248