Solved

Running app with X through ssh

Posted on 2010-08-26
9
1,118 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
ID: 33535815
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
ID: 33535853
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
ID: 33535864
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 2

Author Comment

by:jstakk
ID: 33536033
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
 
LVL 2

Author Comment

by:jstakk
ID: 33536149
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
ID: 33536172
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
ID: 33536210
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
ID: 33536222
'export DISPLAY=:0' did it...
Thanks
0
 
LVL 2

Author Comment

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

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

773 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