my dog learned polymorphism
The moose likes Java in General and the fly likes Runtime.exec( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Runtime.exec( "ssh" )?" Watch "Runtime.exec( "ssh" )?" New topic

Runtime.exec( "ssh" )?

kyle klicker

Joined: Aug 20, 2001
Posts: 1

I am working with some software written in Java that incorporates VNC, and I would like to be able to use secure shell to do port forwarding so that we can use localhost ort to do some firewall tunneling. Manually, it works pretty well, as we can log into an ssh server with the port-forward option -L and run a vncviewer at localhost:remote port and view the remote desktop. However, I'd like to make it more seamless for the user by exec-ing ssh in the java code, and passing in the userpassword from an I/O stream. This doesn't work well, and I get the message that there is no controlling tty and that the pseudo-terminal cannot be allocated. Does anyone know a way around this?
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
You might want to consider using a java implementation of SSH. I know there are a few. Using an ssh executable decreases portability. If using ssh is just an option for people who have it, I suggest you eliminate the option and include a java implementation anyway. You shouldn't be using VNC without it.
I agree. Here's the link:
subject: Runtime.exec( "ssh" )?
It's not a secret anymore!