Skip to content

Conversation

@Luwdo
Copy link

@Luwdo Luwdo commented Jun 4, 2025

This allows more fine grained control of the disconnect message packet. Allowing custom authentication implementations to communicate to clients the reason for connection failure.

A common pattern that openssh implements is an authentication failure limit. Resulting in the following message:

Received disconnect from 10.99.33.252 port 30372:2: Too many authentication failures
Disconnected from 10.99.33.252 port 30372

ssh2 js can implement this but there was no way to pass back a human readable message or change the reason to PROTOCOL_ERROR: 2 which is most appropriate for a "Too many authentication failures" message.

Fall back is set to reason: BY_APPLICATION so those who do not implement custom authentication exit patterns won't be affected.

…ets. Updating client to allow setting the reason message and language when ending the client.
@Luwdo
Copy link
Author

Luwdo commented Jul 15, 2025

This is still an issue that is hiding ssh client visibility of messages concerning the reason why a connection was rejected.

@mscdex
Copy link
Owner

mscdex commented Jul 15, 2025

This needs a test.

@Luwdo
Copy link
Author

Luwdo commented Jul 16, 2025

This needs a test.

I can work on getting a test added to my PR.

ProTogen11
ProTogen11 previously approved these changes Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants