upstream: Use the SFTP protocol by default. The original scp/rcp
protocol remains available via the -O flag. Note that ~user/ prefixed paths in SFTP mode require a protocol extension that was first shipped in OpenSSH 8.7. ok deraadt, after baking in snaps for a while without incident OpenBSD-Commit-ID: 23588976e28c281ff5988da0848cb821fec9213c
This commit is contained in:
parent
c4565e69ff
commit
73050fa38f
42
scp.1
42
scp.1
|
@ -8,9 +8,9 @@
|
||||||
.\"
|
.\"
|
||||||
.\" Created: Sun May 7 00:14:37 1995 ylo
|
.\" Created: Sun May 7 00:14:37 1995 ylo
|
||||||
.\"
|
.\"
|
||||||
.\" $OpenBSD: scp.1,v 1.100 2021/08/11 14:07:54 naddy Exp $
|
.\" $OpenBSD: scp.1,v 1.101 2021/09/08 23:31:39 djm Exp $
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: August 11 2021 $
|
.Dd $Mdocdate: September 8 2021 $
|
||||||
.Dt SCP 1
|
.Dt SCP 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
.Nd OpenSSH secure file copy
|
.Nd OpenSSH secure file copy
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm scp
|
.Nm scp
|
||||||
.Op Fl 346ABCOpqRrsTv
|
.Op Fl 346ABCOpqRrTv
|
||||||
.Op Fl c Ar cipher
|
.Op Fl c Ar cipher
|
||||||
.Op Fl D Ar sftp_server_path
|
.Op Fl D Ar sftp_server_path
|
||||||
.Op Fl F Ar ssh_config
|
.Op Fl F Ar ssh_config
|
||||||
|
@ -37,9 +37,6 @@ It uses
|
||||||
.Xr ssh 1
|
.Xr ssh 1
|
||||||
for data transfer, and uses the same authentication and provides the
|
for data transfer, and uses the same authentication and provides the
|
||||||
same security as a login session.
|
same security as a login session.
|
||||||
The scp protocol requires execution of the remote user's shell to perform
|
|
||||||
.Xr glob 3
|
|
||||||
pattern matching.
|
|
||||||
.Pp
|
.Pp
|
||||||
.Nm
|
.Nm
|
||||||
will ask for passwords or passphrases if they are needed for
|
will ask for passwords or passphrases if they are needed for
|
||||||
|
@ -79,7 +76,9 @@ The options are as follows:
|
||||||
Copies between two remote hosts are transferred through the local host.
|
Copies between two remote hosts are transferred through the local host.
|
||||||
Without this option the data is copied directly between the two remote
|
Without this option the data is copied directly between the two remote
|
||||||
hosts.
|
hosts.
|
||||||
Note that, when using the legacy SCP protocol (the default), this option
|
Note that, when using the legacy SCP protocol (via the
|
||||||
|
.Fl O
|
||||||
|
flag), this option
|
||||||
selects batch mode for the second host as
|
selects batch mode for the second host as
|
||||||
.Nm
|
.Nm
|
||||||
cannot ask for passwords or passphrases for both hosts.
|
cannot ask for passwords or passphrases for both hosts.
|
||||||
|
@ -146,9 +145,10 @@ Limits the used bandwidth, specified in Kbit/s.
|
||||||
.It Fl O
|
.It Fl O
|
||||||
Use the legacy SCP protocol for file transfers instead of the SFTP protocol.
|
Use the legacy SCP protocol for file transfers instead of the SFTP protocol.
|
||||||
Forcing the use of the SCP protocol may be necessary for servers that do
|
Forcing the use of the SCP protocol may be necessary for servers that do
|
||||||
not implement SFTP or for backwards-compatibility for particular filename
|
not implement SFTP, for backwards-compatibility for particular filename
|
||||||
wildcard patterns.
|
wildcard patterns and for expanding paths with a
|
||||||
This mode is the default.
|
.Sq ~
|
||||||
|
prefix for older SFTP servers.
|
||||||
.It Fl o Ar ssh_option
|
.It Fl o Ar ssh_option
|
||||||
Can be used to pass options to
|
Can be used to pass options to
|
||||||
.Nm ssh
|
.Nm ssh
|
||||||
|
@ -258,16 +258,6 @@ to use for the encrypted connection.
|
||||||
The program must understand
|
The program must understand
|
||||||
.Xr ssh 1
|
.Xr ssh 1
|
||||||
options.
|
options.
|
||||||
.It Fl s
|
|
||||||
Use the SFTP protocol for file transfers instead of the legacy SCP protocol.
|
|
||||||
Using SFTP avoids invoking a shell on the remote side and provides
|
|
||||||
more predictable filename handling, as the SCP protocol
|
|
||||||
relied on the remote shell for expanding
|
|
||||||
.Xr glob 3
|
|
||||||
wildcards.
|
|
||||||
.Pp
|
|
||||||
A near-future release of OpenSSH will make the SFTP protocol the default.
|
|
||||||
This option will be deleted before the end of 2022.
|
|
||||||
.It Fl T
|
.It Fl T
|
||||||
Disable strict filename checking.
|
Disable strict filename checking.
|
||||||
By default when copying files from a remote host to a local directory
|
By default when copying files from a remote host to a local directory
|
||||||
|
@ -299,11 +289,23 @@ debugging connection, authentication, and configuration problems.
|
||||||
.Xr ssh_config 5 ,
|
.Xr ssh_config 5 ,
|
||||||
.Xr sftp-server 8 ,
|
.Xr sftp-server 8 ,
|
||||||
.Xr sshd 8
|
.Xr sshd 8
|
||||||
|
.Sh CAVEATS
|
||||||
|
The original scp protocol (selected by the
|
||||||
|
.Fl O
|
||||||
|
flag) requires execution of the remote user's shell to perform
|
||||||
|
.Xr glob 3
|
||||||
|
pattern matching.
|
||||||
|
This requires careful quoting of any characters that have special meaning to
|
||||||
|
the remote shell, such as quote characters.
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
.Nm
|
.Nm
|
||||||
is based on the rcp program in
|
is based on the rcp program in
|
||||||
.Bx
|
.Bx
|
||||||
source code from the Regents of the University of California.
|
source code from the Regents of the University of California.
|
||||||
|
.Pp
|
||||||
|
Since OpenSSH 8.8,
|
||||||
|
.Nm
|
||||||
|
has use the SFTP protocol for transfers by default.
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.An Timo Rinne Aq Mt tri@iki.fi
|
.An Timo Rinne Aq Mt tri@iki.fi
|
||||||
.An Tatu Ylonen Aq Mt ylo@cs.hut.fi
|
.An Tatu Ylonen Aq Mt ylo@cs.hut.fi
|
||||||
|
|
6
scp.c
6
scp.c
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: scp.c,v 1.232 2021/08/11 14:07:54 naddy Exp $ */
|
/* $OpenBSD: scp.c,v 1.233 2021/09/08 23:31:39 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* scp - secure remote copy. This is basically patched BSD rcp which
|
* scp - secure remote copy. This is basically patched BSD rcp which
|
||||||
* uses ssh to do the data transfer (instead of using rcmd).
|
* uses ssh to do the data transfer (instead of using rcmd).
|
||||||
|
@ -448,7 +448,7 @@ main(int argc, char **argv)
|
||||||
const char *errstr;
|
const char *errstr;
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
enum scp_mode_e mode = MODE_SCP;
|
enum scp_mode_e mode = MODE_SFTP;
|
||||||
char *sftp_direct = NULL;
|
char *sftp_direct = NULL;
|
||||||
|
|
||||||
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
|
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
|
||||||
|
@ -1983,7 +1983,7 @@ void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
|
"usage: scp [-346ABCOpqRrTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
|
||||||
" [-i identity_file] [-J destination] [-l limit]\n"
|
" [-i identity_file] [-J destination] [-l limit]\n"
|
||||||
" [-o ssh_option] [-P port] [-S program] source ... target\n");
|
" [-o ssh_option] [-P port] [-S program] source ... target\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Reference in New Issue