Cannot open xwindows/xterm as a root


 
Thread Tools Search this Thread
Operating Systems AIX Cannot open xwindows/xterm as a root
# 1  
Old 01-27-2016
IBM Cannot open xwindows/xterm as a root

disabled the direct root login on all the AIX LPARs. So' only can become root by "su" to root from normal/regular user account.

Issue is, I cannot open xwindows (xterm or xming) from my LPAR as a root. But I can open/access Xwindows using a USER account.


Code:
[root@aixlpar]/>xclock
Error: Can't open display:

X11forwarding enabled in ssh config file.

i did checked online, found below post. But it did not help.
How to handle X11 Forwarding using SSH


As a work around, enabled direct login. and restarted the sshd. Then, it worked. (middleware team requested us to provide this capability, they need to upgrade something via installtion manager)

Please let me know, How can we access/open xwindows/xterm as root (when direct root login disabled).

Last edited by vbe; 01-27-2016 at 10:53 AM.. Reason: code tags.. not icode
# 2  
Old 01-27-2016
looks more like you didnt set your DISPLAY variable:
to confirm:
Code:
echo $DISPLAY

If empty , that is your issue...

This is waht it could look like when using ssh:
Code:
 $ echo $DISPLAY
localhost:17.0

# 3  
Old 01-27-2016
if you can start X11 applications using your own user, but not root, run the command from vbe's post (echo $DISPLAY) first as user, then as root and find the difference.
# 4  
Old 01-27-2016
Thanks for the reply vbe.

echo $DISPLAY

did not write anything. But, if you directly login using root. It automatically set DISPLAY to

localhost:12.0


I did tried after setting up DISPALY for root,
Code:
[user@aixlpar]/home/user>su - root
root's Password:
[root@aixlpar]/>bash
[root@aixlpar]/>echo $DISPLAY

[root@aixlpar]/>export DISPLAY=localhost:17.0
[root@aixlpar]/>echo $DISPLAY
localhost:17.0
[root@aixlpar]/>xclock
Error: Can't open display: localhost:17.0
[root@aixlpar]/>

---------- Post updated at 10:30 AM ---------- Previous update was at 10:28 AM ----------

@agent.kgb,

Thanks for the reply. I've tried using user and as a root. please see above post. still its an issue.

---------- Post updated at 10:44 AM ---------- Previous update was at 10:30 AM ----------

difference is here,

as user
[user@aixlpar]/home/user>echo $DISPLAY
localhost:10.0


as root
[root@aixlpar]/>echo $DISPLAY
# 5  
Old 01-27-2016
What's wrong with having to do a su to root?
I would not accept that either and would use sudo... because now you have a user who knows the root passwd...
As a user if you sudo as root, the DISPLAY variable follows also...

What you are trying to do might take time, as it was discussed years ago as a security breach : we used to block access to root except on console, but the rascals coul connect as root via X11...
I remember seeing it was corrected ( didnt try though...) but did not follow to see how/what was done...
That said here no middleware team has root access, e.g. when installing ORACLE , at a point they need to execute root.sh as root, they have to ask a sysadm to do that... They dont ask me because I want to see the script and analyse first what its doing...

oh about :
Code:
as root
[root@aixlpar]/>echo $DISPLAY

Is that a new ssh connection? if so its has another display affected...
But if its an ssh from a new xterm of the user e.g.
Here I did ssh n12...
Code:
n12:/home/vbe $ echo $DISPLAY
n12:/home/vbe $ export DISPLAY=localhost:17.0
n12:/home/vbe $ xclock&
[1]     8585272

and using sudo:
Code:
n12:/home/vbe $ sudo su
n12:/home/vbe $ id
uid=0(root) gid=0(system) groups=2(bin),3(sys),7(security),8(cron),10(audit),11(lp)
evian12:/home/vbe $ xclock&
[1]     6160640


Last edited by vbe; 01-27-2016 at 12:54 PM.. Reason: added using sudo...
# 6  
Old 01-27-2016
@Vbe

Thanks for the reply. here " user " am referring it to as a system admin who knows the root password.
and has the capabilities to do su - root using their USER ID's. root password is not shared to other regular/app/db users.

