blueflow 1 day ago

No, ssh is called by the local shell. ssh never gets to see the quoted value that you typed in your shell. This mechanism is unrelated to ssh, at all:

  $ printf "%s\n" "asdf"
  asdf
You see the double quotes go missing.

This happens as part of the shell turning the command string into argument vectors to pass to execv().

1
immibis 20 hours ago

When I run:

ssh foo@bar "echo 'hello world'"

ssh chooses to unquote the string: echo 'hello world'

splitting it into two parts (echo, and hello world), and then running the program echo with the argument hello world.

The fact it does this via a separate program is irrelevant.

blueflow 20 hours ago

> ssh chooses to unquote the string > splitting it into two parts

wrong, ssh does no argument splitting

> then running the program echo

wrong, it passes the string to the users login shell, whatever program that is. See sshd(8).

> The fact it does this via a separate program is irrelevant

just gently caress yourself.

immibis 11 hours ago

the fact that ssh chooses to invoke another program to split arguments instead of splitting arguments itself is a distinction without a difference.