Solved

Running xwindows through ssh.

Posted on 2004-03-22
8
1,830 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
[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
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

623 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