[
https://issues.apache.org/jira/browse/SSHD-891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16770968#comment-16770968
]
Anudeep commented on SSHD-891:
------------------------------
Hi [~lgoldstein],
We see issue to be with ssh client which uses lib-ssh(0.4.5) .
In apache sshd-core(0.13.0) there is a logic to reexchange the keys for every
one hour ,server is able to send the key to client and client is not able to
send it back to server and session gets timeout and closed.
Please find below logs
{code:java}
02019-02-16 11:12:52,438 DEBUG [org.apache.sshd.common.io.nio2.Nio2Session]
(EJB default - 11) Writing 68 bytes
2019-02-16 11:12:52,439 INFO [org.apache.sshd.server.session.ServerSession]
(EJB default - 11) Initiating key re-exchange
2019-02-16 11:12:52,439 DEBUG [org.apache.sshd.common.io.nio2.Nio2Session]
(sshd-SshServer[78670623]-nio2-thread-3) Finished writing
2019-02-16 11:12:52,439 DEBUG [org.apache.sshd.server.session.ServerSession]
(EJB default - 11) Send SSH_MSG_KEXINIT
2019-02-16 11:12:52,439 DEBUG [org.apache.sshd.common.io.nio2.Nio2Session] (EJB
default - 11) Writing 644 bytes
2019-02-16 11:12:52,444 DEBUG [org.apache.sshd.common.io.nio2.Nio2Session]
(sshd-SshServer[78670623]-nio2-thread-1) Finished writing
2019-02-16 11:13:02,438 TRACE [org.apache.sshd.common.channel.Window] (EJB
default - 15) Consume server remote window by 4 down to 191444
2019-02-16 11:13:02,439 DEBUG [org.apache.sshd.server.channel.ChannelSession]
(EJB default - 15) Send SSH_MSG_CHANNEL_DATA on channel 0
2019-02-16 11:13:02,440 INFO [org.apache.sshd.server.session.ServerSession]
(EJB default - 15) Start flagging packets as pending until key exchange is done
2019-02-16 11:13:12,439 TRACE [org.apache.sshd.common.channel.Window] (EJB
default - 19) Consume server remote window by 4 down to 191440
2019-02-16 11:13:12,439 DEBUG [org.apache.sshd.server.channel.ChannelSession]
(EJB default - 19) Send SSH_MSG_CHANNEL_DATA on channel 0
2019-02-16 11:13:22,439 TRACE [org.apache.sshd.common.channel.Window] (EJB
default - 23) Consume server remote window by 4 down to 191436
2019-02-16 11:13:22,439 DEBUG [org.apache.sshd.server.channel.ChannelSession]
(EJB default - 23) Send SSH_MSG_CHANNEL_DATA on channel 0
2019-02-16 11:13:32,438 TRACE [org.apache.sshd.common.channel.Window] (EJB
default - 27) Consume server remote window by 4 down to 191432
2019-02-16 11:13:32,438 DEBUG [org.apache.sshd.server.channel.ChannelSession]
(EJB default - 27) Send SSH_MSG_CHANNEL_DATA on channel 0
2019-02-16 11:13:42,439 TRACE [org.apache.sshd.common.channel.Window] (EJB
default - 31) Consume server remote window by 4 down to 1:
{code}
{code}
public class ServerSession extends AbstractSession {
protected static final long MAX_PACKETS = (1l << 31);
private long authTimeoutTimestamp;
private long idleTimeoutTimestamp = 0L;
private int authTimeoutMs = 2 * 60 * 1000; // 2 minutes in milliseconds
private int idleTimeoutMs = 10 * 60 * 1000; // 10 minutes in milliseconds
private long maxBytes = 1024 * 1024 * 1024; // 1 GB
private long maxKeyInterval = 60*60*1000 ; // 1 hour
public ServerSession(ServerFactoryManager server, IoSession ioSession)
throws Exception {
super(true, server, ioSession);
authTimeoutMs = getIntProperty(ServerFactoryManager.AUTH_TIMEOUT,
authTimeoutMs);
authTimeoutTimestamp = System.currentTimeMillis() + authTimeoutMs;
idleTimeoutMs = getIntProperty(ServerFactoryManager.IDLE_TIMEOUT,
idleTimeoutMs);
maxBytes = Math.max(32,
getLongProperty(ServerFactoryManager.REKEY_BYTES_LIMIT, maxBytes));
maxKeyInterval = getLongProperty(ServerFactoryManager.REKEY_TIME_LIMIT,
maxKeyInterval);
log.info("Server session created from {}",
ioSession.getRemoteAddress());
sendServerIdentification();
kexState.set(KEX_STATE_INIT);
sendKexInit();
}
{code}
Can you please let us know if there is a way to change the configuration of
maxKeyInterval ,i mean can we do it via any configuration file.
Regards,
Anudeep
> SSh connections gets closed for every one hour with 0.13.0 version
> ------------------------------------------------------------------
>
> Key: SSHD-891
> URL: https://issues.apache.org/jira/browse/SSHD-891
> Project: MINA SSHD
> Issue Type: Bug
> Reporter: Anudeep
> Assignee: Goldstein Lyor
> Priority: Blocker
>
> SSH connections are getting closed for every one hours after 10 mins of idle
> time even though there are incoming pacets data is not being wriiten to
> client for every one hour and is being idle(10 mins which is default timeout
> of ssh session).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)