1SCP(1) BSD General Commands Manual SCP(1)
2
4 scp — OpenSSH secure file copy
5
7 scp [-346BCpqrTv] [-c cipher] [-F ssh_config] [-i identity_file]
8 [-J destination] [-l limit] [-o ssh_option] [-P port] [-S program]
9 source ... target
10
12 scp copies files between hosts on a network. It uses ssh(1) for data
13 transfer, and uses the same authentication and provides the same security
14 as ssh(1). scp will ask for passwords or passphrases if they are needed
15 for authentication.
16
17 The source and target may be specified as a local pathname, a remote host
18 with optional path in the form [user@]host:[path], or a URI in the form
19 scp://[user@]host[:port][/path]. Local file names can be made explicit
20 using absolute or relative pathnames to avoid scp treating file names
21 containing ‘:’ as host specifiers.
22
23 When copying between two remote hosts, if the URI format is used, a port
24 may only be specified on the target if the -3 option is used.
25
26 The options are as follows:
27
28 -3 Copies between two remote hosts are transferred through the local
29 host. Without this option the data is copied directly between
30 the two remote hosts. Note that this option disables the
31 progress meter.
32
33 -4 Forces scp to use IPv4 addresses only.
34
35 -6 Forces scp to use IPv6 addresses only.
36
37 -B Selects batch mode (prevents asking for passwords or
38 passphrases).
39
40 -C Compression enable. Passes the -C flag to ssh(1) to enable com‐
41 pression.
42
43 -c cipher
44 Selects the cipher to use for encrypting the data transfer. This
45 option is directly passed to ssh(1).
46
47 -F ssh_config
48 Specifies an alternative per-user configuration file for ssh.
49 This option is directly passed to ssh(1).
50
51 -i identity_file
52 Selects the file from which the identity (private key) for public
53 key authentication is read. This option is directly passed to
54 ssh(1).
55
56 -J destination
57 Connect to the target host by first making an scp connection to
58 the jump host described by destination and then establishing a
59 TCP forwarding to the ultimate destination from there. Multiple
60 jump hops may be specified separated by comma characters. This
61 is a shortcut to specify a ProxyJump configuration directive.
62 This option is directly passed to ssh(1).
63
64 -l limit
65 Limits the used bandwidth, specified in Kbit/s.
66
67 -o ssh_option
68 Can be used to pass options to ssh in the format used in
69 ssh_config(5). This is useful for specifying options for which
70 there is no separate scp command-line flag. For full details of
71 the options listed below, and their possible values, see
72 ssh_config(5).
73
74 AddressFamily
75 BatchMode
76 BindAddress
77 BindInterface
78 CanonicalDomains
79 CanonicalizeFallbackLocal
80 CanonicalizeHostname
81 CanonicalizeMaxDots
82 CanonicalizePermittedCNAMEs
83 CASignatureAlgorithms
84 CertificateFile
85 ChallengeResponseAuthentication
86 CheckHostIP
87 Ciphers
88 Compression
89 ConnectionAttempts
90 ConnectTimeout
91 ControlMaster
92 ControlPath
93 ControlPersist
94 GlobalKnownHostsFile
95 GSSAPIAuthentication
96 GSSAPIDelegateCredentials
97 HashKnownHosts
98 Host
99 HostbasedAuthentication
100 HostbasedKeyTypes
101 HostKeyAlgorithms
102 HostKeyAlias
103 Hostname
104 IdentitiesOnly
105 IdentityAgent
106 IdentityFile
107 IPQoS
108 KbdInteractiveAuthentication
109 KbdInteractiveDevices
110 KexAlgorithms
111 LogLevel
112 MACs
113 NoHostAuthenticationForLocalhost
114 NumberOfPasswordPrompts
115 PasswordAuthentication
116 PKCS11Provider
117 Port
118 PreferredAuthentications
119 ProxyCommand
120 ProxyJump
121 PubkeyAcceptedKeyTypes
122 PubkeyAuthentication
123 RekeyLimit
124 SendEnv
125 ServerAliveInterval
126 ServerAliveCountMax
127 SetEnv
128 StrictHostKeyChecking
129 TCPKeepAlive
130 UpdateHostKeys
131 User
132 UserKnownHostsFile
133 VerifyHostKeyDNS
134
135 -P port
136 Specifies the port to connect to on the remote host. Note that
137 this option is written with a capital ‘P’, because -p is already
138 reserved for preserving the times and modes of the file.
139
140 -p Preserves modification times, access times, and modes from the
141 original file.
142
143 -q Quiet mode: disables the progress meter as well as warning and
144 diagnostic messages from ssh(1).
145
146 -r Recursively copy entire directories. Note that scp follows sym‐
147 bolic links encountered in the tree traversal.
148
149 -S program
150 Name of program to use for the encrypted connection. The program
151 must understand ssh(1) options.
152
153 -T Disable strict filename checking. By default when copying files
154 from a remote host to a local directory scp checks that the
155 received filenames match those requested on the command-line to
156 prevent the remote end from sending unexpected or unwanted files.
157 Because of differences in how various operating systems and
158 shells interpret filename wildcards, these checks may cause
159 wanted files to be rejected. This option disables these checks
160 at the expense of fully trusting that the server will not send
161 unexpected filenames.
162
163 -v Verbose mode. Causes scp and ssh(1) to print debugging messages
164 about their progress. This is helpful in debugging connection,
165 authentication, and configuration problems.
166
168 The scp utility exits 0 on success, and >0 if an error occurs.
169
171 sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), ssh_config(5),
172 sshd(8)
173
175 scp is based on the rcp program in BSD source code from the Regents of
176 the University of California.
177
179 Timo Rinne <tri@iki.fi>
180 Tatu Ylonen <ylo@cs.hut.fi>
181
182BSD May 10, 2020 BSD