SCP fails to locate remote file: '-- <filename>'

Darren Tucker dtucker at zip.com.au
Mon Nov 14 11:37:03 EST 2011


On 13/11/11 11:49 PM, Dag-Erling Smørgrav wrote:
> mike.mackintosh at angrystatic.com writes:
[...]
>> scp -v -f -- config
>>
>> I am not sure why the -- is needed in this command.
>
> Because the filename might begin with a dash, and -- tells getopt to
> stop parsing options.
>
> This is a bug in the router / firewall / switch, not in OpenSSH.

True, but sadly common.  Damien added some code to try to work around it 
where possible[1] but it's not made it into a release yet.

Mike: please try a snapshot from http://www.mindrot.org/openssh_snap/ 
and let us know if it works or not.

[1] http://anoncvs.mindrot.org/index.cgi/openssh/scp.c?revision=1.189
http://anoncvs.mindrot.org/index.cgi/openssh/scp.c?r1=1.188&r2=1.189

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list