From: Yolanda Robla Date: Mon, 15 Jul 2019 16:57:04 +0000 (+0200) Subject: Modify ssh key command generation X-Git-Tag: akraino_r2~48^2 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F91%2F1191%2F1;p=kni%2Finstaller.git Modify ssh key command generation There was a problem with the current command and the quotes, modify the way of generating it. Signed-off-by: Yolanda Robla Change-Id: I21531e01c062ae1e46c93d50b7f7ef5bd9df5b49 --- diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 4fa2805..e72f43a 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -21,7 +21,7 @@ func ValidateRequirements(buildPath string, siteName string) { if _, err := os.Stat(fmt.Sprintf("%s/id_rsa.pub", buildPath)); os.IsNotExist(err) { log.Println(fmt.Sprintf("No SSH public key (id_rsa.pub) found in %s. Generating keypair.", buildPath)) - cmd := exec.Command("ssh-keygen", "-b", "2048", "-f", fmt.Sprintf("%s/id_rsa", buildPath), "-C", "user@example.com", "-q", "-N", "\"\"") + cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("ssh-keygen -b 2048 -q -N '' -f %s/id_rsa -C user@example.com", buildPath)) err = cmd.Run() if err != nil { log.Fatal(fmt.Sprintf("Error generating ssh keypair: %s", err))