Operating System - HP-UX
1751710 Members
5304 Online
108781 Solutions
New Discussion юеВ

xclock not working with oracle user or any other normal user.

 
Anubhav Dhingra
Frequent Advisor

xclock not working with oracle user or any other normal user.

Hi,

I am using xmanager version 2.0, it works fine with root user.env parameter for root user from xterm window is as follows:
COLUMNS=80
WINDOWID=4194319
EDITOR=vi
LOGNAME=root
MAIL=/var/mail/root
SFTP_UMASK=
ERASE=^H
SFTP_PERMIT_CHOWN=1
USER=root
DISPLAY=localhost:10.0
SHELL=/sbin/sh
HOME=/
SSH_CLIENT=10.172.19.54 55284 22
SSH_CONNECTION=10.172.19.54 55284 172.36.1.56 22
TERM=xterm
PWD=/
TZ=WAT0
SFTP_PERMIT_CHMOD=1
LINES=24
------
# echo $DISPLAY
localhost:10.0

when i do su - oracle env output is follows:
COLUMNS=80
ORACLE_BASE=/oracle
LOGNAME=oracle
ORACLE_SID=prtp
ERASE=^H
SHELL=/sbin/sh
HOME=/oracle
LD_LIBRARY_PATH=/oracle/ora10g/lib:/usr/lib:/usr/local/lib
TERM=xterm
ORACLE_HOME=/oracle/ora10g
PWD=/oracle
TZ=WAT0
LINES=2

export DISPLAY=10.172.19.54:0.0
$ xclock
Error: Can't open display: 10.172.19.54:0.0

echo $DISPLAY
10.172.19.54:0.0

Please suggest the way forward...
13 REPLIES 13
Pete Randall
Outstanding Contributor

Re: xclock not working with oracle user or any other normal user.

After you set the DISPLAY, try setting "xhost +"


Pete

Pete
Anubhav Dhingra
Frequent Advisor

Re: xclock not working with oracle user or any other normal user.

Hi Peter,

i executed xhost +, it gives the error
xhost +
xhost: unable to open display "10.172.19.54:0.0"
Torsten.
Acclaimed Contributor

Re: xclock not working with oracle user or any other normal user.

When using an X tunnel via SSH, don't modify DISPLAY variable!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Anubhav Dhingra
Frequent Advisor

Re: xclock not working with oracle user or any other normal user.

Hi,
it doesnt work even if i dont set the DISPLAY variable
echo $DISPLAY

$ xclock
Error: Can't open display
TwoProc
Honored Contributor

Re: xclock not working with oracle user or any other normal user.

Check the security settings on the xmanager itself; which I presume is a Windows computer. That xmanager has security setttings; in there, you'll either need to allow access to all hosts (like an xhosts + command), or at least, to the host you are communicating to.
We are the people our parents warned us about --Jimmy Buffett
Steven Schweda
Honored Contributor

Re: xclock not working with oracle user or any other normal user.

> it doesnt work even if i dont set the
> DISPLAY variable
> [...]

That should not be amazing. DISPLAY needs to
be set to _something_ if you intend to use an
X display. If you use rsh/remsh or Telnet to
connect to the remote system, then it may
make some sense to set DISPLAY to something
like:
telnet_client:0.0
where "telnet_client" is the name or IP
address of the system with the X server. But
you're not doing that. You're using SSH.

If you use SSH to connect to the remote
system, (with the right options), then the
SSH server may set up X forwarding, and, if
it does that, then it will set DISPLAY to
some local-looking thing. like, say:
localhost:10.0
and then forward X stuff sent to it back to
the real (remote) X server.

> when i do su - oracle [...]
> [...]
> export DISPLAY=10.172.19.54:0.0

That's probably not a good plan. Your SSH
connection has set up (nice, secure) X
forwarding, and now you're bypassing it.
(And, I'd guess, you didn't do anything at
your X server to allow this remote system to
use it.)

I don't do this stuff, so I know nothing, but
I'd suggest avoiding the whole "su - oracle"
thing, and connecting directly using
something equivalent to "ssh -l oracle",
instead of connecting as user "root" and
_then_ trying to become user "oracle".
Otherwise, you could try setting DISPLAY for
"oracle" to the same thing that the SSH
server set it to for "root"
("localhost:10.0"), but I wouldn't bet on
that working, because "oracle" probably
doesn't have permission to use that X server.
You might try that "xhost +" before you do
the "su - oracle", but I wouldn't bet on
that, either. But you could get lucky.
Anubhav Dhingra
Frequent Advisor

Re: xclock not working with oracle user or any other normal user.

Hi
I tried using directly oracle in xterm instead of login as root and su'ing... but it doesnt login even... not sure if oracle user is authorized to login as xterm...
Steven Schweda
Honored Contributor

Re: xclock not working with oracle user or any other normal user.

> [...] not sure if oracle user is authorized
> to login as xterm...

You don't log into anything "as xterm". We
non-psychics can't see what you're seeing, or
what you're doing, or where you're sitting,
or much else about your environment.

> [...] which I presume is a Windows computer.

If we need to "presume", then you're not
telling us enough. As usual, showing actual
commands with their actual output can be more
helpful than vague descriptions or
interpretations.

If you can't do an SSH as user "oracle", then
perhaps you should work on that problem. If
this was set up properly for "root", then it
should be possible to do it for any other
user, too.
V. Nyga
Honored Contributor

Re: xclock not working with oracle user or any other normal user.

Hi,

set 'xhost +' after login in as root before 'su - oracle'

V.
*** Say 'Thanks' with Kudos ***