ssh2 icon indicating copy to clipboard operation
ssh2 copied to clipboard

How to correctly end client connection / block client ?

Open AlexandraK opened this issue 4 years ago • 2 comments

Say the client fails to log in 3 times in a row and I want to block his IP. What's the correct way to do this and send the client a message that he did too many login attempts?

I tried calling client.end() in the connection event. It ends the connection but I also get Error: Bad identification start after that.

AlexandraK avatar Aug 18 '20 17:08 AlexandraK

Nothing like that is exposed currently.

mscdex avatar Aug 18 '20 18:08 mscdex

Nothing like that is exposed currently.

hostVerifier - function - Function with parameters (hashedKey[, callback]) where hashedKey is a string hex hash of the host's key for verification purposes. Return true to continue with the handshake or false to reject and disconnect, or call callback() with true or false if you need to perform asynchronous verification. Default: (auto-accept if hostVerifier is not set) I see this function can use callback. Where can I see some examples , I don't konw how to use it.

shangchengxiang avatar Sep 04 '20 10:09 shangchengxiang