Solved

Running xwindows through ssh.

Posted on 2004-03-22
8
1,824 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now