Hi All,
  The problem is resolved now. It was because my client was sending an
extra authentication request. Client can't be changed. so i have overridden
the SessionFactory to resolve the issue, when the extra user auth comes

sshd.setSessionFactory(new IgnoreExtraAuthSessionFactory());

public class IgnoreExtraAuthSessionFactory extends SessionFactory {
protected IgnoreExtraAuthSessionFactory() {}

    protected AbstractSession createSession(IoSession ioSession)
      throws Exception
    {
      return new IgnoreExtraAuthServerSession(this.server, ioSession);
    }
}

public class IgnoreExtraAuthServerSession extends ServerSession {

IgnoreExtraAuthServerSession(ServerFactoryManager server, IoSession
ioSession)
    throws Exception
  {
    super(server, ioSession);
  }

protected void doHandleMessage(Buffer buffer) throws Exception {
byte cmd = buffer.array()[buffer.rpos()];
if(cmd == SshConstants.SSH_MSG_USERAUTH_REQUEST && isAuthenticated() ==true
){
return;
}
super.doHandleMessage(buffer);
 }

}

Regards,
Sendilraj P

On Thu, Feb 19, 2015 at 4:44 PM, SiriSenthilRaam - <
[email protected]> wrote:

> Hi All,
>   I am getting the below exception, when my client retries connecting to
> the ssh server. Please can anyone help me understand why this happens or
> how i can i get out of this situation?
>
>
> Feb 19, 2015 4:42:21 PM org.apache.sshd.server.session.ServerSession <init>
> INFO: Server session created from /100.x.x.x:60031
> Feb 19, 2015 4:42:21 PM org.apache.sshd.common.session.AbstractSession
> negotiate
> INFO: Kex: server->client blowfish-cbc hmac-md5-96 none
> Feb 19, 2015 4:42:21 PM org.apache.sshd.common.session.AbstractSession
> negotiate
> INFO: Kex: client->server blowfish-cbc hmac-md5-96 none
> Feb 19, 2015 4:42:21 PM net.juniper.deviceSim.SimPasswordAuthenticator
> authenticate
> INFO: Authenticating Session from/100.x.x.x:60031 User: root
> Feb 19, 2015 4:42:21 PM
> org.apache.sshd.server.session.ServerUserAuthService process
> INFO: Session root@/10.204.244.158:60031 authenticated
> Feb 19, 2015 4:42:21 PM org.apache.sshd.common.session.AbstractSession
> exceptionCaught
> WARNING: Exception caught
> java.lang.IllegalStateException: Unsupported command: 50
> at
> org.apache.sshd.common.session.AbstractConnectionService.process(AbstractConnectionService.java:178)
> at
> org.apache.sshd.common.session.AbstractSession.doHandleMessage(AbstractSession.java:405)
> at
> org.apache.sshd.common.session.AbstractSession.handleMessage(AbstractSession.java:301)
> at
> org.apache.sshd.common.session.AbstractSession.decode(AbstractSession.java:738)
> at
> org.apache.sshd.common.session.AbstractSession.messageReceived(AbstractSession.java:283)
> at
> org.apache.sshd.common.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:54)
> at
> org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:184)
> at
> org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:170)
> at
> org.apache.sshd.common.io.nio2.Nio2CompletionHandler$1.run(Nio2CompletionHandler.java:32)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:30)
> at sun.nio.ch.Invoker.invokeUnchecked(Unknown Source)
> at sun.nio.ch.Invoker$2.run(Unknown Source)
> at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
> Thanks & Regards,
> Sendilraj P
>

Reply via email to