Operating System - HP-UX
1829094 Members
2537 Online
109986 Solutions
New Discussion

HPUX OpenSSH & X display errors

 
SOLVED
Go to solution
Haralambos
Advisor

HPUX OpenSSH & X display errors

Hi,

I have two problems with x applications while going over ssh. Amy help will be appreciated.

BACKGROUND INFO:
================
ssh server: HP-UX Open SSH 3.91
PC Exceed: Hummingbird Exceed 10

SSHD (ON HPUX) -- (sshd_config)
=========================
X11DisplayOffset 10
X11Forwarding yes
X11UseLocalhost yes
XAuthLocation /usr/bin/X11/xauth


PROBLEMS:
==========
1. I ssh into my own account and `env` shows the following:
DISPLAY=localhost:10.0
HOME=/home/myaccnt
SSH_CLIENT=111.111.111.111 1111 22
SSH_CONNECTION=111.111.111.111 1111 122.22.122.222 22
So, here if i try to start the following applications, xclock, dtterm, gpm they all work and the window pops up on my Exceed (PC) display.
The **** problem **** though comes if I try using xterm or hpterm. These do not work and I get the following error:
X connection to localhost:10.0 broken (explicit kill or server shutdown).

Why is so and how can I solve it.


2. The second question I have I very similar to the above but with a small variance to it.

I can not launch any application if I `su` into root. In such a case I also get the same X connection broken message, as above, even though all my variables are enabled.

How can root run any Xapplications if the above scenario is illegal? PermitRootLogin is set to no in my sshd_config.


Thanks for your help.
Haralambos
6 REPLIES 6
paolo barila
Valued Contributor
Solution

Re: HPUX OpenSSH & X display errors

Hi,
same environment I act like this:

keep exceed active, but use putty
(http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)

to connect from your pc enabling X11 forwading (connection/ssh/tunnel).

If I have to switch user (su) I set and enable the display in the new user (root).
So when I'm normal user I do
# echo xauth -i add `xauth list|tail -1`
# echo export DISPLAY=$DISPLAY

after doing su to root, execute the result of the 2 commands above.

Pablo
share share share
Alex Glennie
Honored Contributor

Re: HPUX OpenSSH & X display errors

just a thought but does either of the above problems scenarios change if you run dtterm then start xterm or hpterm from the commandline with -ls option eg xterm -ls ?

If yes consider vi $HOME/.Xresources and add

*loginShell : True
Haralambos
Advisor

Re: HPUX OpenSSH & X display errors

Well,

I have solved the mistery to my first problem; i.e. why some X applications work and some others do not.

The problem is that hpterm and /usr/bin/x11/xterm are linked w/ X11R5 libraries whereas xclock, dtterm & gpm are all linked with X11R6 libs.
There exists a version of xterm that is linked with X11R6 under : /usr/contrib/bin/X11 which does indeed work.

paolo barila
Valued Contributor

Re: HPUX OpenSSH & X display errors

problem #2 it's also ok?
share share share
Armin Kunaschik
Esteemed Contributor

Re: HPUX OpenSSH & X display errors

Problem 1: Use "ForwardX11Trusted yes" in your local or global ssh config or use "-Y" on the command line!

Problem 2: You need to authorize the root user to use your display. This is usually done with a script like
xauth nextract - $DISPLAY|su - root -c "xauth nmerge -"

Hope this helps,
Armin
And now for something completely different...
Haralambos
Advisor

Re: HPUX OpenSSH & X display errors

Ok, both problems have been solved.
PROBLEM 1
========
As I said earlier, indeed earlier versions of the X libs do not handle X forwarding in some cases; on HPUX OpenSSH. So, either find versions of the X appliaction you want to run that link to X11R6 libs or set the X11UseLocalHost to 'no' in sshd_config. But, be carefull of setting this value to no as remote hosts can connect to your proxy server; option not available on Solaris OpenSSH.

PROBLEM 2
=========
The suggestion from Paolo works great:
# echo xauth -i add `xauth list|tail -1`
# echo export DISPLAY=$DISPLAY

Thanks!

Haralambos