1.\" $NetBSD: scp.1,v 1.16 2018/04/06 18:59:00 christos Exp $ 2.\" -*- nroff -*- 3.\" 4.\" scp.1 5.\" 6.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 7.\" 8.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 9.\" All rights reserved 10.\" 11.\" Created: Sun May 7 00:14:37 1995 ylo 12.\" 13.\" $OpenBSD: scp.1,v 1.77 2018/02/23 07:38:09 jmc Exp $ 14.\" 15.Dd February 23 2018 16.Dt SCP 1 17.Os 18.Sh NAME 19.Nm scp 20.Nd secure copy (remote file copy program) 21.Sh SYNOPSIS 22.Nm scp 23.Op Fl 346BCpqrv 24.Op Fl c Ar cipher 25.Op Fl F Ar ssh_config 26.Op Fl i Ar identity_file 27.Op Fl l Ar limit 28.Op Fl o Ar ssh_option 29.Op Fl P Ar port 30.Op Fl S Ar program 31.Ar source ... target 32.Sh DESCRIPTION 33.Nm 34copies files between hosts on a network. 35It uses 36.Xr ssh 1 37for data transfer, and uses the same authentication and provides the 38same security as 39.Xr ssh 1 . 40.Nm 41will ask for passwords or passphrases if they are needed for 42authentication. 43.Pp 44The 45.Ar source 46and 47.Ar target 48may be specified as a local pathname, a remote host with optional path 49in the form 50.Sm off 51.Oo user @ Oc host : Op path , 52.Sm on 53or a URI in the form 54.Sm off 55.No scp:// Oo user @ Oc host Oo : port Oc Op / path . 56.Sm on 57Local file names can be made explicit using absolute or relative pathnames 58to avoid 59.Nm 60treating file names containing 61.Sq :\& 62as host specifiers. 63.Pp 64When copying between two remote hosts, if the URI format is used, a 65.Ar port 66may only be specified on the 67.Ar target 68if the 69.Fl 3 70option is used. 71.Pp 72The options are as follows: 73.Bl -tag -width Ds 74.It Fl 3 75Copies between two remote hosts are transferred through the local host. 76Without this option the data is copied directly between the two remote 77hosts. 78Note that this option disables the progress meter. 79.It Fl 4 80Forces 81.Nm 82to use IPv4 addresses only. 83.It Fl 6 84Forces 85.Nm 86to use IPv6 addresses only. 87.It Fl B 88Selects batch mode (prevents asking for passwords or passphrases). 89.It Fl C 90Compression enable. 91Passes the 92.Fl C 93flag to 94.Xr ssh 1 95to enable compression. 96.It Fl c Ar cipher 97Selects the cipher to use for encrypting the data transfer. 98This option is directly passed to 99.Xr ssh 1 . 100.It Fl F Ar ssh_config 101Specifies an alternative 102per-user configuration file for 103.Nm ssh . 104This option is directly passed to 105.Xr ssh 1 . 106.It Fl i Ar identity_file 107Selects the file from which the identity (private key) for public key 108authentication is read. 109This option is directly passed to 110.Xr ssh 1 . 111.It Fl l Ar limit 112Limits the used bandwidth, specified in Kbit/s. 113.It Fl o Ar ssh_option 114Can be used to pass options to 115.Nm ssh 116in the format used in 117.Xr ssh_config 5 . 118This is useful for specifying options 119for which there is no separate 120.Nm scp 121command-line flag. 122For full details of the options listed below, and their possible values, see 123.Xr ssh_config 5 . 124.Pp 125.Bl -tag -width Ds -offset indent -compact 126.It AddressFamily 127.It BatchMode 128.It BindAddress 129.It BindInterface 130.It CanonicalDomains 131.It CanonicalizeFallbackLocal 132.It CanonicalizeHostname 133.It CanonicalizeMaxDots 134.It CanonicalizePermittedCNAMEs 135.It CertificateFile 136.It ChallengeResponseAuthentication 137.It CheckHostIP 138.It Ciphers 139.It Compression 140.It ConnectionAttempts 141.It ConnectTimeout 142.It ControlMaster 143.It ControlPath 144.It ControlPersist 145.It GlobalKnownHostsFile 146.It GSSAPIAuthentication 147.It GSSAPIDelegateCredentials 148.It HashKnownHosts 149.It Host 150.It HostbasedAuthentication 151.It HostbasedKeyTypes 152.It HostKeyAlgorithms 153.It HostKeyAlias 154.It HostName 155.It IdentitiesOnly 156.It IdentityAgent 157.It IdentityFile 158.It IPQoS 159.It KbdInteractiveAuthentication 160.It KbdInteractiveDevices 161.It KexAlgorithms 162.It LogLevel 163.It MACs 164.It NoHostAuthenticationForLocalhost 165.It NumberOfPasswordPrompts 166.It PasswordAuthentication 167.It PKCS11Provider 168.It Port 169.It PreferredAuthentications 170.It ProxyCommand 171.It ProxyJump 172.It PubkeyAcceptedKeyTypes 173.It PubkeyAuthentication 174.It RekeyLimit 175.It SendEnv 176.It ServerAliveInterval 177.It ServerAliveCountMax 178.It StrictHostKeyChecking 179.It TCPKeepAlive 180.It UpdateHostKeys 181.It UsePrivilegedPort 182.It User 183.It UserKnownHostsFile 184.It VerifyHostKeyDNS 185.El 186.It Fl P Ar port 187Specifies the port to connect to on the remote host. 188Note that this option is written with a capital 189.Sq P , 190because 191.Fl p 192is already reserved for preserving the times and modes of the file. 193.It Fl p 194Preserves modification times, access times, and modes from the 195original file. 196.It Fl q 197Quiet mode: disables the progress meter as well as warning and diagnostic 198messages from 199.Xr ssh 1 . 200.It Fl r 201Recursively copy entire directories. 202Note that 203.Nm 204follows symbolic links encountered in the tree traversal. 205.It Fl S Ar program 206Name of 207.Ar program 208to use for the encrypted connection. 209The program must understand 210.Xr ssh 1 211options. 212.It Fl v 213Verbose mode. 214Causes 215.Nm 216and 217.Xr ssh 1 218to print debugging messages about their progress. 219This is helpful in 220debugging connection, authentication, and configuration problems. 221.El 222.Sh EXIT STATUS 223.Ex -std scp 224.Sh SEE ALSO 225.Xr sftp 1 , 226.Xr ssh 1 , 227.Xr ssh-add 1 , 228.Xr ssh-agent 1 , 229.Xr ssh-keygen 1 , 230.Xr ssh_config 5 , 231.Xr sshd 8 232.Sh HISTORY 233.Nm 234is based on the rcp program in 235.Bx 236source code from the Regents of the University of California. 237.Sh AUTHORS 238.An Timo Rinne Aq Mt tri@iki.fi 239.An Tatu Ylonen Aq Mt ylo@cs.hut.fi 240