feat: ecdsa sk

This commit is contained in:
2021-07-17 17:17:09 +08:00
parent 29db055415
commit a8f95c82cb

View File

@@ -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))