• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using ssh pub/pri key implement port22

 
Diego Bowen
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a rmi application that uses a socket factory to encrypt communication between the client/server. There is no dynamic class loading the stub is with the client. Everything works fine. Now I want to my my server code to a machine that only has port 22 open for communication to the outside world. It has implement a ssh public/private scheme. Is there any way I can use that existing port???
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll move this over to Security, see if there are any responses ready and waiting there.
 
Lewin Chan
Ranch Hand
Posts: 214
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Now I want to my my server code to a machine that only has port 22 open for communication to the outside world.

I assume this to mean that the firewall protecting this machine only allows ssh access from the outside world, and this server has sshd installed.
The quick answer is to say use a SSH tunnel. It is supported by all ssh implementations (mindterm springs to mind if you want a java implementation that you can use programatically).
Details about ssh tunneling can be found on the web
 
Pankaj Kr
Author
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW, if want to know the command to forward pt1 of local machine to pt2 of remote machine rm_name, then the command is:

You can have multiple -L options, but I don't think you can have a wild card for port number. So, you will have to specify a fixed port no. in the constructor of the RMI Implementation class.
[ September 24, 2003: Message edited by: Pankaj Kr ]
 
Diego Bowen
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys, however is there a way I can use ssh tunneling via port 22 and java rmi technology??? Do you know of any sources I get investigate??? Thanks in advance!!
 
Adrian Yan
Ranch Hand
Posts: 688
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm... so you want your server sitting on top of SSH, I don't think that would work. However, you can remote execute thru SSH. ssh -l user@remote <command>. Hope that helps.
 
Pankaj Kr
Author
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out this article for some detailed discussion on how to setup RMI over SSH. I should mention that the motivation for the article came from the discussion in this thread (And I acknowledge it in the article ).
One thing I discovered after sending out the article is that there exists an elegant way to specify the hostname string that gets associated with remote stubs for locally created remote objects. This is done by setting the Java system property to the desired value (which should be "localhost" for SSH tunneling), as explained in the official RMI documentation. This capabilitiy actually makes SSH tunneling for RMI much more elegant and easy to setup.
 
Diego Bowen
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so very much for replying so throughly a manner. Keep up the great work!!
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea its old. Just wanted to say its a good article and still relevant. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic