diff --git a/cmd/ssh.go b/cmd/ssh.go index e68b896a6..4139329fa 100644 --- a/cmd/ssh.go +++ b/cmd/ssh.go @@ -641,7 +641,7 @@ func (cmd *SSHCmd) setupGPGAgent( if len(gitGpgKey) > 0 { gitKey := strings.TrimSpace(string(gitGpgKey)) forwardAgent = append(forwardAgent, "--gitkey") - forwardAgent = append(forwardAgent, gitKey) + forwardAgent = append(forwardAgent, fmt.Sprintf("'%s'", gitKey)) } command := strings.Join(forwardAgent, " ")