Hi Team,
We have a java application where we use to send set of commands to a remote target host using SSH session STDIN (output stream) and use to get the response back from the SSH server via STDOUT/STDERR (input stream).
We use to open a SSH session using a SSH user, switch to root user, execute the list of commands and close the same session. Same will be repeated many times with different set of commands.
What we are seeing randomly is,
Our application sends the whole command and the echo response from SSH server STDOUT is not complete, partial text/command is lost. But the same set is executed successfully when we tried re-executing it again.
And we observe this issue only in the below version of OpenSSH on different platform,
1. SUSE 11: OpenSSH_6.6.1p1, OpenSSL 0.9.8j-fips 07 Jan 2009
2. RHEL 7.3: OpenSSH_6.6.1p1, OpenSSL 1.0.1e-fips 11 Feb 2013
FYI, we have not encountered this issue in the below OpenSSH versions on different platforms.
1. SUSE 12: OpenSSH_7.2p2, OpenSSL 1.0.2j-fips 26 Sep 2016
2. RHEL 6.5: OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
When I explored, got something related to partial output getting lost fixed in OpenSSH 6.7 (Not sure whether it is same or not)
“ssh-add(1): Make stdout line-buffered; saves partial output getting lost when ssh-add fatal()s part-way through”
Ref:
https://www.openssh.com/txt/release-6.7
Could you please share your valuable comments to identify the root cause and the permanent solution for this.
Thanks in advance.
Regards,
Venkatesan V