File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Runtime.exec( "ssh" )?

kyle klicker
Greenhorn

Joined: Aug 20, 2001
Posts: 1
Hello,

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?
Thanks,
kyle
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: http://aspose.com/file-tools
 
subject: Runtime.exec( "ssh" )?
 
Similar Threads
Any link between port 80 and 8080
How can my program tunnel
Need Unix/ssh help
Using ssh pub/pri key implement port22
Ant and SSH