Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #378 from neo-liang-sap/fix-alicloud-sshkey-inacce…
Browse files Browse the repository at this point in the history
…ssible

fix alicloud sshkey inaccessible due to missing a /
  • Loading branch information
neo-liang-sap committed Oct 13, 2020
2 parents 7582092 + a52c435 commit 2258705
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cmd/ssh_alicloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -106,7 +107,8 @@ func sshToAlicloudNode(nodeName, path, user, pathSSKeypair string, sshPublicKey
a.startBastionHostInstance()
fmt.Println("Bastion host started.")

sshCmd := "ssh -i " + pathSSKeypair + "key -o \"ProxyCommand ssh -i " + pathSSKeypair + "key -o StrictHostKeyChecking=no -W " + a.PrivateIP + ":22 " + a.BastionSSHUser + "@" + a.BastionIP + "\" " + user + "@" + a.PrivateIP + " -o StrictHostKeyChecking=no"
key := filepath.Join(pathSSKeypair, "key")
sshCmd := "ssh -i " + key + " -o \"ProxyCommand ssh -i " + key + " -o StrictHostKeyChecking=no -W " + a.PrivateIP + ":22 " + a.BastionSSHUser + "@" + a.BastionIP + "\" " + user + "@" + a.PrivateIP + " -o StrictHostKeyChecking=no"
cmd := exec.Command("bash", "-c", sshCmd)
cmd.Stdout = os.Stdout
cmd.Stdin = os.Stdin
Expand Down

0 comments on commit 2258705

Please sign in to comment.