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

Carson Gaspar carson at taltos.org
Mon Nov 14 15:28:20 EST 2011


On 11/13/2011 4:37 PM, Darren Tucker wrote:
> 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

An alternative to prepending '-- ' is prepending './' instead. But I 
have no idea how a windows-based implementation would handle that...

-- 
Carson




More information about the openssh-unix-dev mailing list