feat: ecdsa sk
This commit is contained in:
7
main.go
7
main.go
@@ -22,7 +22,12 @@ func main() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
publicKeyOption := ssh.PublicKeyAuth(func(ctx ssh.Context, key ssh.PublicKey) bool {
|
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.Println("Listening :222...")
|
||||||
log.Fatal(ssh.ListenAndServe(":2222", nil, publicKeyOption))
|
log.Fatal(ssh.ListenAndServe(":2222", nil, publicKeyOption))
|
||||||
|
|||||||
Reference in New Issue
Block a user