scp.1 6.3 KB

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