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

fix alicloud sshkey inaccessible due to missing a / #378

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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