diff --git a/main.go b/main.go index 3de1365..ff61e96 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,12 @@ func main() { }) publicKeyOption := ssh.PublicKeyAuth(func(ctx ssh.Context, key ssh.PublicKey) bool { - return true // allow all keys, or use ssh.KeysEqual() to compare against known keys + log.Println("type: ", key.Type()) + if key.Type() == "sk-ecdsa-sha2-nistp256@openssh.com" { + return true + } + return false + //return true // allow all keys, or use ssh.KeysEqual() to compare against known keys }) log.Println("Listening :222...") log.Fatal(ssh.ListenAndServe(":2222", nil, publicKeyOption))