LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do you run graphical programs on the server, displayed on the server, with ssh? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-you-run-graphical-programs-on-the-server-displayed-on-the-server-with-ssh-675853/)

yellowbounder 10-12-2008 11:04 AM

How do you run graphical programs on the server, displayed on the server, with ssh?
 
I've recently been teaching myself to use ssh, and so far it's going nicely, and I've set up key pairs and such things, but I want to be able to do more.

Executing commands is all very well, but sometimes I want to run a graphical program on the machine I'm sshing to (I think it's called the server), and have it displayed on that machine, rather than my own. (I think you display it on your own machine with the -X option.)

Thanks in advance for your help.

john test 10-12-2008 12:00 PM

If you are on machine A and are SSHed into machine B
Go to Machine B and get to a command prompt and type "xhost +"
Then go back to machine A and from the SSH prompt type "export DISPLAY=:0.0
at that point you could type "xcalc &" and expect a display of xcalc on the screen of machine B
The trailing & releases the SSH for further use.
If you don't use the trailing & your SSH will still be connected to the gui and the keystrokes should cause the GUI application running on machine B to to respond to your keystrokes

yellowbounder 10-13-2008 04:19 AM

The keystrokes don't seem to translate to the other machine.

However, how do I set the display back to Machine A (like with the -X option), after I've done that?

Also, how would I be able to control this new window? VNC?

john test 10-13-2008 03:38 PM

at ssh prompt type "export DISPLAY=MachineAipAddress:0.0 for example:
export DISPLAY=192.168.1.10X:0.0
that should work if you have xwindows running on Machine A

stlouis 10-13-2008 04:04 PM

If you are looking to learn SSH, and have some fun, while including your Windows box in the loop of things... I suggest two tools, XMing and Putty.

XMing, is a neat little piece of software that listens for X11 requests on the Windows hosts, and renders the X11 graphics as needed. It basically mimics a true X11 server... It works quite well. I do suggest the use of SSH compression however.

Putty is the best FREE Terminal Emulator client for Linux, as far as I'm concerned... Portable Putty, is a spin off with a few additional features, that can be downloaded from the XMing website.

SSH will allow you to forward more than just X11 requests, you can forward ports, through a method known as SSH Tunneling... This is great for securing access to services such as POP3 & HTML based email accounts. Plus whatever else that you may need to secure.

Last but not least, you can take advantage of the port forwarding feature, between servers, including daisy chaining various ports together. For example, Server A forward to B who Forwards to C, and so on....

So when you connect to server A, on the specified port, you actually connection to Server C in this case...

http://www.straightrunning.com/XmingNotes/

http://sourceforge.net/projects/xming


Have fun, be secure...

Zimbra, your OSALT to Microsoft Exchange
Vyatta, your OSALT to CISCO....


All times are GMT -5. The time now is 12:02 PM.