blob: dee7fcead956d7bc7797444a6c22ca580a343c15 [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.org73491492019-06-12 11:31:50 +000011.\" $OpenBSD: scp.1,v 1.86 2019/06/12 11:31:50 jmc Exp $
Damien Miller32aa1441999-10-29 09:15:49 +100012.\"
jmc@openbsd.org73491492019-06-12 11:31:50 +000013.Dd $Mdocdate: June 12 2019 $
Damien Miller32aa1441999-10-29 09:15:49 +100014.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
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.
Damien Miller907998d2011-01-06 22:41:21 +110077Note that this option disables the progress meter.
Damien Miller34132e52000-01-14 15:45:46 +110078.It Fl 4
79Forces
80.Nm
81to use IPv4 addresses only.
82.It Fl 6
83Forces
84.Nm
85to use IPv6 addresses only.
Darren Tucker1f203942003-10-15 15:50:42 +100086.It Fl B
87Selects batch mode (prevents asking for passwords or passphrases).
88.It Fl C
89Compression enable.
90Passes the
91.Fl C
92flag to
93.Xr ssh 1
94to enable compression.
95.It Fl c Ar cipher
96Selects the cipher to use for encrypting the data transfer.
97This option is directly passed to
98.Xr ssh 1 .
99.It Fl F Ar ssh_config
100Specifies an alternative
101per-user configuration file for
102.Nm ssh .
103This option is directly passed to
104.Xr ssh 1 .
105.It Fl i Ar identity_file
Damien Millera034baf2008-07-12 17:12:49 +1000106Selects the file from which the identity (private key) for public key
Darren Tucker1f203942003-10-15 15:50:42 +1000107authentication is read.
108This option is directly passed to
109.Xr ssh 1 .
tb@openbsd.org622dedf2019-01-21 22:50:42 +0000110.It Fl J Ar destination
jmc@openbsd.orgfd8eb132019-01-22 06:58:31 +0000111Connect to the target host by first making an
tb@openbsd.org622dedf2019-01-21 22:50:42 +0000112.Nm
113connection to the jump host described by
114.Ar destination
115and then establishing a TCP forwarding to the ultimate destination from
116there.
117Multiple jump hops may be specified separated by comma characters.
118This is a shortcut to specify a
119.Cm ProxyJump
120configuration directive.
121This option is directly passed to
122.Xr ssh 1 .
Darren Tucker1f203942003-10-15 15:50:42 +1000123.It Fl l Ar limit
124Limits the used bandwidth, specified in Kbit/s.
125.It Fl o Ar ssh_option
126Can be used to pass options to
127.Nm ssh
128in the format used in
129.Xr ssh_config 5 .
130This is useful for specifying options
131for which there is no separate
132.Nm scp
133command-line flag.
134For full details of the options listed below, and their possible values, see
135.Xr ssh_config 5 .
136.Pp
137.Bl -tag -width Ds -offset indent -compact
138.It AddressFamily
139.It BatchMode
140.It BindAddress
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000141.It BindInterface
Damien Millerc0049bd2013-10-23 16:29:59 +1100142.It CanonicalDomains
143.It CanonicalizeFallbackLocal
144.It CanonicalizeHostname
145.It CanonicalizeMaxDots
146.It CanonicalizePermittedCNAMEs
jmc@openbsd.orge6933a22018-09-20 06:58:48 +0000147.It CASignatureAlgorithms
jmc@openbsd.orgc5f7c082015-09-25 18:19:54 +0000148.It CertificateFile
Darren Tucker1f203942003-10-15 15:50:42 +1000149.It ChallengeResponseAuthentication
150.It CheckHostIP
Darren Tucker1f203942003-10-15 15:50:42 +1000151.It Ciphers
Darren Tucker1f203942003-10-15 15:50:42 +1000152.It Compression
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000153.It ConnectionAttempts
Darren Tuckerc0796d72004-05-03 09:19:03 +1000154.It ConnectTimeout
Damien Miller0e220db2004-06-15 10:34:08 +1000155.It ControlMaster
156.It ControlPath
Damien Millere5777722011-09-22 21:34:15 +1000157.It ControlPersist
Darren Tucker1f203942003-10-15 15:50:42 +1000158.It GlobalKnownHostsFile
159.It GSSAPIAuthentication
160.It GSSAPIDelegateCredentials
Damien Miller27e9c512005-03-02 12:04:16 +1100161.It HashKnownHosts
Darren Tucker1f203942003-10-15 15:50:42 +1000162.It Host
163.It HostbasedAuthentication
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000164.It HostbasedKeyTypes
Darren Tucker1f203942003-10-15 15:50:42 +1000165.It HostKeyAlgorithms
166.It HostKeyAlias
jmc@openbsd.org73491492019-06-12 11:31:50 +0000167.It Hostname
jmc@openbsd.org772e6ce2016-06-29 17:14:28 +0000168.It IdentitiesOnly
markus@openbsd.org75e21682016-05-04 14:32:26 +0000169.It IdentityAgent
Darren Tucker1f203942003-10-15 15:50:42 +1000170.It IdentityFile
Damien Miller0a184732010-11-20 15:21:03 +1100171.It IPQoS
Damien Millere5777722011-09-22 21:34:15 +1000172.It KbdInteractiveAuthentication
Darren Tucker636ca902004-11-05 20:22:00 +1100173.It KbdInteractiveDevices
Damien Miller2beb32f2010-09-24 22:16:03 +1000174.It KexAlgorithms
Darren Tucker1f203942003-10-15 15:50:42 +1000175.It LogLevel
176.It MACs
177.It NoHostAuthenticationForLocalhost
178.It NumberOfPasswordPrompts
179.It PasswordAuthentication
Damien Miller7ea845e2010-02-12 09:21:02 +1100180.It PKCS11Provider
Darren Tucker1f203942003-10-15 15:50:42 +1000181.It Port
182.It PreferredAuthentications
Darren Tucker1f203942003-10-15 15:50:42 +1000183.It ProxyCommand
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +0000184.It ProxyJump
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000185.It PubkeyAcceptedKeyTypes
Darren Tucker1f203942003-10-15 15:50:42 +1000186.It PubkeyAuthentication
Darren Tucker62388b22006-01-20 11:31:47 +1100187.It RekeyLimit
Darren Tucker2e578f62004-05-13 13:03:04 +1000188.It SendEnv
Damien Miller509b0102003-12-17 16:33:10 +1100189.It ServerAliveInterval
190.It ServerAliveCountMax
jmc@openbsd.orgacf42602018-06-09 06:36:31 +0000191.It SetEnv
Darren Tucker1f203942003-10-15 15:50:42 +1000192.It StrictHostKeyChecking
Damien Miller12c150e2003-12-17 16:31:10 +1100193.It TCPKeepAlive
djm@openbsd.org1d1092b2015-01-26 12:16:36 +0000194.It UpdateHostKeys
Darren Tucker1f203942003-10-15 15:50:42 +1000195.It User
196.It UserKnownHostsFile
197.It VerifyHostKeyDNS
Darren Tucker1f203942003-10-15 15:50:42 +1000198.El
199.It Fl P Ar port
200Specifies the port to connect to on the remote host.
201Note that this option is written with a capital
202.Sq P ,
203because
204.Fl p
Damien Miller6e1777f2014-04-20 13:02:58 +1000205is already reserved for preserving the times and modes of the file.
Darren Tucker1f203942003-10-15 15:50:42 +1000206.It Fl p
207Preserves modification times, access times, and modes from the
208original file.
209.It Fl q
Damien Miller4cd24c72008-02-10 22:22:29 +1100210Quiet mode: disables the progress meter as well as warning and diagnostic
211messages from
212.Xr ssh 1 .
Darren Tucker1f203942003-10-15 15:50:42 +1000213.It Fl r
214Recursively copy entire directories.
Damien Millerc7ce0da2008-06-16 07:55:06 +1000215Note that
216.Nm
217follows symbolic links encountered in the tree traversal.
Darren Tucker1f203942003-10-15 15:50:42 +1000218.It Fl S Ar program
219Name of
220.Ar program
221to use for the encrypted connection.
222The program must understand
223.Xr ssh 1
224options.
djm@openbsd.org391ffc42019-01-26 22:41:28 +0000225.It Fl T
226Disable strict filename checking.
227By default when copying files from a remote host to a local directory
228.Nm
229checks that the received filenames match those requested on the command-line
230to prevent the remote end from sending unexpected or unwanted files.
231Because of differences in how various operating systems and shells interpret
232filename wildcards, these checks may cause wanted files to be rejected.
233This option disables these checks at the expense of fully trusting that
234the server will not send unexpected filenames.
Darren Tucker1f203942003-10-15 15:50:42 +1000235.It Fl v
236Verbose mode.
237Causes
238.Nm
239and
240.Xr ssh 1
241to print debugging messages about their progress.
242This is helpful in
243debugging connection, authentication, and configuration problems.
Damien Miller37023962000-07-11 17:31:38 +1000244.El
Damien Miller390f1532010-09-10 11:17:54 +1000245.Sh EXIT STATUS
Damien Miller22d47ab2006-07-24 14:04:36 +1000246.Ex -std scp
Damien Miller32aa1441999-10-29 09:15:49 +1000247.Sh SEE ALSO
Damien Miller33804262001-02-04 23:20:18 +1100248.Xr sftp 1 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000249.Xr ssh 1 ,
250.Xr ssh-add 1 ,
251.Xr ssh-agent 1 ,
252.Xr ssh-keygen 1 ,
Ben Lindstromc06bf702002-06-23 00:34:37 +0000253.Xr ssh_config 5 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000254.Xr sshd 8
Damien Millerf1ce5052003-06-11 22:04:39 +1000255.Sh HISTORY
256.Nm
Damien Miller6e1777f2014-04-20 13:02:58 +1000257is based on the rcp program in
Damien Millerb7727df2013-08-21 02:43:49 +1000258.Bx
259source code from the Regents of the University of California.
Damien Millerf1ce5052003-06-11 22:04:39 +1000260.Sh AUTHORS
Damien Millerbf836e52013-07-18 16:14:13 +1000261.An Timo Rinne Aq Mt tri@iki.fi
262.An Tatu Ylonen Aq Mt ylo@cs.hut.fi