1. The server code is incomplete - after "server.start()" you must have an 
infinite loop otherwise the "main" program will exit and stop:

        server.start();
        while(...still ok to run...) { Thread.sleep(...); }

2. Are you sure "/bin/ksh" can be run by you ? Remember that your server is 
running as the current user and not "root"...

3. Make sure you are connecting to SAME port you set the server to listen to 
(9081 in the example below)

4. If all else fails, you can debug the ProcessShell class and see what 
happens...

-----Original Message-----
From: Влад Сурагин [mailto:v.sura...@mail.ru] 
Sent: Monday, October 19, 2015 21:21
To: dev@mina.apache.org
Subject: SSHD Server


Greetings all,

I'm a little bit confused.
I've created an elementary sshd server*.
Deployed it to openBSD device.
Connected to it through putty, successfully logged in.
And then... nothing.

I mean for every symbol I type I'm getting next info on server but nothing 
happens in putty console.

Do you have any idea why is it happening?



*
public static void main(String[] args) {
   try {
      SshServer server = SshServer.setUpDefaultServer();
      server.setPort(9081);
      server.setPasswordAuthenticator(new DynamicAuthenticator());
      server.setKeyPairProvider(new SimpleGeneratorHostKeyProvider());
      server.setShellFactory(new ProcessShellFactory(new String[] { "/bin/ksh" 
}));
      server.setCommandFactory(new ScpCommandFactory());
      server.start();
   } catch (IOException e) {
      e.printStackTrace();
   }
}

Sincerely yours,
Vlad Suragin
  • SSHD Server Влад Сурагин
    • RE: SSHD Server Lyor Goldstein

Reply via email to