Solved

Running xwindows through ssh.

Posted on 2004-03-22
8
1,826 Views
Last Modified: 2013-12-27
Hello....

I have a Sparc, Solaris 2.9 box i access over the internet.
From this box I can run x windows applications just fine.
I shall call this box the "ssh server".

I have another box on the network.
I would like to be able to run x apps on this second box, and have
the gui's piped back via teh ssh server, to my local PC.

I am using Exceed v9 on the my PC.
SSH Version Sun_SSH_1.0, protocol versions 1.5/2.0.
Solaris 9 on both remote sparcs.
0
Comment
Question by:rickyr
8 Comments
 
LVL 7

Expert Comment

by:fim32
ID: 10650536
if you're using ssh to access that second box, there isn't anything that needs to be done.  ssh will automagically build all the X forwarded connections through (provided X forwarding is on)

if you're having troubles with the second server, try running ssh with the -X (capital x) option to manually enable X-forwarding.

if you echo $DISPLAY, it should say something like <server>:n where <server> is the name of the machine you're connected to (it passes the connection through the server you're on to forward the packets back to the machine you connected from); if $DISPLAY is not set, then X forwarding is probably turned off.
0
 
LVL 3

Author Comment

by:rickyr
ID: 10651076
H fim32.....

I am using ssh only to get to the first box. There is no ssh server on the second box.
We can run x apps on the ssh box only.

X Forwarding is already enabled on the ssh server, hence the x apps that i can run
perfectly well from the ssh box.

If i set the DISPLAY env var to be the ip of the machine i ssh'd to, i get an authorisation
error..

Unless there is an alternative here, i will have to configure the second box with ssh.

regards

Ricky
0
 
LVL 7

Expert Comment

by:fim32
ID: 10651466
your alternative, then, is to set the DISPLAY session of the second server to what the DISPLAY session is set to in oyur ssh session...

then, in your ssh session, you'll have to allow that second server access using xauth (or xhost)

for instance, if you connected to the first server and your DISPLAY was set to "localhost:11.0", then on the second server, you'd set the display to "server:11.0"  and if you used xhost, you'd have to type "xhost secondserver" in your ssh session.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 10653037
> I would like to be able to run x apps on this second box, ..
how did you connect to this second box if not with ssh?

Assuming you start from PC a ssh connection to ssh server, and then from ssh server to ssh box, you need to set
your DISPLAY to PC:0 (or PC:10.0 depending on your ssh settings)
You don't need any xhost, except on the X-Server for the final display
0
 
LVL 38

Expert Comment

by:yuzh
ID: 10654417
To use X tunneling :

    PC -> Box1 (ssh server) -> Box2(another box)

    PC need ssh client, the others boxes need to install sshd (secure shell server), all of them
should have X forward enable

    When you ssh to Box1, the DISPLAY=10.0 (or other values, depands on the number of
connetions), when you login from Box1 -> Box2 use none ssh login (eg, telnet, rlogin etc).
you cann't set:
    DISPLAY=Box1-IP:10.0
You have to do:
    DISPLAY=PC-IP:0.0

    It is not X tunneling.

    If you don't want ssh install in Box2, and you want to run the app installed in box2, you can
try to use NFS mount, you mount the app on Box1, then you can ssh from PC to Box1, and then
run the app in Box1.

    (PS: some of the app might not work with NFS mount!)
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 11338631
PAQed - no points refunded (of 250)

Netminder
EE Admin
0
 

Expert Comment

by:iexxe
ID: 11411694
If I understand the question correctly, you're logging into another machine behind your visible Solaris 9 box?  You'd like the x sessions redirected through your first ssh machine?

If so, SSH has two tags you should consider:
ssh -X tells the receiving end to redirect all x sessions to the machine on the receiving (or local) end of your ssh session (as opposed to the machine on the "sending" (or remote) end of the session).

The other command you might want to know about is -L which sets up an internal ssh tunnel between your Solaris 9 machine and the very remote machine.  For example if your set up is this:

Home.linux.box.com <------> solaris.9.machine.net <------> very.remote.machine.net

Login to Solaris_9_box using -X and create an internal tunnel to the Very_Remote_Machine using something like:

ssh -X -L 6000:very.remote.machine.net:6000 very.remote.machine.net

Cheers
iexxe
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.

809 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