Usually when this error happens, all you need to do is to add the host key in a normal SSH session. However, this can also happen when the host key is in a format that JSch does not recognise or support e.g. I had a problem with a "ecdsa-sha2-nistp256" encoded host key.
To fix this I had to use the "ssh-keyscan -t rsa <hostname>" command (on the server) to obtain the host key in rsa format and then I manually added that to the "known_hosts" file.
Reference: http://anahorny.blogspot.sg/2013/05/solution-for-comjcraftjschjschexception.html
No comments:
Post a Comment