Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: OpenSSH scp completion reminder



Hi,

On Thu, Apr 14, 2022 at 04:44:33PM -0400, Phil Pennock wrote:
> On 2022-04-14 at 18:18 +0200, Axel Beckert wrote:
> > I thought so as well, but I so far couldn't find anything which didn't
> > work with zsh remote file completion with OpenSSH 9.0 on the client
> > side. Otherwise I would have reported it.
> 
> What version was the server running?

Good point.

I tried it with 8.4p1 (Debian 11 Bullseye) as well as with 9.0p1
(Debian Unstable) on the server side. And both times OpenSSH 9.0p1 and
Zsh 5.8.1.2-test on the client side.

> With localhost being 9.0 for client and server and zsh 5.8, I see this
> reproduction case; setup, then the results of tab-completion, and then
> at the end a manually-constructed filename which definitely would not
> have worked with older scp.

Oh, ok. Now I am confused, though.

> So the good news is that scp in the new mode is "pass the filename
> exactly as it really is, no escaping for the remote side, whatever
> reaches us in argv[] is what will be used, so you only need to worry
> about local shell escaping".

Correct. That's probably one of the things they wanted to get rid of.

> -O to use original SCP protocol, -s to use sftp protocol.

Thanks for that summary! I searched through the scp(1) man page several
times with different search terms for something like -s, but didn't
find it.

*lookingagain* Ah, they removed it again with the 9.0 release. No
traces of it in the 9.0p1 scp(1) man page. But it's in the one from
8.4p1. (I assumed that there is a way to revert a previously set -O —
maybe via config or so — on the commandline. But it seems as if
already the latter is not intended to be possible.)

> -D is for local debugging.

Huh? That's not in the scp(1) man page as of 8.4p1 and in the scp(1)
man page of 9.0p1, -D is documented as follows:

     -D sftp_server_path
             When using the SFTP protocol support via -M, connect
	     directly to a local SFTP server pro‐ gram rather than a
	     remote one via ssh(1). This option may be useful in
	     debugging the client and server.

Ah, I think you forgot to mention that "local debugging" meant "local
debugging on the server side" as sshd(8) mentions:

     -D      When this option is specified, sshd will not detach and
     	     does not become a daemon.  This allows easy monitoring of
	     sshd.

> So I think full support means knowing the version, knowing which version
> switched the default behaviour (looks like 9.0 man-page might be
> wrong),

Yes, noticed that, too. It says, the SFTP backend is default since
8.8. But if you look at the upstream changelog, they made SFTP the
default multiple times and then reverted it and applied it again:

  commit a4537e79ab4ac6db4493c5158744b9ebde5efcb0
  Date:   Wed Feb 23 21:21:16 2022 +0000

    upstream: put back the scp manpage changes for SFTP mode too

    OpenBSD-Commit-ID: 05dc53921f927e1b5e5694e1f3aa314549f2e768

  commit 449bcb8403adfb9724805d02a51aea76046de185
  Date:   Wed Feb 23 19:01:00 2022 +0000

    upstream: and we go back to testing sftp-scp after the 8.9
    release...
	    
    OpenBSD-Commit-ID: a80440168258adca543a4607b871327a279c569c

  commit 9699151b039ecc5fad9ac6c6c02e9afdbd26f15f
  Date:   Thu Feb 10 04:12:38 2022 +0000

    upstream: revert for imminent OpenSSH release, which wil ship with

    scp in RCP mode.

    > revision 1.106
    > date: 2021/10/15 14:46:46;  author: deraadt;  state: Exp; lines: +13 -9;  commitid: w5n9B2RE38tFfggl;
    > openbsd 7.0 release shipped with the (hopefully last) scp that uses RCP
    > protocol for copying.  Let's get back to testing the SFTP protocol.

    This will be put back once the OpenSSH release is done.

    OpenBSD-Commit-ID: 0c725481a78210aceecff1537322c0b2df03e768

I assume that they didn't fix up the "Since OpenSSH 8.8, scp has use
the SFTP protocol for transfers by default" (sic!) phrase in the
scp(1) man page after reapplying the patches from after 8.7 again for
9.0.

> and then knowing which options have been set on the command-line already
> for this version.

I also wondered if there's a possibility to configure the settings
relevant for rcp vs sftp as scp backend in ~/.ssh/config or
/etc/ssh/ssh_config. But I haven't found anything in that direction so
far.

		Kind regards, Axel
-- 
PGP: 2FF9CD59612616B5      /~\  Plain Text Ribbon Campaign, http://arc.pasp.de/
Mail: abe@xxxxxxxxxxxxxxx  \ /  Say No to HTML in E-Mail and Usenet
Mail+Jabber: abe@xxxxxxxxx  X
https://axel.beckert.ch/   / \  I love long mails: https://email.is-not-s.ms/




Messages sorted by: Reverse Date, Date, Thread, Author