?
Solved

Running app with X through ssh

Posted on 2010-08-26
9
Medium Priority
?
1,124 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 17

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 17

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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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 17

Accepted Solution

by:
gelonida earned 2000 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 17

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

765 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