blob: be8309b22fa4e955f63b603d4f48819541ed963c [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.orgacf42602018-06-09 06:36:31 +000011.\" $OpenBSD: scp.1,v 1.79 2018/06/09 06:36:31 jmc Exp $
Damien Miller32aa1441999-10-29 09:15:49 +100012.\"
djm@openbsd.org7082bb52018-06-09 03:01:12 +000013.Dd $Mdocdate: June 9 2018 $
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.orga3710d52017-04-30 23:28:12 +000021.Op Fl 346BCpqrv
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
Damien Miller8ee66a22003-02-24 11:50:50 +110025.Op Fl l Ar limit
Ben Lindstrom14c62eb2001-08-15 23:25:46 +000026.Op Fl o Ar ssh_option
Darren Tucker1f203942003-10-15 15:50:42 +100027.Op Fl P Ar port
28.Op Fl S Ar program
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000029.Ar source ... target
Damien Miller22c77262000-04-13 12:26:34 +100030.Sh DESCRIPTION
Damien Miller32aa1441999-10-29 09:15:49 +100031.Nm
Damien Miller450a7a12000-03-26 13:04:51 +100032copies files between hosts on a network.
33It uses
Damien Miller32aa1441999-10-29 09:15:49 +100034.Xr ssh 1
35for data transfer, and uses the same authentication and provides the
36same security as
37.Xr ssh 1 .
Damien Miller32aa1441999-10-29 09:15:49 +100038.Nm
39will ask for passwords or passphrases if they are needed for
40authentication.
41.Pp
millert@openbsd.org887669e2017-10-21 23:06:24 +000042The
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000043.Ar source
millert@openbsd.org887669e2017-10-21 23:06:24 +000044and
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000045.Ar target
millert@openbsd.org887669e2017-10-21 23:06:24 +000046may be specified as a local pathname, a remote host with optional path
47in the form
jmc@openbsd.org@openbsd.org0b2e2892017-10-25 06:19:46 +000048.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
Damien Millerb508faa2008-02-10 22:28:45 +110055Local file names can be made explicit using absolute or relative pathnames
56to avoid
57.Nm
58treating file names containing
59.Sq :\&
60as host specifiers.
millert@openbsd.org887669e2017-10-21 23:06:24 +000061.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.
Damien Miller32aa1441999-10-29 09:15:49 +100069.Pp
70The options are as follows:
71.Bl -tag -width Ds
Damien Millerf1211432011-01-06 22:40:30 +110072.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.
Damien Miller907998d2011-01-06 22:41:21 +110076Note that this option disables the progress meter.
Damien Miller34132e52000-01-14 15:45:46 +110077.It Fl 4
78Forces
79.Nm
80to use IPv4 addresses only.
81.It Fl 6
82Forces
83.Nm
84to use IPv6 addresses only.
Darren Tucker1f203942003-10-15 15:50:42 +100085.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
Damien Millera034baf2008-07-12 17:12:49 +1000105Selects the file from which the identity (private key) for public key
Darren Tucker1f203942003-10-15 15:50:42 +1000106authentication 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
jmc@openbsd.org7d330a12018-02-23 07:38:09 +0000127.It BindInterface
Damien Millerc0049bd2013-10-23 16:29:59 +1100128.It CanonicalDomains
129.It CanonicalizeFallbackLocal
130.It CanonicalizeHostname
131.It CanonicalizeMaxDots
132.It CanonicalizePermittedCNAMEs
jmc@openbsd.orgc5f7c082015-09-25 18:19:54 +0000133.It CertificateFile
Darren Tucker1f203942003-10-15 15:50:42 +1000134.It ChallengeResponseAuthentication
135.It CheckHostIP
Darren Tucker1f203942003-10-15 15:50:42 +1000136.It Ciphers
Darren Tucker1f203942003-10-15 15:50:42 +1000137.It Compression
naddy@openbsd.org9a82e242017-05-03 21:49:18 +0000138.It ConnectionAttempts
Darren Tuckerc0796d72004-05-03 09:19:03 +1000139.It ConnectTimeout
Damien Miller0e220db2004-06-15 10:34:08 +1000140.It ControlMaster
141.It ControlPath
Damien Millere5777722011-09-22 21:34:15 +1000142.It ControlPersist
Darren Tucker1f203942003-10-15 15:50:42 +1000143.It GlobalKnownHostsFile
144.It GSSAPIAuthentication
145.It GSSAPIDelegateCredentials
Damien Miller27e9c512005-03-02 12:04:16 +1100146.It HashKnownHosts
Darren Tucker1f203942003-10-15 15:50:42 +1000147.It Host
148.It HostbasedAuthentication
djm@openbsd.org46347ed2015-01-30 11:43:14 +0000149.It HostbasedKeyTypes
Darren Tucker1f203942003-10-15 15:50:42 +1000150.It HostKeyAlgorithms
151.It HostKeyAlias
152.It HostName
jmc@openbsd.org772e6ce2016-06-29 17:14:28 +0000153.It IdentitiesOnly
markus@openbsd.org75e21682016-05-04 14:32:26 +0000154.It IdentityAgent
Darren Tucker1f203942003-10-15 15:50:42 +1000155.It IdentityFile
Damien Miller0a184732010-11-20 15:21:03 +1100156.It IPQoS
Damien Millere5777722011-09-22 21:34:15 +1000157.It KbdInteractiveAuthentication
Darren Tucker636ca902004-11-05 20:22:00 +1100158.It KbdInteractiveDevices
Damien Miller2beb32f2010-09-24 22:16:03 +1000159.It KexAlgorithms
Darren Tucker1f203942003-10-15 15:50:42 +1000160.It LogLevel
161.It MACs
162.It NoHostAuthenticationForLocalhost
163.It NumberOfPasswordPrompts
164.It PasswordAuthentication
Damien Miller7ea845e2010-02-12 09:21:02 +1100165.It PKCS11Provider
Darren Tucker1f203942003-10-15 15:50:42 +1000166.It Port
167.It PreferredAuthentications
Darren Tucker1f203942003-10-15 15:50:42 +1000168.It ProxyCommand
jmc@openbsd.orge4eb7d92016-07-16 06:57:55 +0000169.It ProxyJump
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000170.It PubkeyAcceptedKeyTypes
Darren Tucker1f203942003-10-15 15:50:42 +1000171.It PubkeyAuthentication
Darren Tucker62388b22006-01-20 11:31:47 +1100172.It RekeyLimit
Darren Tucker2e578f62004-05-13 13:03:04 +1000173.It SendEnv
Damien Miller509b0102003-12-17 16:33:10 +1100174.It ServerAliveInterval
175.It ServerAliveCountMax
jmc@openbsd.orgacf42602018-06-09 06:36:31 +0000176.It SetEnv
Darren Tucker1f203942003-10-15 15:50:42 +1000177.It StrictHostKeyChecking
Damien Miller12c150e2003-12-17 16:31:10 +1100178.It TCPKeepAlive
djm@openbsd.org1d1092b2015-01-26 12:16:36 +0000179.It UpdateHostKeys
jmc@openbsd.org9f7637f2015-01-26 13:55:29 +0000180.It UsePrivilegedPort
Darren Tucker1f203942003-10-15 15:50:42 +1000181.It User
182.It UserKnownHostsFile
183.It VerifyHostKeyDNS
Darren Tucker1f203942003-10-15 15:50:42 +1000184.El
185.It Fl P Ar port
186Specifies the port to connect to on the remote host.
187Note that this option is written with a capital
188.Sq P ,
189because
190.Fl p
Damien Miller6e1777f2014-04-20 13:02:58 +1000191is already reserved for preserving the times and modes of the file.
Darren Tucker1f203942003-10-15 15:50:42 +1000192.It Fl p
193Preserves modification times, access times, and modes from the
194original file.
195.It Fl q
Damien Miller4cd24c72008-02-10 22:22:29 +1100196Quiet mode: disables the progress meter as well as warning and diagnostic
197messages from
198.Xr ssh 1 .
Darren Tucker1f203942003-10-15 15:50:42 +1000199.It Fl r
200Recursively copy entire directories.
Damien Millerc7ce0da2008-06-16 07:55:06 +1000201Note that
202.Nm
203follows symbolic links encountered in the tree traversal.
Darren Tucker1f203942003-10-15 15:50:42 +1000204.It Fl S Ar program
205Name of
206.Ar program
207to use for the encrypted connection.
208The program must understand
209.Xr ssh 1
210options.
211.It Fl v
212Verbose mode.
213Causes
214.Nm
215and
216.Xr ssh 1
217to print debugging messages about their progress.
218This is helpful in
219debugging connection, authentication, and configuration problems.
Damien Miller37023962000-07-11 17:31:38 +1000220.El
Damien Miller390f1532010-09-10 11:17:54 +1000221.Sh EXIT STATUS
Damien Miller22d47ab2006-07-24 14:04:36 +1000222.Ex -std scp
Damien Miller32aa1441999-10-29 09:15:49 +1000223.Sh SEE ALSO
Damien Miller33804262001-02-04 23:20:18 +1100224.Xr sftp 1 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000225.Xr ssh 1 ,
226.Xr ssh-add 1 ,
227.Xr ssh-agent 1 ,
228.Xr ssh-keygen 1 ,
Ben Lindstromc06bf702002-06-23 00:34:37 +0000229.Xr ssh_config 5 ,
Damien Miller32aa1441999-10-29 09:15:49 +1000230.Xr sshd 8
Damien Millerf1ce5052003-06-11 22:04:39 +1000231.Sh HISTORY
232.Nm
Damien Miller6e1777f2014-04-20 13:02:58 +1000233is based on the rcp program in
Damien Millerb7727df2013-08-21 02:43:49 +1000234.Bx
235source code from the Regents of the University of California.
Damien Millerf1ce5052003-06-11 22:04:39 +1000236.Sh AUTHORS
Damien Millerbf836e52013-07-18 16:14:13 +1000237.An Timo Rinne Aq Mt tri@iki.fi
238.An Tatu Ylonen Aq Mt ylo@cs.hut.fi