xclock not working with oracle user or any other normal user. (2855 Views)
Reply
Frequent Advisor
Anubhav Dhingra
Posts: 95
Registered: ‎02-18-2008
Message 1 of 14 (2,855 Views)

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...
Outstanding Contributor
Pete Randall
Posts: 16,205
Registered: ‎11-03-1996
Message 2 of 14 (2,855 Views)

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

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


Pete

Pete
Frequent Advisor
Anubhav Dhingra
Posts: 95
Registered: ‎02-18-2008
Message 3 of 14 (2,855 Views)

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"
Acclaimed Contributor
Torsten.
Posts: 23,393
Registered: ‎10-02-2001
Message 4 of 14 (2,855 Views)

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!   
Frequent Advisor
Anubhav Dhingra
Posts: 95
Registered: ‎02-18-2008
Message 5 of 14 (2,855 Views)

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
Honored Contributor
TwoProc
Posts: 2,202
Registered: ‎01-11-1999
Message 6 of 14 (2,855 Views)

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.
"[That boy] is about as sharp as a sack of wet mice" - Foghorn Leghorn
Honored Contributor
Steven Schweda
Posts: 9,091
Registered: ‎02-23-2005
Message 7 of 14 (2,855 Views)

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.
Frequent Advisor
Anubhav Dhingra
Posts: 95
Registered: ‎02-18-2008
Message 8 of 14 (2,855 Views)

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...
Honored Contributor
Steven Schweda
Posts: 9,091
Registered: ‎02-23-2005
Message 9 of 14 (2,855 Views)

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.
Honored Contributor
V. Nyga
Posts: 4,874
Registered: ‎09-20-2002
Message 10 of 14 (2,855 Views)

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 ***
Advisor
PM Srividhya
Posts: 33
Registered: ‎02-14-2007
Message 11 of 14 (2,852 Views)

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

Hi,

I assume your local PC IP as 10.172.19.54,
try setting DISPLAY=10.172.19.54:10.0 after su to oracle.

Your profile shows display is set to localhost:10.0

- Vidhya

Honored Contributor
Alex Glennie
Posts: 4,068
Registered: ‎05-07-2000
Message 12 of 14 (2,852 Views)

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

As X has 2 forms of access :

host and user based and you are su ing to Oracle my guess is this is connected with the .Xauthority file in which case xauth -merge ?
Email : alex_glennie@hotmail.com
Acclaimed Contributor
Torsten.
Posts: 23,393
Registered: ‎10-02-2001
Message 13 of 14 (2,852 Views)

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

I assume you connecting from a PC to the server ...


I would just download "mobaxterm" to the PC, run it, "ssh user@..." to the server and start "xclock".

This will work.

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!   
Honored Contributor
Steven Schweda
Posts: 9,091
Registered: ‎02-23-2005
Message 14 of 14 (2,852 Views)

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

> This will work.

So, you must have missed this part?:

> I tried using directly oracle in xterm
> instead of login as root and su'ing... but
> it doesnt login even... [...]

Seems a bit optimistic in any case. Perhaps,
"could be made to work" would be more
accurate, but there's risk there, too.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.