Jonathan Pittman
2011-12-12 21:00:46 UTC
Following the example client code for exp/ssh, I am getting this message
after doing a session.Run("echo hi").
code...
session1, err := client.NewSession()
if err != nil {
log.Fatal("Error creating session1: ", err)
}
log.Println("Session1 created.")
if err := session1.Run(*cmdString); err != nil {
log.Fatal("Failed to Run: " + err.Error())
}
reader := bufio.NewReader(session1.Stdin)
line, _, _ := reader.ReadLine()
fmt.Println(line)
session1.Close()
cmdString in this case comes from flag.String(). This is the error message:
Failed to Run: wait: unexpected packet *ssh.channelEOFMsg received: &{0}
On the server side, it appears to accept authentication and shows the exec
of the command. I also ran this using a typical openssh client as well.
Using Go client...
sshd[13020]: Set /proc/self/oom_adj to 0
sshd[13020]: Connection from 192.168.1.101 port 45531
sshd[13020]: Postponed publickey for root from 192.168.1.101 port 45531
ssh2 [preauth]
sshd[13020]: Accepted publickey for root from 192.168.1.101 port 45531 ssh2
sshd[13020]: Found matching RSA key ...
sshd[13020]: Exec command 'echo hi'
sshd[13020]: Connection closed by 192.168.1.101
sshd[13020]: Transferred: sent 2600, received 2512 bytes
sshd[13020]: Closing connection to 192.168.1.101 port 45531
Using OpenSSH client...
sshd[12825]: Set /proc/self/oom_adj to 0
sshd[12825]: Connection from 192.168.1.101 port 36182
sshd[12825]: Postponed publickey for root from 192.168.1.101 port 36182
ssh2 [preauth]
sshd[12825]: Accepted publickey for root from 192.168.1.101 port 36182 ssh2
sshd[12825]: Found matching RSA key ...
sshd[12825]: Exec command 'echo hi'
sshd[12825]: Received disconnect from 192.168.1.101: 11: disconnected by
user
Anyone else run into this or have an idea as to what is happening here?
(fwiw, I have tried commands other than "echo hi")
after doing a session.Run("echo hi").
code...
session1, err := client.NewSession()
if err != nil {
log.Fatal("Error creating session1: ", err)
}
log.Println("Session1 created.")
if err := session1.Run(*cmdString); err != nil {
log.Fatal("Failed to Run: " + err.Error())
}
reader := bufio.NewReader(session1.Stdin)
line, _, _ := reader.ReadLine()
fmt.Println(line)
session1.Close()
cmdString in this case comes from flag.String(). This is the error message:
Failed to Run: wait: unexpected packet *ssh.channelEOFMsg received: &{0}
On the server side, it appears to accept authentication and shows the exec
of the command. I also ran this using a typical openssh client as well.
Using Go client...
sshd[13020]: Set /proc/self/oom_adj to 0
sshd[13020]: Connection from 192.168.1.101 port 45531
sshd[13020]: Postponed publickey for root from 192.168.1.101 port 45531
ssh2 [preauth]
sshd[13020]: Accepted publickey for root from 192.168.1.101 port 45531 ssh2
sshd[13020]: Found matching RSA key ...
sshd[13020]: Exec command 'echo hi'
sshd[13020]: Connection closed by 192.168.1.101
sshd[13020]: Transferred: sent 2600, received 2512 bytes
sshd[13020]: Closing connection to 192.168.1.101 port 45531
Using OpenSSH client...
sshd[12825]: Set /proc/self/oom_adj to 0
sshd[12825]: Connection from 192.168.1.101 port 36182
sshd[12825]: Postponed publickey for root from 192.168.1.101 port 36182
ssh2 [preauth]
sshd[12825]: Accepted publickey for root from 192.168.1.101 port 36182 ssh2
sshd[12825]: Found matching RSA key ...
sshd[12825]: Exec command 'echo hi'
sshd[12825]: Received disconnect from 192.168.1.101: 11: disconnected by
user
Anyone else run into this or have an idea as to what is happening here?
(fwiw, I have tried commands other than "echo hi")