• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using ssh pub/pri key implement port22

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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???
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll move this over to Security, see if there are any responses ready and waiting there.
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so very much for replying so throughly a manner. Keep up the great work!!
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yea its old. Just wanted to say its a good article and still relevant. Thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic