Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Running app with X through ssh

Posted on 2010-08-26
9
Medium Priority
?
1,125 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
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…
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…
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.
Suggested Courses

604 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