Why are the arguments supplied for the command run through ssh interpreted by shell before they are passed to the command on the server side?

Colin Watson cjwatson at debian.org
Sun Jan 12 11:41:40 AEDT 2020


On Sat, Jan 11, 2020 at 02:52:13PM +0100, Gert Doering wrote:
> On Sat, Jan 11, 2020 at 01:38:53PM +0000, Colin Watson wrote:
> >   ssh host cat 'path with spaces'
> >   ssh host "cat 'path with spaces'"
> 
> Too many shells involved...
> 
> This is really not a "SSH problem" but a "unix command line *left and right*
> which both have ideas about interpretation of specific characters".

It's an SSH problem specifically in that I do not believe it is possible
to correctly determine what quoting to use from ssh(1) even if you
understand Unix shell quoting rules.

Changing ssh's behaviour now would be extremely disruptive, but that's
not what I was suggesting.

-- 
Colin Watson                                       [cjwatson at debian.org]


More information about the openssh-unix-dev mailing list