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?

Yuri yuri at rawbw.com
Sun Jan 12 04:13:14 AEDT 2020


On 2020-01-11 09:07, Thorsten Glaser wrote:
> Yes, “command1” is expanded remotely, but you use the quoting rules
> of the remote shell INSIDE the single quotes for the local POSIX shell
> to prevent that (just replace all ' with '\'' and you’re set).


It arrives to the remote host with the outer quotes stripped, and the 
expansion takes place. Perhaps this would work '\'some command\''. Then 
there should be double-quoting of any single-quote characters inside.


Yuri




More information about the openssh-unix-dev mailing list