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/12/15 18:06:00 UTC

[jira] [Commented] (SSHD-958) sshd (openssh5) closes connection on mina ssh client after pkt 50, but not ssh

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

Lyor Goldstein commented on SSHD-958:
-------------------------------------

The {{SSH_NEW_OPENSSH|SSH_BUG_DYNAMIC_RPORT| SSH_BUG_SIGTYPE}} flags are used by the _OpenSSH_ client to modify its behavior somehow according to the detected server type. There is no specific code that handles specific servers versions in MINA SSHD. That being said, if you can figure out what special behavior  flags mean as far as client behavior, you could implement it on the client side. This can be done by registering a {{SessionListener}} and overriding its {{sessionPeerIdentificationReceived}} method. There you can examine the reported server session and (hopefully) modify your client's behavior accordingly.

Note that currently, your client's identification and initial KEX (key-exchange) is sent *concurrently* with receiving the server side information. If you reach the conclusion that you need to wait for the server's identification before sending the client side initial messages, then in (the yet unreleased) version 2.3.1 there is support for delaying the client's identification until the server's one is received. This is required if the server-version dependent changes are in the KEX.

In this context, if you do figure out what special behavior these flags control please document them in this issue so we can consider adding the support in the next release (should not be too difficult - simply +grep+ the C/C++ code of the _OpenSSH_ client and see if you can figure out the usage of these special flags).

> sshd (openssh5) closes connection on mina ssh client after pkt 50, but not ssh
> ------------------------------------------------------------------------------
>
>                 Key: SSHD-958
>                 URL: https://issues.apache.org/jira/browse/SSHD-958
>             Project: MINA SSHD
>          Issue Type: Bug
>            Reporter: Yuefeng
>            Priority: Major
>
> Using mina ssh library to connect to a system, but the system always closes connection at the following stage:
> {code:java}
> 2019-12-09 21:03:08 Z [pool-123195-thread-1] DEBUG org.apache.sshd.client.session.ClientUserAuthService: auth(ClientSessionImpl[XXXXXXXX])[ssh-connection] send SSH_MSG_USERAUTH_REQUEST for 'none'
> 2019-12-09 21:03:08 Z [pool-123195-thread-1] DEBUG org.apache.sshd.client.session.ClientSessionImpl: writePacket(ClientSessionImpl[XXXXXXXXX])[SSH_MSG_USERAUTH_REQUEST] Start flagging packets as pending until key exchange is done
> 2019-12-09 21:03:09 Z [pool-123195-thread-1] DEBUG org.apache.sshd.client.session.ClientSessionImpl: close(ClientSessionImpl[XXXXXXXXXX]) Closing immediately
> 2019-12-09 21:03:09 Z [pool-123195-thread-1] DEBUG org.apache.sshd.client.session.ClientSessionImpl: signalAuthFailure(ClientSessionImpl[XXXXXX]) type=SshException, signalled=false: Session is being closed
> {code}
> when I tried ssh client from the same computer to the same destination, it works.  "-vvv" shows that the destination system is 
> {code:java}
> debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3 debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
> {code}
> openssh lib shows the compat flag
> {code:java}
> { “OpenSSH_5*“, SSH_NEW_OPENSSH|SSH_BUG_DYNAMIC_RPORT| SSH_BUG_SIGTYPE},
> {code}
>  
> while "SSH_NEW_OPENSSH" and "SSH_BUG_SIGTYPE" are common, flag SSH_BUG_DYNAMIC_RPORT is specific to OpenSSH_5, and not set anywhere else.  Does mina ssh handle OpenSSH_5?
>  
>  
>  
>  
>  



--
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