Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Prevent openssh from sending "--" to the server with scp?

45 views
Skip to first unread message

matt.p...@gmail.com

unread,
Aug 29, 2012, 3:55:16 PM8/29/12
to
Apologies if this is handled somewhere, "--" is unbelievably hard to google for in context.

I'm having a problem with an embedded system which doesn't like the '--' that the scp client in openssh sends to end argument processing.

debug1: Sending command: scp -v -f -- /foo.txt
Received disconnect from 10.1.1.1: 2: Protocol error.

I'm working with the vendor to see if we can get the server fixed, but in the mean time I'm looking for a workaround. Does anyone know of a way to convince the openssh to not send the --? I know it can work since older versions didn't send it... we ran into this problem while migrating some scriptery to a newer box.

Thanks for any suggestions!
Matt

Richard E. Silverman

unread,
Aug 29, 2012, 6:59:35 PM8/29/12
to
matt.p...@gmail.com writes:

> Apologies if this is handled somewhere, "--" is unbelievably hard to google for in context.
>
> I'm having a problem with an embedded system which doesn't like the '--' that the scp client in openssh sends to end argument processing.
>
> debug1: Sending command: scp -v -f -- /foo.txt
> Received disconnect from 10.1.1.1: 2: Protocol error.

This was fixed in OpenSSH 6.0, which now adds the "--" only if needed
because of a leading "-" in the next token on the command line:

[scp.c]
- xasprintf(&bp, "%s -f -- %s", cmd, src);
+ xasprintf(&bp, "%s -f %s%s", cmd,
+ *src == '-' ? "-- " : "", src);

So, you could avoid this by upgrading the client.

- Richard

matt.p...@gmail.com

unread,
Aug 29, 2012, 10:33:10 PM8/29/12
to
On Wednesday, 29 August 2012 18:59:37 UTC-4, Richard E. Silverman wrote:
> So, you could avoid this by upgrading the client.

Ah excellent. Thanks!
0 new messages