This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have written two methods for issuing an ssh command -- one using jsch version 0.1.31 and another using j2ssh-core version 0.2.9 -- and neither of them get past the connect step so I assume it's not an authentication problem since I don't even get to that step. With the code which uses the jsch library I get a JSchException: Algorithm negotiation fail, and with the code which uses the sshtools library I get an IOException: Socket is EOF. I have no clue as to what either of these exceptions indicate, and have found nothing so far using Google, amiling list archives, etc. However if I try the same ssh command at command line I have no errors. So it seems that my error is somehow related to running the Java code and not with the ssh configuration, but I'm not certain and hoping that someone reading this can guide me to a way of determining whether or not that's the case, and if so how to fix things.
When I run 'ssh -V' on both the local machine where I am running my Java codes as well as on the remote machine where I am trying to run the ssh commands I get the following result:
Thanks, Rob. I don't see a way in either library to set the protocol level that the client instance should use, however both of these libraries support SSL 2.0 so I don't think that that is the issue. In any event I've resorted to a brute force approach running ssh and scp commands using Runtime.exec() in order to move on and get some work done. It's not elegant but it's working fine for now.