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 .
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)).