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

Dag-Erling Smørgrav des at des.no
Sun Nov 13 23:49:20 EST 2011


mike.mackintosh at angrystatic.com writes:
> I am not sure if many people have run into this, but recently working
> with some non-standard SSH capable devices, Routers, Firewalls and
> Switches, I noticed SCP failed on many of them. Looking through logs I
> saw:
>
> SCP unable to find file: '-- config'
>
> When looking through the verbose output from the issued command, it
> was passing:
>
> 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.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the openssh-unix-dev mailing list