-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"5 Invalid MAC" when connecting to server www.sproom.net #741
Comments
Hi @runholen, In order to provide you any assistance, we would need you to enable debug logging inside JSch and then provide a full copy of the JSch logs from a failed connection attempt. Thanks, |
Hi. I use JSch.setLogger(new MyLogger()); And here is the log output: 1 Connecting to www.sproom.net port 22 If I add the follwing config line: 1 Connecting to www.sproom.net port 22 |
Hi @runholen, In your logging output, I see that you are using different MACs for
If you change your code so that it sets the session.setConfig("mac.c2s", "hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96,"+session.getConfig("mac.c2s"));
session.setConfig("mac.s2c", "hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96,"+session.getConfig("mac.s2c")); Thanks, |
Thank you very much, that did the trick. |
We have recently upgraded to the 0.2-fork of jsch, and it worked for most of connections.
But a connection to one server, www.sproom.net does not work.
It only accepts ssh-rsa, so we have added the following:
session.setConfig("server_host_key", session.getConfig("server_host_key") + ",ssh-rsa");
session.setConfig("PubkeyAcceptedKeyTypes", "ssh-rsa," + session.getConfig("PubkeyAcceptedKeyTypes"));
This has solved the issue for other servers, but not this one. we get
1 SSH_MSG_NEWKEYS sent
1 SSH_MSG_NEWKEYS received
1 SSH_MSG_SERVICE_REQUEST sent
1 Disconnecting from www.sproom.net port 22
Exception in thread "main" com.jcraft.jsch.JSchSessionDisconnectException: SSH_MSG_DISCONNECT: 5 Invalid MAC
We then tried adding to our code
session.setConfig("mac.s2c", "hmac-sha1,"+session.getConfig("mac.s2c"));
But we then only get the following:
1 SSH_MSG_NEWKEYS sent
1 SSH_MSG_NEWKEYS received
1 SSH_MSG_SERVICE_REQUEST sent
4 Bad packet length 20
1 Disconnecting from www.sproom.net port 22
Exception in thread "main" com.jcraft.jsch.JSchException: Packet corrupt
What can we do to fix this issue for www.sproom.net ?
The text was updated successfully, but these errors were encountered: