I used the following go code to open an ssh connection to a remote host
func ssh(keyname string, user string, address string) {
cmd := exec.Command("ssh", "-tt", user+"@"+address, "-i", "~/"+keyname)
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
if err := cmd.Run(); err != nil {
fmt.Println(err.Error())
}
}
func main() {
ssh("example.pem", "ubuntu", "192.169.0.1")
}
When i run the code i connect successully to the remote host and get a terminal, but when i type commands it doesn't show any outputs just hangs, tried to ssh normally via my terminal and everything is ok. Not sure if this is from my code or SSH
Stdin