Solved

Running app with X through ssh

Posted on 2010-08-26
9
1,116 Views
Last Modified: 2013-12-21
I want to start a java gui application on a debian server from ssh (putty, windows). The gui should be shown on the display connected to the debian server.

Is this possible? How?
0
Comment
Question by:jstakk
  • 4
  • 4
9 Comments
 
LVL 16

Expert Comment

by:gelonida
Comment Utility
yes this is possible if the server allos X forwarding


just try it by
ssh -X user@hostname your_graphics_app
0
 
LVL 16

Expert Comment

by:gelonida
Comment Utility
if you use the ~/.ssh config file, then just add the option
ForwardX11 yes


some applications additionally require
ForwardX11Trusted yes


Please read the security comments in the ssh documentation:

     ForwardX11
             Specifies whether X11 connections will be automatically redi-
             rected over the secure channel and DISPLAY set.  The argument
             must be “yes” or “no”.  The default is “no”.

             X11 forwarding should be enabled with caution.  Users with the
             ability to bypass file permissions on the remote host (for the
             user's X11 authorization database) can access the local X11 dis-
             play through the forwarded connection.  An attacker may then be
             able to perform activities such as keystroke monitoring if the
             ForwardX11Trusted option is also enabled.

     ForwardX11Trusted
             If this option is set to “yes”, remote X11 clients will have full
             access to the original X11 display.

             If this option is set to “no”, remote X11 clients will be consid-
             ered untrusted and prevented from stealing or tampering with data
             belonging to trusted X11 clients.  Furthermore, the xauth(1)
             token used for the session will be set to expire after 20 min-
             utes.  Remote clients will be refused access after this time.

             The default is “yes” (Debian-specific).

             See the X11 SECURITY extension specification for full details on
             the restrictions imposed on untrusted clients.
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Hi,

you need a local Xserver on your Windows machine such as Xming:

http://sourceforge.net/projects/xming/

Once it's installed, configure your PuTTY session (left pane of the configuration window) as follows:

Connection -> SSH -> X11 -> Enable X11 forwarding (right pane).

That shouldd o the trick.

wmp
0
 
LVL 2

Author Comment

by:jstakk
Comment Utility
Thanks. I will look into your solutions. But just to make it clear:

The application will be startet from my windows machine via ssh(putty).
The gui should be shown on the debian machine.


Do I still need XServer on my windows machine?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 2

Author Comment

by:jstakk
Comment Utility
Even clearer:
My debian server has no keyboard or mouse, but a display. Thats why i want to:

1. myGuiApp.jar is located on debian
2. From Windows I want to start this app remotely
3. The gui should now be display on the debian screen.
0
 
LVL 16

Accepted Solution

by:
gelonida earned 500 total points
Comment Utility
Hi jstakk,

two comments: woolmilkporc is right
you need an xserver on your windows host if you wanted to display a remote X application on your windows PC.

If you ever wanted to do this I would go for the heavyweight solution and just install cygwuin.

cygwin comes with an X server and with openssh which I personally prefer to putty.
(In fact my comment and my command line options were only valid for cygwin)



second comment:

if you want to display on the remote host and if the user, that you log in is authorized to the display then following will probably work.


use putty to connect to your remote host


then type
export DISPLAY=:0,0 # asuming you have only one display on the linux host
them just run your x program
0
 
LVL 16

Expert Comment

by:gelonida
Comment Utility
how do you want to control keyboard and mouse ???

Or is that a non interactive application?

If the application is started on the remote display, then it will also lsten to the remote mouse (not existning if I understood you correctly) and listen to your remote keyboard (also not existing)



There's an application called synergy, which allows to use keyboard and mouse of one hos to control the X server on another host.

0
 
LVL 2

Author Closing Comment

by:jstakk
Comment Utility
'export DISPLAY=:0' did it...
Thanks
0
 
LVL 2

Author Comment

by:jstakk
Comment Utility
It's a non-input slideshow application.
This will make developement and testing a lot easier.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now