blob: d5f65af4ebc38b719783ab0d9fa0c2e236e9f0f3 [file] [log] [blame]
Damien Miller32aa1441999-10-29 09:15:49 +10001.\"
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.\"
jmc@openbsd.org261571d2020-04-30 18:28:37 +000011.\" $OpenBSD: scp.1,v 1.89 2020/04/30 18:28:37 jmc Exp $
Damien Miller32aa1441999-10-29 09:15:49 +100012.\"
markus@openbsd.orgea141032020-04-30 17:07:10 +000013.Dd $Mdocdate: April 30 2020 $
Damien Miller32aa1441999-10-29 09:15:49 +100014.Dt SCP 1
15.Os
16.Sh NAME
17.Nm scp
jmc@openbsd.org483cc722019-11-30 07:07:59 +000018.Nd OpenSSH secure file copy
Damien Miller32aa1441999-10-29 09:15:49 +100019.Sh SYNOPSIS
20.Nm scp
djm@openbsd.org391ffc42019-01-26 22:41:28 +000021.Op Fl 346BCpqrTv
Damien Miller32aa1441999-10-29 09:15:49 +100022.Op Fl c Ar cipher
Darren Tucker1f203942003-10-15 15:50:42 +100023.Op Fl F Ar ssh_config
Damien Miller32aa1441999-10-29 09:15:49 +100024.Op Fl i Ar identity_file
jmc@openbsd.orgfd8eb132019-01-22 06:58:31 +000025.Op Fl J Ar destination
Damien Miller8ee66a22003-02-24 11:50:50 +110026.Op Fl l Ar limit
Ben Lindstrom14c62eb2001-08-15 23:25:46 +000027.Op Fl o Ar ssh_option
Darren Tucker1f203942003-10-15 15:50:42 +100028.Op Fl P Ar port
29.Op Fl S Ar program
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000030.Ar source ... target
Damien Miller22c77262000-04-13 12:26:34 +100031.Sh DESCRIPTION
Damien Miller32aa1441999-10-29 09:15:49 +100032.Nm
Damien Miller450a7a12000-03-26 13:04:51 +100033copies files between hosts on a network.
34It uses
Damien Miller32aa1441999-10-29 09:15:49 +100035.Xr ssh 1
36for data transfer, and uses the same authentication and provides the
37same security as
38.Xr ssh 1 .
Damien Miller32aa1441999-10-29 09:15:49 +100039.Nm
40will ask for passwords or passphrases if they are needed for
41authentication.
42.Pp
millert@openbsd.org887669e2017-10-21 23:06:24 +000043The
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000044.Ar source
millert@openbsd.org887669e2017-10-21 23:06:24 +000045and
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000046.Ar target
millert@openbsd.org887669e2017-10-21 23:06:24 +000047may be specified as a local pathname, a remote host with optional path
48in the form
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000049.Sm off
50.Oo user @ Oc host : Op path ,
51.Sm on
52or a URI in the form
53.Sm off
54.No scp:// Oo user @ Oc host Oo : port Oc Op / path .
55.Sm on
Damien Millerb508faa2008-02-10 22:28:45 +110056Local file names can be made explicit using absolute or relative pathnames
57to avoid
58.Nm
59treating file names containing
60.Sq :\&
61as host specifiers.
millert@openbsd.org887669e2017-10-21 23:06:24 +000062.Pp
63When copying between two remote hosts, if the URI format is used, a
64.Ar port
65may only be specified on the
66.Ar target
67if the
68.Fl 3
69option is used.
Damien Miller32aa1441999-10-29 09:15:49 +100070.Pp
71The options are as follows:
72.Bl -tag -width Ds
Damien Millerf1211432011-01-06 22:40:30 +110073.It Fl 3
74Copies between two remote hosts are transferred through the local host.
75Without this option the data is copied directly between the two remote
76hosts.
markus@openbsd.orgea141032020-04-30 17:07:10 +000077Note that this option disables the progress meter and selects batch mode
78for the second host, since
jmc@openbsd.org261571d2020-04-30 18:28:37 +000079.Nm
80cannot ask for passwords or passphrases for both hosts.
Damien Miller34132e52000-01-14 15:45:46 +110081.It Fl 4
82Forces
83.Nm
84to use IPv4 addresses only.
85.It Fl 6
86Forces
87.Nm
88to use IPv6 addresses only.
Darren Tucker1f203942003-10-15 15:50:42 +100089.It Fl B
90Selects batch mode (prevents asking for passwords or passphrases).
91.It Fl C
92Compression enable.
93Passes the
94.Fl C
95flag to
96.Xr ssh 1
97to enable compression.
98.It Fl c Ar cipher
99Selects the cipher to use for encrypting the data transfer.
100This option is directly passed to
101.Xr ssh 1 .
102.It Fl F Ar ssh_config
103Specifies an alternative
104per-user configuration file for
105.Nm ssh .
106This option is directly passed to
107.Xr ssh 1 .
108.It Fl i Ar identity_file
Damien Millera034baf2008-07-12 17:12:49 +1000109Selects the file from which the identity (private key) for public key
Darren Tucker1f203942003-10-15 15:50:42 +1000110authentication is read.
111This option is directly passed to
112.Xr ssh 1 .
tb@openbsd.org622dedf2019-01-21 22:50:42 +0000113.It Fl J Ar destination
jmc@openbsd.orgfd8eb132019-01-22 06:58:31 +0000114Connect to the target host by first making an
tb@openbsd.org622dedf2019-01-21 22:50:42 +0000115.Nm
116connection to the jump host described by
117.Ar destination
118and then establishing a TCP forwarding to the ultimate destination from
119there.
120Multiple jump hops may be specified separated by comma characters.
121This is a shortcut to specify a
122.Cm ProxyJump
123configuration directive.
124This option is directly passed to
125.Xr ssh 1 .
Darren Tucker1f203942003-10-15 15:50:42 +1000126.It Fl l Ar limit
127Limits the used bandwidth, specified in Kbit/s.
128.It Fl o Ar ssh_option
129Can be used to pass options to
130.Nm ssh
131in the format used in
132.Xr ssh_config 5 .
133This is useful for specifying options
134for which there is no separate
135.Nm scp
136command-line flag.
137For full details of the options listed below, and their possible values, see
138.Xr ssh_config 5 .
139.Pp
140.Bl -tag -width Ds -offset indent -compact
141.It AddressFamily
142.It BatchMode
143.It BindAddress
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000144.It BindInterface
Damien Millerc0049bd2013-10-23 16:29:59 +1100145.It CanonicalDomains
146.It CanonicalizeFallbackLocal
147.It CanonicalizeHostname
148.It CanonicalizeMaxDots
149.It CanonicalizePermittedCNAMEs
jmc@openbsd.orge6933a22018-09-20 06:58:48 +0000150.It CASignatureAlgorithms
jmc@openbsd.orgc5f7c082015-09-25 18:19:54 +0000151.It CertificateFile
Darren Tucker1f203942003-10-15 15:50:42 +1000152.It ChallengeResponseAuthentication
153.It CheckHostIP
Darren Tucker1f203942003-10-15 15:50:42 +1000154.It Ciphers
Darren Tucker1f203942003-10-15 15:50:42 +1000155.It Compression
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000156.It ConnectionAttempts
Darren Tuckerc0796d72004-05-03 09:19:03 +1000157.It ConnectTimeout
Damien Miller0e220db2004-06-15 10:34:08 +1000158.It ControlMaster
159.It ControlPath
Damien Millere5777722011-09-22 21:34:15 +1000160.It ControlPersist
Darren Tucker1f203942003-10-15 15:50:42 +1000161.It GlobalKnownHostsFile
162.It GSSAPIAuthentication
163.It GSSAPIDelegateCredentials
Damien Miller27e9c512005-03-02 12:04:16 +1100164.It HashKnownHosts
Darren Tucker1f203942003-10-15 15:50:42 +1000165.It Host
166.It HostbasedAuthentication
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000167.It HostbasedKeyTypes
Darren Tucker1f203942003-10-15 15:50:42 +1000168.It HostKeyAlgorithms
169.It HostKeyAlias
jmc@openbsd.org73491492019-06-12 11:31:50 +0000170.It Hostname
jmc@openbsd.org772e6ce2016-06-29 17:14:28 +0000171.It IdentitiesOnly
markus@openbsd.org75e21682016-05-04 14:32:26 +0000172.It IdentityAgent
Darren Tucker1f203942003-10-15 15:50:42 +1000173.It IdentityFile
Damien Miller0a184732010-11-20 15:21:03 +1100174.It IPQoS
Damien Millere5777722011-09-22 21:34:15 +1000175.It KbdInteractiveAuthentication
Darren Tucker636ca902004-11-05 20:22:00 +1100176.It KbdInteractiveDevices
Damien Miller2beb32f2010-09-24 22:16:03 +1000177.It KexAlgorithms
Darren Tucker1f203942003-10-15 15:50:42 +1000178.It LogLevel
179.It MACs
180.It NoHostAuthenticationForLocalhost
181.It NumberOfPasswordPrompts
182.It PasswordAuthentication
Damien Miller7ea845e2010-02-12 09:21:02 +1100183.It PKCS11Provider
Darren Tucker1f203942003-10-15 15:50:42 +1000184.It Port
185.It PreferredAuthentications
Darren Tucker1f203942003-10-15 15:50:42 +1000186.It ProxyCommand
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +0000187.It ProxyJump
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000188.It PubkeyAcceptedKeyTypes
Darren Tucker1f203942003-10-15 15:50:42 +1000189.It PubkeyAuthentication
Darren Tucker62388b22006-01-20 11:31:47 +1100190.It RekeyLimit
Darren Tucker2e578f62004-05-13 13:03:04 +1000191.It SendEnv
Damien Miller509b0102003-12-17 16:33:10 +1100192.It ServerAliveInterval
193.It ServerAliveCountMax
jmc@openbsd.orgacf42602018-06-09 06:36:31 +0000194.It SetEnv
Darren Tucker1f203942003-10-15 15:50:42 +1000195.It StrictHostKeyChecking
Damien Miller12c150e2003-12-17 16:31:10 +1100196.It TCPKeepAlive
djm@openbsd.org1d1092b2015-01-26 12:16:36 +0000197.It UpdateHostKeys
Darren Tucker1f203942003-10-15 15:50:42 +1000198.It User
199.It UserKnownHostsFile
200.It VerifyHostKeyDNS
Darren Tucker1f203942003-10-15 15:50:42 +1000201.El
202.It Fl P Ar port
203Specifies the port to connect to on the remote host.
204Note that this option is written with a capital
205.Sq P ,
206because
207.Fl p
Damien Miller6e1777f2014-04-20 13:02:58 +1000208is already reserved for preserving the times and modes of the file.
Darren Tucker1f203942003-10-15 15:50:42 +1000209.It Fl p
210Preserves modification times, access times, and modes from the
211original file.
212.It Fl q
Damien Miller4cd24c72008-02-10 22:22:29 +1100213Quiet mode: disables the progress meter as well as warning and diagnostic
214messages from
215.Xr ssh 1 .
Darren Tucker1f203942003-10-15 15:50:42 +1000216.It Fl r
217Recursively copy entire directories.
Damien Millerc7ce0da2008-06-16 07:55:06 +1000218Note that
219.Nm
220follows symbolic links encountered in the tree traversal.
Darren Tucker1f203942003-10-15 15:50:42 +1000221.It Fl S Ar program
222Name of
223.Ar program
224to use for the encrypted connection.
225The program must understand
226.Xr ssh 1
227options.
djm@openbsd.org391ffc42019-01-26 22:41:28 +0000228.It Fl T
229Disable strict filename checking.
230By default when copying files from a remote host to a local directory
231.Nm
232checks that the received filenames match those requested on the command-line
233to prevent the remote end from sending unexpected or unwanted files.
234Because of differences in how various operating systems and shells interpret
235filename wildcards, these checks may cause wanted files to be rejected.
236This option disables these checks at the expense of fully trusting that
237the server will not send unexpected filenames.
Darren Tucker1f203942003-10-15 15:50:42 +1000238.It Fl v
239Verbose mode.
240Causes
241.Nm
242and
243.Xr ssh 1
244to print debugging messages about their progress.
245This is helpful in
246debugging connection, authentication, and configuration problems.
Damien Miller37023962000-07-11 17:31:38 +1000247.El
Damien Miller390f1532010-09-10 11:17:54 +1000248.Sh EXIT STATUS
Damien Miller22d47ab2006-07-24 14:04:36 +1000249.Ex -std scp
Damien Miller32aa1441999-10-29 09:15:49 +1000250.Sh SEE ALSO
Damien Miller33804262001-02-04 23:20:18 +1100251.Xr sftp 1 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000252.Xr ssh 1 ,
253.Xr ssh-add 1 ,
254.Xr ssh-agent 1 ,
255.Xr ssh-keygen 1 ,
Ben Lindstromc06bf702002-06-23 00:34:37 +0000256.Xr ssh_config 5 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000257.Xr sshd 8
Damien Millerf1ce5052003-06-11 22:04:39 +1000258.Sh HISTORY
259.Nm
Damien Miller6e1777f2014-04-20 13:02:58 +1000260is based on the rcp program in
Damien Millerb7727df2013-08-21 02:43:49 +1000261.Bx
262source code from the Regents of the University of California.
Damien Millerf1ce5052003-06-11 22:04:39 +1000263.Sh AUTHORS
Damien Millerbf836e52013-07-18 16:14:13 +1000264.An Timo Rinne Aq Mt tri@iki.fi
265.An Tatu Ylonen Aq Mt ylo@cs.hut.fi