Basically the main method of SshServer does all this. It can be run as a 
standalone server and see that multiple clients can connect to it concurrently


________________________________
From: Guillaume Nodet <gno...@apache.org>
Sent: Tuesday, March 7, 2017 10:59 AM
To: dev@mina.apache.org
Subject: Re: Apache MINA SSHd default ShellFactory Chocked the resources

The ProcessShellFactory already spawns a thread.
Here is the SshServer code which works with multiple clients:

https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java#L465-L591
[https://avatars1.githubusercontent.com/u/47359?v=3&s=400]<https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java#L465-L591>

mina-sshd/SshServer.java at master · apache/mina-sshd · 
GitHub<https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java#L465-L591>
github.com
mina-sshd - Mirror of Apache MINA SSHD ... Skip to content




2017-03-06 9:54 GMT+01:00 waseem.farooqui <waseem.farooqu...@gmail.com>:

> You're right about the server being singleton, but my problem is with the
> ShellFactory. I used the recommended code found  here
> <https://mina.apache.org/sshd-project/embedding_ssh.html>  , and it's
Embedding SSHD in 5 minutes — Apache 
MINA<https://mina.apache.org/sshd-project/embedding_ssh.html>
mina.apache.org
Embedding SSHD in 5 minutes¶ SSHD is designed to be easily embedded in your 
application as an SSH server. SSH Server needs to be configured before it can 
be started.



> giving
> me the same problem. It basically only caters to one client at a time. If
> multiple clients connect at the same time, it only responds to the first
> one
> that connected. After the first one disconnects, it provides the shell to
> the other client. I want them to be provided the shell simultaneously. I
> get
> the same results using the InteractiveShellFactory.INSTANCE as with the
> /bin/sh command.
>
> From what I read  here
> <https://github.com/apache/mina-sshd#remote-command-execution>  , it says
[https://avatars1.githubusercontent.com/u/47359?v=3&s=400]<https://github.com/apache/mina-sshd#remote-command-execution>

apache/mina-sshd<https://github.com/apache/mina-sshd#remote-command-execution>
github.com
mina-sshd - Mirror of Apache MINA SSHD



> that you need to spawn threads for each command or each shell but how am I
> supposed to do that when I want each user to get a separate shell.
>
>
>
>
>
> --
> View this message in context: http://apache-mina.10907.n7.
> nabble.com/Apache-MINA-SSHd-default-ShellFactory-Chocked-
> the-resources-tp52309p52370.html
> Sent from the Apache MINA Developer Forum mailing list archive at
> Nabble.com.
>



--
------------------------
Guillaume Nodet

Reply via email to