.\"  -*- nroff -*-
.\"
.\" scp2.1
.\"
.\" Authors:    Timo J. Rinne <tri@ssh.com>
.\"		Sami Lehtinen <sjl@ssh.com>
.\"
.\" Copyright (c) 1998,1999,2000,2002 SSH Communications Security Corp, Finland
.\" All rights reserved
.\"
.TH SCP2 1  "May 16, 2002" "SSH2" "SSH2"

.SH NAME
scp2 \- secure copy client

.SH SYNOPSIS
.na
.B scp2
[\c
.BI \-D \ debug_level_spec\fR\c
]
[\c
.B \-d \c
]
[\c
.B \-p \c
]
[\c
.B \-u \c
]
[\c
.B \--verbose \c
]
[\c
.B \-v \c
]
[\c
.B \--help \c
]
[\c
.B \-h \c
]
[\c
.B \-c \ cipher \fR\c
]
[\c
.BI \-S \ ssh2-path\fR\c
]
[\c
.BI \-P \ ssh2-port\fR\c
]
[\c
.B \-t \c
]
[\c
.B \-f \c
]
[\c
.B \-1 \c
]
[\c
.B \-4 \c
]
[\c
.B \-6 \c
]
[\c
.B \-r \c
]
[\c
.B \-B \c
]
[\c
.BI \-b \ buffer_size\fR\c
]
[\c
.BI \-N \ max_requests\fR\c
]
[\c
.B \-a[arg]\c
]
[\c
.B \-q \c
]
[\c
.B \-Q \c
]
[\c
.BI \--statistics \ [yes|no|simple]\c
]
[\c
.B \--interactive \c
]
[\c
.B \-I \c
]
[\c
.B \--overwrite \c
]
[\c
.B \--version \c
]
[\c
.B \-V \c
]
[\c
.BI \-o \ ssh2-options\fR\c
]
[\c
.BI \-i \ file\fR\c
]
[[\fBuser\fR@]\fBhost\fR[#\fBport\fR]:]\fBfile \fB...\fR 
[[\fBuser\fR@]\fBhost\fR[#\fBport\fR]:]\fBfile_or_dir\fR

.ad
.SH DESCRIPTION 
.LP
.B Scp2
(Secure Copy) is used to copy files over the network securely.
It uses
.B ssh2
for data transfer and authentication, and provides
the same level of security as
.B ssh2.
Unlike
.BR rcp ,
.B scp2
will ask for passwords or passphrases if they are needed for
authentication.  You can also use your public key for authentication.
See
.BR ssh-agent2 (1)
and 
.BR ssh-add2 (1).

Any filename may contain a host, user, and port specification to
indicate that the file is to be copied to/from that host.  Copies
between two remote hosts are permitted. The 'host' parameter can
optionally be enclosed in square brackets ([]) to allow the use of
semicolons (read: IPv6 addresses).  'file' can contain globbing
patterns (type \fIzsh_fileglob\fR).  All special characters can be
escaped to include them in 'file', but this means that if you want
to use escapes so that they will be used in the glob pattern (to
escape special characters), you have to escape them ('\\\\').  Read
more about \fIzsh_fileglob\fR from
.BR sshregex (1).

.SH OPTIONS
.LP
.ne 3
.TP
.BI \-D \ debug_level_spec\fR\c
Print extensive debug information to stderr.  \fIdebug_level_spec\fR is
a number between 0 and 99, where 99 specifies that all debug
information should be displayed.
.ne 3
.TP
.B \-d \c
With this option,
.B scp2
will make sure that the destination file is a directory.  If not,
.B scp2
will exit with an error message.
.ne 3
.TP
.B \-p \c
Tells
.B scp2
to preserve file attributes and timestamps.
.ne 3
.TP
.B \-u \c
Makes
.B scp2
remove source files after copying.  This makes scp2 work more like 
"mv" than "cp."
.ne 3
.TP
.B \-v,--verbose \c
Makes
.B scp2
verbose.  This is equal to specifying the'-D 2'-option.
.ne 3
.TP
.B \-h,--help \c
Display a short help.
.ne 3
.TP
.BI \-c \ cipher\fR\c
Select the encryption algorithm that 
.B ssh2
will use.  Multiple -c options are allowed.
A single -c flag can have only one cipher. 
.ne 3
.TP
.BI \-S \ ssh2-path\fR\c
Specifies the path to
.B ssh2
used in connecting.
.ne 3
.TP
.BI \-o \ ssh2-options\fR\c
Specifies options to give to
.BR ssh2 .
Use as with
.BR ssh2,
see
.BR ssh2 (1).
.ne 3
.TP
.BI \-i \ file\fR\c
Specifies the identity file to give to 
.BR ssh2 .
.ne 3
.TP
.BI \-P \ ssh2-port\fR\c
Specifies the remote port to
.B ssh2.
Ports can also be defined on a file-to-file basis.  See 
.B SYNOPSIS.
.ne 3
.TP
.B \-t \fRor\fB \-f \c
Compatibility mode.  Invoke
.B scp1
with the given command line to handle the connection.
.B scp1
must be in the path.
.ne 3
.TP
.B \-1\c
Invoke
.B scp1
with the rest of the given command line.

This argument must be the first on the command line and separate from
all other one-character arguments.  It must not be used when
.B \-t \fRor\fB \-f \c
are used.
.ne 3
.TP
.B \-4\c
Instruct
.B ssh2
to use IPv4.
.ne 3
.TP
.B \-6\c
Instruct
.B ssh2
to use IPv6.
.ne 3
.TP
.B \-r\c
Copy directories recursively.  Does not follow symbolic links.
.ne 3
.TP
.B \-B\c
Invoke
.B ssh2
in batch mode.
.ne 3
.TP
.BI \-b \ buffer_size\fR\c
Define the maximum buffer size for one request (default 32768 bytes).
.ne 3
.TP
.BI \-N \ max_requests\fR\c
Define the maximum number of concurrent requests (default 10).
.ne 3
.TP
.B \-a[arg]
Transfer files using ascii mode, i.e. newlines will be converted on the
fly. See command
.B ascii
in
.BR sftp2 (1).
If the server doesn't advertise the newline convention, you can give it
a hint by giving an argument "\fB-a\fR". Default is to set destination
newline convention, but you can specify either by prefixing the argument
with "\fBsrc:\fR" or "\fBdest:\fR" for source or destination convention,
respectively. Advanced example: "\fBscp -asrc:unix -adest:dos
src_host:src_file dest_host:dest_file\fR".
.ne 3
.TP
.B \-q
Quiet mode (only fatal errors are reported).
.ne 3
.TP
.B \-Q
Do not show process indicator.
.ne 3
.TP
.B \-V,--version
Display version.
.ne 3
.TP
.B \-I,--interactive
Prompt whether to overwrite an existing destination file. (doesn't work
with `\fB-B\fR' (batch-mode))
.ne 3
.TP
.B \--overwrite
Whether to overwrite existing destination file(s). Default is
"\fByes\fR". Takes optional argument, with which you can disable
overwriting.
.ne 3
.TP
.BI \--statistics \ [yes|no|simple]
Takes mandatory argument, with which you can choose statistics
style. Default is "\fByes\fR", or full-blown statistics, which fit to
screen width. Other possibilities are "\fBno\fR", to disable statistics
(analogous to "\fB-Q\fR" option), and "\fBsimple\fR", which is the
default reporting style when there is no tty (e.g. in cron jobs).
.ne 3

.SH EXIT VALUE
.LP
.ne 3
.PD 0
.TP
.B 0
Operation was successful.
.ne 3
.TP
.B 1, 2
Operation resulted in an undetermined error within sshfilecopy.
.ne 3
.TP
.B 3
Destination is not directory, but it should be. 
.ne 3
.TP
.B 4
Connecting to host failed. 
.ne 3
.TP
.B 5
Connection lost for some reason.
.ne 3
.TP
.B 6
File does not exist. 
.ne 3
.TP
.B 7
No permission to access file. 
.ne 3
.TP
.B 8
Undetermined error from sshfilexfer. 
.ne 3
.TP
.B 9
File transfer protocol mismatch. 
.PD

.SH EXAMPLES
.LP
Copy files from your local system to a remote system:
.TP
$ scp localfile user@remotehost:/dest/dir/for/file/
.PP
Copy files from a remote system to your local disk:
.TP
$ scp user@remotehost:/dir/for/file/remotefile /dest/dir/for/file

.SH INSTALLATION
.LP
.B Scp2 
uses 
.B ssh2
in network connections.  Therefore it is not installed suid-root.
Notice that the subsystem 'sftp-server' must be defined in the 
.BR sshd2 (8)
configuration file in the remote end for 
.B scp2 
to work.

.SH AUTHORS
.LP

SSH Communications Security Corp.

For more information, see http://www.ssh.com.

.SH SEE ALSO
.BR ssh2 (1),
.BR sshd2 (8),
.BR ssh-keygen2 (1),
.BR ssh-agent2 (1),
.BR ssh-add2 (1),
.BR sftp (1)
.BR rlogin (1),
.BR rsh (1),
.BR telnet (1)