diff --git a/src/Task/Remote/Ssh.php b/src/Task/Remote/Ssh.php index 69df9fe2c..d0dbbdfd4 100644 --- a/src/Task/Remote/Ssh.php +++ b/src/Task/Remote/Ssh.php @@ -261,13 +261,13 @@ protected function validateParameters() */ protected function sshCommand($command) { - $command = $this->receiveCommand($command); + $command = static::escape($this->receiveCommand($command)); $sshOptions = $this->arguments; $hostSpec = $this->hostname; if ($this->user) { $hostSpec = $this->user . '@' . $hostSpec; } - return "ssh{$sshOptions} {$hostSpec} '{$command}'"; + return "ssh{$sshOptions} {$hostSpec} {$command}"; } }