Solved

Running app with X through ssh

Posted on 2010-08-26
9
1,120 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
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.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Missing Apache mod_DBD packages in Centos 7 2 87
Shell Script on AIX 7 112
000webhost.com default error log 1 40
lunix and unix command 21 87
Secure Shell (SSH) is a network protocol for secure data communication, mainly used to administer remote Unix / Linux servers via command line. But it also allows the user to open a secure tunnel between a client and a server where he can send any k…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

829 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