1SCP(1)                    BSD General Commands Manual                   SCP(1)
2

NAME

4     scp — secure copy (remote file copy program)
5

SYNOPSIS

7     scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
8         [-l limit] [-o ssh_option] [-P port] [-S program]
9         [[user@]host1:]file1 ... [[user@]host2:]file2
10

DESCRIPTION

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).  Unlike rcp(1), scp will ask for passwords or passphrases if
15     they are needed for authentication.
16
17     File names may contain a user and host specification to indicate that the
18     file is to be copied to/from that host.  Local file names can be made
19     explicit using absolute or relative pathnames to avoid scp treating file
20     names containing ‘:’ as host specifiers.  Copies between two remote hosts
21     are also permitted.
22
23     When copying a source file to a target file which already exists, scp
24     will replace the contents of the target file (keeping the inode).
25
26     If the target file does not yet exist, an empty file with the target file
27     name is created, then filled with the source file contents.  No attempt
28     is made at "near-atomic" transfer using temporary files.
29
30     The options are as follows:
31
32     -1      Forces scp to use protocol 1.
33
34     -2      Forces scp to use protocol 2.
35
36     -4      Forces scp to use IPv4 addresses only.
37
38     -6      Forces scp to use IPv6 addresses only.
39
40     -B      Selects batch mode (prevents asking for passwords or
41             passphrases).
42
43     -C      Compression enable.  Passes the -C flag to ssh(1) to enable com‐
44             pression.
45
46     -c cipher
47             Selects the cipher to use for encrypting the data transfer.  This
48             option is directly passed to ssh(1).
49
50     -F ssh_config
51             Specifies an alternative per-user configuration file for ssh.
52             This option is directly passed to ssh(1).
53
54     -i identity_file
55             Selects the file from which the identity (private key) for public
56             key authentication is read.  This option is directly passed to
57             ssh(1).
58
59     -l limit
60             Limits the used bandwidth, specified in Kbit/s.
61
62     -o ssh_option
63             Can be used to pass options to ssh in the format used in
64             ssh_config(5).  This is useful for specifying options for which
65             there is no separate scp command-line flag.  For full details of
66             the options listed below, and their possible values, see
67             ssh_config(5).
68
69                   AddressFamily
70                   BatchMode
71                   BindAddress
72                   ChallengeResponseAuthentication
73                   CheckHostIP
74                   Cipher
75                   Ciphers
76                   Compression
77                   CompressionLevel
78                   ConnectionAttempts
79                   ConnectTimeout
80                   ControlMaster
81                   ControlPath
82                   GlobalKnownHostsFile
83                   GSSAPIAuthentication
84                   GSSAPIDelegateCredentials
85                   HashKnownHosts
86                   Host
87                   HostbasedAuthentication
88                   HostKeyAlgorithms
89                   HostKeyAlias
90                   HostName
91                   IdentityFile
92                   IdentitiesOnly
93                   KbdInteractiveDevices
94                   LogLevel
95                   MACs
96                   NoHostAuthenticationForLocalhost
97                   NumberOfPasswordPrompts
98                   PasswordAuthentication
99                   PKCS11Provider
100                   Port
101                   PreferredAuthentications
102                   Protocol
103                   ProxyCommand
104                   PubkeyAuthentication
105                   RekeyLimit
106                   RhostsRSAAuthentication
107                   RSAAuthentication
108                   SendEnv
109                   ServerAliveInterval
110                   ServerAliveCountMax
111                   StrictHostKeyChecking
112                   TCPKeepAlive
113                   UsePrivilegedPort
114                   User
115                   UserKnownHostsFile
116                   VerifyHostKeyDNS
117
118     -P port
119             Specifies the port to connect to on the remote host.  Note that
120             this option is written with a capital ‘P’, because -p is already
121             reserved for preserving the times and modes of the file in
122             rcp(1).
123
124     -p      Preserves modification times, access times, and modes from the
125             original file.
126
127     -q      Quiet mode: disables the progress meter as well as warning and
128             diagnostic messages from ssh(1).
129
130     -r      Recursively copy entire directories.  Note that scp follows sym‐
131             bolic links encountered in the tree traversal.
132
133     -S program
134             Name of program to use for the encrypted connection.  The program
135             must understand ssh(1) options.
136
137     -v      Verbose mode.  Causes scp and ssh(1) to print debugging messages
138             about their progress.  This is helpful in debugging connection,
139             authentication, and configuration problems.
140
141     The scp utility exits 0 on success, and >0 if an error occurs.
142

IPV6

144     IPv6 address can be used everywhere where IPv4 address. In all entries
145     must be the IPv6 address enclosed in square brackets. Note: The square
146     brackets are metacharacters for the shell and must be escaped in shell.
147

SEE ALSO

149     rcp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1),
150     ssh_config(5), sshd(8)
151

HISTORY

153     scp is based on the rcp(1) program in BSD source code from the Regents of
154     the University of California.
155

AUTHORS

157     Timo Rinne <tri@iki.fi>
158     Tatu Ylonen <ylo@cs.hut.fi>
159
160BSD                              June 21, 2019                             BSD
Impressum