You could try to implement your own derived class of org.apache.sshd.server.session.SessionFactory and throw an exception if the connection is to be blacklisted. However, looking at the code, I think you're right, as any exception will not result in the session to be unmanaged, at least in the Nio2Acceptor service. That's a bug, could you please raise a JIRA issue for that ?
2015-05-07 17:36 GMT+02:00 Pellerin, Clement <[email protected]>: > I need to accept SSHD connections only from a predetermined list of IP > addresses. > I am trying to find the equivalent of the Mina BlacklistFilter for SSHD. > SSHD can run with NIO2 or Mina underneath so this should probably be done > in a higher layer. > I tried implementing the peer address check in > MySessionListener.sessionCreated() > but that confuses SSHD when running with NIO2. If I throw, SSHD stops > listening on the server socket. > If I simply close the session, the closed session is added permanently to > the managed sessions. > Is there a way to do this in SSHD without hardcoding to the Mina IO > service? > I am using SSHD 0.14.0 > >
