-
Notifications
You must be signed in to change notification settings - Fork 137
Closed
Description
I'm trying to connect to server using code from the examples, but the authentication fails without further information:
package main
import (
"fmt"
"log"
"github.com/melbahja/goph"
)
func main() {
auth, err := goph.UseAgent()
if err != nil {
log.Fatal(err)
}
client, err := goph.New("root", "kfbox.public", auth)
if err != nil {
log.Fatal(err)
}
// Defer closing the network connection.
defer client.Close()
// Execute your command.
out, err := client.Run("ls /tmp/")
if err != nil {
log.Fatal(err)
}
// Get your output as []byte.
fmt.Println(string(out))
}
$ go run main.go
2021/11/10 17:29:47 ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
exit status 1
$ ssh [email protected]
Last login: Wed Nov 10 17:23:22 2021 from 89.0.11.182
root@kfbox:~/ >
As you can see the agent authenticates without problems when using plain ssh. Is there any way to figure out why this is failing?
Metadata
Metadata
Assignees
Labels
No labels