Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.8.0
-
None
-
Windows
Description
To the best of my knowledge, there's no way, in a customised SSH server, to detect when the client connection's auth has successfully completed. As a hack I came up with:
public class RelaySshSession extends ServerSession {
private final RelayService relayService;
public RelaySshSession(RelayService relayService, SshServer server, IoSession sshIoSession) throws Exception
@Override
public CloseFuture close(boolean immediately)
private boolean authorized = false;
@Override
public WriteFuture writePacket(Buffer buffer) throws IOException {
if (!this.authorized) {
byte[] bytes = buffer.array();
if (bytes.length > 5 && bytes[5] == SshConstants.Message.SSH_MSG_USERAUTH_SUCCESS.toByte())
}
return super.writePacket(buffer);
}
}
As an example for why this might be useful, consider a dispatcher that accepts multiple clients. As long as any client is active the custom server send dispatch messages.
Attachments
Issue Links
- is related to
-
SSHD-211 Allow custom server services
- Resolved