I agree with you. But here in this case, unfortunately middle ware software installed using root credentials. (by co-ordinating with UNIX team, not shared the password).

there is no need to enable X11 at all for root, if they can run/upgrade via command line option.
but, they want to go with GUI mode/Installation Manager option. (which needs browser/X11)

This particular test server does not have sudo. will isntall and try your suggestion.

Thanks for your time.
# 7  
Old 01-28-2016
Quote:
Originally Posted by system.engineer
difference is here,

as user
[user@aixlpar]/home/user>echo $DISPLAY
localhost:10.0


as root
[root@aixlpar]/>echo $DISPLAY
maybe it is not the best solution to your problem, but everytime you log in as a user, issue the command and look at the output.
Code:
[user@aixlpar]/home/user>echo $DISPLAY
localhost:10.0

Then, after you did su or sudo just the variable again to the value, you've observed earlier:
Code:
[user@aixlpar]/home/user>su - root
[root@aixlpar]/> export DISPLAY=localhost:10.0
[root@aixlpar]/> xclock

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

2. UNIX for Dummies Questions & Answers

xWindows error: xhost unable to open display

I am trying to direct a AIX display to my XWindows and I am at a dead end now! So this what I've done so far: 1. In putty settings, I set "Enable X11 forwarding" and also set "X diplay location" to "localhost:0" (without quotes, of course) 2. Via putty, connected to my AIX server 3. On... (1 Reply)
Discussion started by: shoefiend
1 Replies

3. Shell Programming and Scripting

How run simple command in xterm, and leave open?

I have written a simple script to show battery life remaining. I would like to be able to quickly view it with a predefined keybinding or launcher. xterm -e scriptname should do the trick but the xterm closes when the script finishes, not giving me chance to read the output. How can I keep... (3 Replies)
Discussion started by: spoovy
3 Replies

4. UNIX for Dummies Questions & Answers

Xwindows in unix

the question i have is why Xwindows(GUI) is not part of kernel level but part of user level in unix while in windows the GUI (Windows manager) it is part of kernel level. For one thing is when GUI hangs it does not crash the whole system as in Windows But windows avoids context... (0 Replies)
Discussion started by: sandesh.syr
0 Replies

5. UNIX and Linux Applications

How get root without local & with open port in server

hi all i have some question if any one can help me please How get root without local ? :( & How get root with open port in server use the telnet ? :( & How get root with Buffer Overflows ? :( please help me thanx to all (2 Replies)
Discussion started by: iis
2 Replies

6. UNIX Desktop Questions & Answers

Xwindows

i m working on a project of making linux boot and run from a pendrive. I have got a minimal root filesystem with busybox. I wish to install X Server now. I downloaded the source tar balls, untarred them on the host system, used the default host.def issued commands $make WORLDOPTS=-k World >&... (0 Replies)
Discussion started by: amu
0 Replies

7. Linux

Xwindows

i m working on a project of making linux boot and run from a pendrive. I have got a minimal root filesystem with busybox. I wish to install X Server now. I downloaded the source tar balls, untarred them on the host system, used the default host.def issued commands $make WORLDOPTS=-k World >&... (0 Replies)
Discussion started by: amu
0 Replies

8. SCO

I can't open a graphical session except for root

Hello , I've got a problem with my SCO 5.0.5 : When I try to open a graphical session with any user account (login/password) , I get a black screen then go back to the scosession window . For root account , there's no problem . Any idea ? Thanks . Regards (1 Reply)
Discussion started by: npn35
1 Replies

9. Linux

XWindows

I have written some Xwindows files would like to know how to compile them tried this command gcc -o main main.o -lXt -lX11 gives errors like could not find Xt & X11 help please (5 Replies)
Discussion started by: wojtyla
5 Replies

10. UNIX for Dummies Questions & Answers

XWindows Question

I have a pretty basic XWindows question. I'm using Linux and the BASH shell. I want to connect to a machine that is running a Java IDE (we currently have I think "SlickEdit" but we're probably going to download Netbeans, Eclipse) and view the IDE on the client machine. I tried "xhost +" on the... (5 Replies)
Discussion started by: doublek321
5 Replies
Login or Register to Ask a Question