1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-22 07:20:00 +00:00
freebsd/crypto/openssh/scp.1

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

326 lines
7.9 KiB
Groff
Raw Normal View History

2000-02-24 14:29:47 +00:00
.\"
.\" scp.1
.\"
.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
.\"
.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
.\" All rights reserved
.\"
.\" Created: Sun May 7 00:14:37 1995 ylo
.\"
2023-02-05 18:04:12 +00:00
.\" $OpenBSD: scp.1,v 1.112 2022/12/16 07:13:22 djm Exp $
2000-02-24 14:29:47 +00:00
.\"
2023-02-05 18:04:12 +00:00
.Dd $Mdocdate: December 16 2022 $
2000-02-24 14:29:47 +00:00
.Dt SCP 1
.Os
.Sh NAME
.Nm scp
2021-02-14 21:04:52 +00:00
.Nd OpenSSH secure file copy
2000-02-24 14:29:47 +00:00
.Sh SYNOPSIS
.Nm scp
2021-08-30 19:14:33 +00:00
.Op Fl 346ABCOpqRrsTv
2000-02-24 14:29:47 +00:00
.Op Fl c Ar cipher
2021-08-30 19:14:33 +00:00
.Op Fl D Ar sftp_server_path
2004-02-26 10:38:49 +00:00
.Op Fl F Ar ssh_config
2000-02-24 14:29:47 +00:00
.Op Fl i Ar identity_file
2020-02-14 19:47:15 +00:00
.Op Fl J Ar destination
.Op Fl l Ar limit
2002-03-18 09:55:03 +00:00
.Op Fl o Ar ssh_option
2004-02-26 10:38:49 +00:00
.Op Fl P Ar port
.Op Fl S Ar program
2023-02-05 18:04:12 +00:00
.Op Fl X Ar sftp_option
2018-05-06 12:27:04 +00:00
.Ar source ... target
2000-05-15 04:37:24 +00:00
.Sh DESCRIPTION
2000-02-24 14:29:47 +00:00
.Nm
copies files between hosts on a network.
2021-04-23 19:10:38 +00:00
.Pp
2023-02-05 18:04:12 +00:00
.Nm
uses the SFTP protocol over a
2000-02-24 14:29:47 +00:00
.Xr ssh 1
2023-02-05 18:04:12 +00:00
connection for data transfer, and uses the same authentication and provides
the same security as a login session.
2021-04-23 19:10:38 +00:00
.Pp
2000-02-24 14:29:47 +00:00
.Nm
will ask for passwords or passphrases if they are needed for
authentication.
.Pp
2018-05-06 12:27:04 +00:00
The
.Ar source
and
.Ar target
may be specified as a local pathname, a remote host with optional path
in the form
.Sm off
.Oo user @ Oc host : Op path ,
.Sm on
or a URI in the form
.Sm off
.No scp:// Oo user @ Oc host Oo : port Oc Op / path .
.Sm on
Local file names can be made explicit using absolute or relative pathnames
to avoid
.Nm
treating file names containing
.Sq :\&
as host specifiers.
2018-05-06 12:27:04 +00:00
.Pp
When copying between two remote hosts, if the URI format is used, a
.Ar port
2021-08-30 19:14:33 +00:00
cannot be specified on the
2018-05-06 12:27:04 +00:00
.Ar target
if the
2021-08-30 19:14:33 +00:00
.Fl R
2018-05-06 12:27:04 +00:00
option is used.
2000-02-24 14:29:47 +00:00
.Pp
The options are as follows:
.Bl -tag -width Ds
2011-02-17 11:47:40 +00:00
.It Fl 3
Copies between two remote hosts are transferred through the local host.
Without this option the data is copied directly between the two remote
hosts.
2022-04-08 17:19:17 +00:00
Note that, when using the legacy SCP protocol (via the
.Fl O
flag), this option
2021-08-30 19:14:33 +00:00
selects batch mode for the second host as
2021-02-14 21:07:21 +00:00
.Nm
cannot ask for passwords or passphrases for both hosts.
2021-08-30 19:14:33 +00:00
This mode is the default.
2004-02-26 10:38:49 +00:00
.It Fl 4
Forces
.Nm
to use IPv4 addresses only.
.It Fl 6
Forces
.Nm
to use IPv6 addresses only.
2021-02-14 21:09:58 +00:00
.It Fl A
Allows forwarding of
.Xr ssh-agent 1
to the remote system.
The default is not to forward an authentication agent.
2000-02-24 14:29:47 +00:00
.It Fl B
Selects batch mode (prevents asking for passwords or passphrases).
.It Fl C
Compression enable.
Passes the
2000-02-24 14:29:47 +00:00
.Fl C
flag to
.Xr ssh 1
to enable compression.
2004-02-26 10:38:49 +00:00
.It Fl c Ar cipher
Selects the cipher to use for encrypting the data transfer.
This option is directly passed to
.Xr ssh 1 .
2021-08-30 19:14:33 +00:00
.It Fl D Ar sftp_server_path
2023-02-05 18:04:12 +00:00
Connect directly to a local SFTP server program rather than a
2021-08-30 19:14:33 +00:00
remote one via
.Xr ssh 1 .
This option may be useful in debugging the client and server.
2002-03-18 09:55:03 +00:00
.It Fl F Ar ssh_config
Specifies an alternative
per-user configuration file for
.Nm ssh .
This option is directly passed to
.Xr ssh 1 .
2004-02-26 10:38:49 +00:00
.It Fl i Ar identity_file
2008-07-23 09:33:08 +00:00
Selects the file from which the identity (private key) for public key
2004-02-26 10:38:49 +00:00
authentication is read.
This option is directly passed to
.Xr ssh 1 .
2020-02-14 19:47:15 +00:00
.It Fl J Ar destination
Connect to the target host by first making an
.Nm
connection to the jump host described by
.Ar destination
and then establishing a TCP forwarding to the ultimate destination from
there.
Multiple jump hops may be specified separated by comma characters.
This is a shortcut to specify a
.Cm ProxyJump
configuration directive.
This option is directly passed to
.Xr ssh 1 .
2004-02-26 10:38:49 +00:00
.It Fl l Ar limit
Limits the used bandwidth, specified in Kbit/s.
2021-08-30 19:14:33 +00:00
.It Fl O
2022-04-08 17:19:17 +00:00
Use the legacy SCP protocol for file transfers instead of the SFTP protocol.
2021-08-30 19:14:33 +00:00
Forcing the use of the SCP protocol may be necessary for servers that do
2021-11-04 17:16:52 +00:00
not implement SFTP, for backwards-compatibility for particular filename
wildcard patterns and for expanding paths with a
.Sq ~
prefix for older SFTP servers.
2004-02-26 10:38:49 +00:00
.It Fl o Ar ssh_option
Can be used to pass options to
.Nm ssh
in the format used in
.Xr ssh_config 5 .
This is useful for specifying options
for which there is no separate
.Nm scp
command-line flag.
For full details of the options listed below, and their possible values, see
.Xr ssh_config 5 .
.Pp
.Bl -tag -width Ds -offset indent -compact
.It AddressFamily
.It BatchMode
.It BindAddress
2018-05-06 12:27:04 +00:00
.It BindInterface
2014-01-30 10:56:49 +00:00
.It CanonicalDomains
.It CanonicalizeFallbackLocal
.It CanonicalizeHostname
.It CanonicalizeMaxDots
.It CanonicalizePermittedCNAMEs
2019-02-05 15:03:53 +00:00
.It CASignatureAlgorithms
2016-03-10 20:10:25 +00:00
.It CertificateFile
2004-02-26 10:38:49 +00:00
.It CheckHostIP
.It Ciphers
.It Compression
.It ConnectionAttempts
2004-10-28 16:03:53 +00:00
.It ConnectTimeout
.It ControlMaster
.It ControlPath
2012-08-29 15:46:01 +00:00
.It ControlPersist
2004-02-26 10:38:49 +00:00
.It GlobalKnownHostsFile
.It GSSAPIAuthentication
.It GSSAPIDelegateCredentials
2005-06-05 15:40:50 +00:00
.It HashKnownHosts
2004-02-26 10:38:49 +00:00
.It Host
2021-04-23 19:10:38 +00:00
.It HostbasedAcceptedAlgorithms
2004-02-26 10:38:49 +00:00
.It HostbasedAuthentication
.It HostKeyAlgorithms
.It HostKeyAlias
2021-02-14 21:00:25 +00:00
.It Hostname
2004-04-20 09:35:04 +00:00
.It IdentitiesOnly
2017-01-31 12:29:48 +00:00
.It IdentityAgent
.It IdentityFile
2011-02-17 11:47:40 +00:00
.It IPQoS
2012-08-29 15:46:01 +00:00
.It KbdInteractiveAuthentication
2005-06-05 15:40:50 +00:00
.It KbdInteractiveDevices
2011-02-17 11:47:40 +00:00
.It KexAlgorithms
2021-04-23 19:10:38 +00:00
.It KnownHostsCommand
2004-02-26 10:38:49 +00:00
.It LogLevel
.It MACs
.It NoHostAuthenticationForLocalhost
.It NumberOfPasswordPrompts
.It PasswordAuthentication
2010-03-08 11:19:52 +00:00
.It PKCS11Provider
2004-02-26 10:38:49 +00:00
.It Port
.It PreferredAuthentications
.It ProxyCommand
2017-01-31 12:29:48 +00:00
.It ProxyJump
2021-04-23 19:10:38 +00:00
.It PubkeyAcceptedAlgorithms
2004-02-26 10:38:49 +00:00
.It PubkeyAuthentication
2006-03-22 19:46:12 +00:00
.It RekeyLimit
2022-10-04 15:10:40 +00:00
.It RequiredRSASize
2004-10-28 16:03:53 +00:00
.It SendEnv
2004-02-26 10:38:49 +00:00
.It ServerAliveInterval
.It ServerAliveCountMax
2018-08-28 10:47:58 +00:00
.It SetEnv
2004-02-26 10:38:49 +00:00
.It StrictHostKeyChecking
.It TCPKeepAlive
2015-07-02 13:15:34 +00:00
.It UpdateHostKeys
2004-02-26 10:38:49 +00:00
.It User
.It UserKnownHostsFile
.It VerifyHostKeyDNS
.El
2000-02-24 14:29:47 +00:00
.It Fl P Ar port
Specifies the port to connect to on the remote host.
Note that this option is written with a capital
2000-02-24 14:29:47 +00:00
.Sq P ,
because
.Fl p
2021-11-04 17:16:52 +00:00
is already reserved for preserving the times and mode bits of the file.
2004-02-26 10:38:49 +00:00
.It Fl p
2021-11-04 17:16:52 +00:00
Preserves modification times, access times, and file mode bits from the
source file.
2004-02-26 10:38:49 +00:00
.It Fl q
Quiet mode: disables the progress meter as well as warning and diagnostic
messages from
.Xr ssh 1 .
2021-08-30 19:14:33 +00:00
.It Fl R
Copies between two remote hosts are performed by connecting to the origin
host and executing
.Nm
there.
This requires that
.Nm
running on the origin host can authenticate to the destination host without
requiring a password.
2004-02-26 10:38:49 +00:00
.It Fl r
Recursively copy entire directories.
2008-07-23 09:33:08 +00:00
Note that
.Nm
follows symbolic links encountered in the tree traversal.
.It Fl S Ar program
Name of
.Ar program
to use for the encrypted connection.
The program must understand
.Xr ssh 1
options.
2019-02-05 15:05:22 +00:00
.It Fl T
Disable strict filename checking.
By default when copying files from a remote host to a local directory
.Nm
checks that the received filenames match those requested on the command-line
to prevent the remote end from sending unexpected or unwanted files.
Because of differences in how various operating systems and shells interpret
filename wildcards, these checks may cause wanted files to be rejected.
This option disables these checks at the expense of fully trusting that
the server will not send unexpected filenames.
2004-02-26 10:38:49 +00:00
.It Fl v
Verbose mode.
Causes
2000-02-24 14:29:47 +00:00
.Nm
2004-02-26 10:38:49 +00:00
and
.Xr ssh 1
to print debugging messages about their progress.
This is helpful in
debugging connection, authentication, and configuration problems.
2023-02-05 18:04:12 +00:00
.It Fl X Ar sftp_option
Specify an option that controls aspects of SFTP protocol behaviour.
The valid options are:
.Bl -tag -width Ds
.It Cm nrequests Ns = Ns Ar value
Controls how many concurrent SFTP read or write requests may be in progress
at any point in time during a download or upload.
By default 64 requests may be active concurrently.
.It Cm buffer Ns = Ns Ar value
Controls the maximum buffer size for a single SFTP read/write operation used
during download or upload.
By default a 32KB buffer is used.
.El
.El
2011-02-17 11:47:40 +00:00
.Sh EXIT STATUS
2006-09-30 13:29:51 +00:00
.Ex -std scp
2000-02-24 14:29:47 +00:00
.Sh SEE ALSO
.Xr sftp 1 ,
2000-02-24 14:29:47 +00:00
.Xr ssh 1 ,
.Xr ssh-add 1 ,
.Xr ssh-agent 1 ,
.Xr ssh-keygen 1 ,
2002-06-29 11:34:13 +00:00
.Xr ssh_config 5 ,
2021-08-30 19:14:33 +00:00
.Xr sftp-server 8 ,
2000-02-24 14:29:47 +00:00
.Xr sshd 8
2004-01-07 11:10:17 +00:00
.Sh HISTORY
.Nm
2015-01-05 16:09:55 +00:00
is based on the rcp program in
2014-01-30 10:56:49 +00:00
.Bx
source code from the Regents of the University of California.
2022-04-08 17:19:17 +00:00
.Pp
2022-10-04 15:10:40 +00:00
Since OpenSSH 9.0,
2022-04-08 17:19:17 +00:00
.Nm
2022-10-04 15:10:40 +00:00
has used the SFTP protocol for transfers by default.
2004-01-07 11:10:17 +00:00
.Sh AUTHORS
2013-09-18 17:27:38 +00:00
.An Timo Rinne Aq Mt tri@iki.fi
.An Tatu Ylonen Aq Mt ylo@cs.hut.fi
2021-11-04 17:16:52 +00:00
.Sh CAVEATS
2022-04-08 17:19:17 +00:00
The legacy SCP protocol (selected by the
.Fl O
flag) requires execution of the remote user's shell to perform
2021-11-04 17:16:52 +00:00
.Xr glob 3
pattern matching.
This requires careful quoting of any characters that have special meaning to
the remote shell, such as quote characters.