-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Bug description
When use golang ssh client connect to workspace and execute some command, it return a error Err:wait: remote command exited without exit status or exit signal
Steps to reproduce
use this golang code connect to workspace
client, err := ssh.Dial("tcp", "*****", &ssh.ClientConfig{
User: "root",
Auth: []ssh.AuthMethod{
ssh.Password("****"),
},
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
})
if err != nil {
log.Fatalf("SSH dial error: %s", err.Error())
}
session, err := client.NewSession()
defer session.Close()
if err != nil {
log.Fatalf("new session error: %s", err.Error())
}
result, err := session.Output("echo h")
if err != nil {
fmt.Fprintf(os.Stdout, "Failed to run command, Err:%s", err.Error())
os.Exit(0)
}
fmt.Println(string(result))
Workspace affected
No response
Expected behavior
print h
Example repository
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done