Operating System - HP-UX
1837092 Members
2480 Online
110112 Solutions
New Discussion

Re: ssh with X11 for non-root user

 
Rahul Sharma_4
Advisor

ssh with X11 for non-root user

Im trying to ssh -X from a linux box (running fedora core 3) to a HPUX box (11.23). I find that Im able to do:
#xclock (as a root user)

but as a normal user I get error:
$xclock

Error: Can't open display:

---------------------------------------
/opt/ssh/etc/ssh_config on the hpux box shows:

Host *
# ForwardAgent no
ForwardX11 yes

---------------------------------------
On my linux box I've done xhost +


Any suggestions as to what I can do to get X enabled for a non-root user?

Regards!


4 REPLIES 4
Venkatesan_5
Frequent Advisor

Re: ssh with X11 for non-root user

hi...

please go thru thru the link ...

http://www.kleber.net/ssh/ssh-faq-7.html#ss7.3.1

for further details u can also verify
http://www.kleber.net/ssh/TheWholeSSHFAQ.html


and select the topic 7.3.1,7.3.2,7.3.3

hope this may help you...if not reply back....let me find some more...



regds

Venkatesan
Rahul Sharma_4
Advisor

Re: ssh with X11 for non-root user

Thanks anyways for the pointers -- it helped me to be a bit more confident that I was'nt doing anothing wrong. The issue got resolved. The reason being that when I used the useradd command, the directory /home/-user-
was not being created (although it showed in /etc/passwd).
I manually created the dir and chowned it for the user so that the default login dir is /home/-user-

Once this was done an ls -a on /home/-user- showed .Xauthority directory and then the xclock worked for the normal user!
However, if anyone is facing the same problem also make sure that:

---------------------------------------
/opt/ssh/etc/ssh_config on the hpux box shows:

Host *
# ForwardAgent no
ForwardX11 yes

---------------------------------------
On your linux (fedora core 3) box you've done xhost +

---------------------------------------------
Interestingly, the problem for non-root users does not occur while launching HP-UX's X based program from Mandrake Linux. FC3 and SuSe showed the same behavior.

:)
Ermin Borovac
Honored Contributor

Re: ssh with X11 for non-root user

>>> Error: Can't open display: >> m/c:0.0>

ssh by default assigns DISPLAY to a number starting with 10 (10.0, 11.0 etc). Check user's profile on HP-UX system to make sure that DISPLAY is not hardcoded to :0.0.

Since you are ssh'ing from a Linux system that's where you should modify ssh_config. Set ForwardX11 to yes in /etc/ssh/ssh_config on the Fedora system. You don't need to use xhost if you are using ssh.
Rahul Sharma_4
Advisor

Re: ssh with X11 for non-root user

:) well i discovered that there was no home directory created for the user for whon i was trying ssh -X so the autorization files were not being created. BY siply creating the home directory this was resolved!