Link to home
Start Free TrialLog in
Avatar of rickyr
rickyr

asked on

Running xwindows through ssh.

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.
Avatar of fim32
fim32

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.
Avatar of rickyr

ASKER

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
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.
> 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
Avatar of yuzh
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!)
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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