You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Lyor Goldstein (Jira)" <ji...@apache.org> on 2019/10/18 08:38:00 UTC

[jira] [Commented] (SSHD-951) Query on how to restart sshd server in single jboss session

    [ https://issues.apache.org/jira/browse/SSHD-951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16954389#comment-16954389 ] 

Lyor Goldstein commented on SSHD-951:
-------------------------------------

There are many good reasons why restarting the SSH server is not allowed. These reasons have to do with resources allocations, state tracking, etc...

That being said, it begs the question - why do you need to stop it ? Is it because you don't want to allow SSH connections during some time ? In that case, you could register an {{IoServiceEventListener}} that throws an exception when it is notified that an SSH connection has been established while you don't want to allow that. This way the SSH server remains up and running but not accepting any incoming connections while you don't want it to.

Other than that all I can say is that if you +absolutely must+ stop the server then there is no recourse other than creating a +new instance+ of it, configuring it and then starting it.

> Query on how to restart sshd server in single jboss session
> -----------------------------------------------------------
>
>                 Key: SSHD-951
>                 URL: https://issues.apache.org/jira/browse/SSHD-951
>             Project: MINA SSHD
>          Issue Type: Question
>    Affects Versions: 2.2.0
>            Reporter: Sivanagarajup
>            Priority: Major
>
> Hi Team,
> We are facing an issue with version *sshd-core-2.2.0*
> In the same session once we stoped ssh server we are not able to start the ssh server again.
> it is throwing exception below
> {code:java}
> Caused by: java.lang.IllegalStateException: Can not start the server again
> Caused by: java.lang.IllegalStateException: Can not start the server again at org.apache.sshd.server.SshServer.start(SshServer.java:293) 
> {code}
> As per your code in *org.apache.sshd.server.SshServer -> start()*
> {code:java}
> public void start() throws IOException {
>    if (isClosed()) {
>             throw new IllegalStateException("Can not start the server again");
>    }
> ------
> ------
> }{code}
>  it is not allowing us to start sshd server again.
> Note: Once we restarted our jboss server then we are able to start sshd server. 
> But we need to start/stop the ssh server multiple times in single session
> Could you please help us on above issue.
>  
> Thanks
> Siva



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org