java RMI via SSH v2 protocol

两盒软妹~` 提交于 2019-12-04 05:00:14

问题


How to implement java RMI over SSH v2 protocol.Is this possible?.If its not possible then can i achieve this using raw socket communication?.Simply i want to transmit my data via RMI but it should be encrypted as SSH v2 packets .


回答1:


Did you check Using RMI with SSL? The The New RMI article on java.net might be worth the read too.

(EDIT: The OP has updated his question and is actually looking for RMI over SSH so I'm updating my answer.

I never tried it but I guess you should be able to tunnel RMI through SSH. I don't see why it shouldn't be possible. Create a SSH tunnel and there you go.

There is a two parts article on javaranch about this, SSH Tunneling for Java RMI Part-I and Part II, that provides more details.

To be honest, I'm not sure why you should prefer SSH over SSL (which has strong authentication too)).




回答2:


Use an API like this http://www.jcraft.com/jsch/ to open an ssh tunnel (port forwarding from local machine to remote, on the port where the RMI service is listening), then configure your RMI client to connect to the local (forwarded) port.




回答3:


Just open up some ssh tunnels via port forwarding and you can do this completely transparently.



来源:https://stackoverflow.com/questions/1734558/java-rmi-via-ssh-v2-protocol

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!