Hey all,
The client ssh library of golang.org/x/crypto/ssh has the maxTries variable in the RetryableAuthMethod:
func RetryableAuthMethod(auth AuthMethod, maxTries int) AuthMethod
However, I can't seem to find a server-side version of this.
I discovered the SessionID variable (in the ConnMetadata interface, imported into server.go from connection.go) which seems to be an excellent candidate for implementing such functionality.
I am hoping the functionality to close a connection server-side after N number of tries is there already and I am just not seeing it?
Or perhaps someone implemented this already?
Any help or pointers in the right direction/to the relevant documentation would be very much appreciated.
Thanks in advance!
Thats your function, you can program any algorithm you wish.
Provide a proper PasswordCallback to your server, as in the NewServerConn example (https://godoc.org/golang.org/x/crypto/ssh#NewServerConn).Thats your function, you can program any algorithm you wish.