Search code examples
javasshremote-accessjsch

Run graphical application only in remote machine using Java JSch, no using X11Fordward


I want to run an remote graphical application in any OS with JSch that only runs in that remote machine, for example I want to run gedit (Ubuntu) and it will appears in the desktop machine, i don't need to use it in the shell of SSH, it's like a remote launcher.

Is it possible to use any option for that?

/*Adding an option in session that allow this...*/
ChannelExec channelExec = (ChannelExec)session.openChannel("exec");
channelExec.setCommand("gedit"); //channelExec.setCommand("notepad");

Solution

  • You can try setting DISPLAY=localhost:0, although you might have problems with security; if so, please update the question.