rcolebaugh / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone
640f24
diff --git a/scp.1 b/scp.1
640f24
index 68aac04b..a96e95ad 100644
640f24
--- a/scp.1
640f24
+++ b/scp.1
640f24
@@ -18,7 +18,7 @@
640f24
 .Nd OpenSSH secure file copy
640f24
 .Sh SYNOPSIS
640f24
 .Nm scp
640f24
-.Op Fl 346ABCOpqRrsTv
640f24
+.Op Fl 346ABCOpqRrTv
640f24
 .Op Fl c Ar cipher
640f24
 .Op Fl D Ar sftp_server_path
640f24
 .Op Fl F Ar ssh_config
640f24
@@ -79,7 +76,9 @@ The options are as follows:
640f24
 Copies between two remote hosts are transferred through the local host.
640f24
 Without this option the data is copied directly between the two remote
640f24
 hosts.
7b76af
-Note that, when using the original SCP protocol (the default), this option
7b76af
+Note that, when using the original SCP protocol (via the
640f24
+.Fl O
640f24
+flag), this option
640f24
 selects batch mode for the second host as
640f24
 .Nm
640f24
 cannot ask for passwords or passphrases for both hosts.
7b76af
@@ -146,7 +145,6 @@ Limits the used bandwidth, specified in Kbit/s.
7b76af
 wildcard patterns and for expanding paths with a
7b76af
 .Sq ~
7b76af
 prefix for older SFTP servers.
640f24
-This mode is the default.
640f24
 .It Fl o Ar ssh_option
640f24
 Can be used to pass options to
640f24
 .Nm ssh
7b76af
@@ -258,8 +258,6 @@ to use for the encrypted connection.
640f24
 The program must understand
640f24
 .Xr ssh 1
640f24
 options.
640f24
-.It Fl s
7b76af
-Use the SFTP protocol for transfers rather than the original scp protocol.
640f24
 .It Fl T
640f24
 Disable strict filename checking.
640f24
 By default when copying files from a remote host to a local directory
640f24
@@ -299,11 +289,23 @@ debugging connection, authentication, and configuration problems.
640f24
 .Xr ssh_config 5 ,
640f24
 .Xr sftp-server 8 ,
640f24
 .Xr sshd 8
640f24
+.Sh CAVEATS
640f24
+The original scp protocol (selected by the
640f24
+.Fl O
640f24
+flag) requires execution of the remote user's shell to perform
640f24
+.Xr glob 3
640f24
+pattern matching.
640f24
+This requires careful quoting of any characters that have special meaning to
640f24
+the remote shell, such as quote characters.
640f24
 .Sh HISTORY
640f24
 .Nm
640f24
 is based on the rcp program in
640f24
 .Bx
640f24
 source code from the Regents of the University of California.
640f24
+.Pp
640f24
+Since OpenSSH 8.8 (8.7 in Red Hat/Fedora builds),
640f24
+.Nm
640f24
+has use the SFTP protocol for transfers by default.
640f24
 .Sh AUTHORS
640f24
 .An Timo Rinne Aq Mt tri@iki.fi
640f24
 .An Tatu Ylonen Aq Mt ylo@cs.hut.fi
640f24
diff --git a/scp.c b/scp.c
640f24
index e039350c..c7cf7529 100644
640f24
--- a/scp.c
640f24
+++ b/scp.c
640f24
@@ -448,7 +448,7 @@ main(int argc, char **argv)
640f24
 	const char *errstr;
640f24
 	extern char *optarg;
640f24
 	extern int optind;
640f24
-	enum scp_mode_e mode = MODE_SCP;
640f24
+	enum scp_mode_e mode = MODE_SFTP;
640f24
 	char *sftp_direct = NULL;
640f24
 
640f24
 	/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
640f24
@@ -1983,7 +1983,7 @@ void
640f24
 usage(void)
640f24
 {
640f24
 	(void) fprintf(stderr,
640f24
-	    "usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
640f24
+	    "usage: scp [-346ABCOpqRrTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]\n"
640f24
 	    "           [-i identity_file] [-J destination] [-l limit]\n"
640f24
 	    "           [-o ssh_option] [-P port] [-S program] source ... target\n");
640f24
 	exit(1);