Link to home
Start Free TrialLog in
Avatar of akaodin
akaodin

asked on

console ownership

Hi,
   I am running RedHat 9.0 on an Intel Pentium 4.  When I log in as Odin (a user account) I have no trouble starting the X Windows environment w/ 'startx'.  However, when I log in as Root the screen blanks, the mouse X appears and that is all that happens.  ie. X Windows does not appear. (the mouse is active).  When instead I switch from Root to Odin as 'su - odin', then I get the Fatal server error: 'PAM authentication failed, cannot start X server.'  Moreover, it could not find 'xinit' which may be the problem.  When I am Odin and 'which xinit' I get /usr/bin/X11/xinit, when I am Root and 'which xinit' I get /usr/X11R6/bin/xinit.

    I have tried in Odin export DISPLAY=:0.0, but when I try 'xhost +' I get
        'xhost: unable to open display ":0.0"
I would like to know why I cannot startx from Odin when I su from Root.  Pls advise.  Thx.
Avatar of gheist
gheist
Flag of Belgium image

" RedHat 9.0 on an Intel Pentium 4"

Is it supported ???
RH 9 is old try Fedora Core 3
> " RedHat 9.0 on an Intel Pentium 4"
Yes, RedHat 9 can run on P4 without problem.

This is the issue of tty.
When you login as root, say you use tty1 (who -m). Then you "su - odin", and do "who -m".
You will see "root" on tty1 even though "whoami" tell you that you are "odin".

So startx use the tty while you login (as root) and find out you have no permission to change the file in
~root/.Xauthority when you "su - odin".

The easy way is change /etc/inittab from
id:3:initdefault:
to
id:5:initdefault:
And reboot.

So it will boot as graphic mode without typing "startx".

Regards,

Wesly
Avatar of akaodin
akaodin

ASKER

Hi,
   Actually, I would like to set up one user account which automatically boots into Xwindows, but lets all other accounts boot into command prompt.  I did try changing the permissions on /root/.Xauthority from RW------- to RWXRWXRWX.  Still got the PAM authorization error.  When I login to the odin account I want to begin as command prompt. Any other suggestions.  Thx.
You should use display manager and make it log you in. Too much permissions can be of problem too.
> I would like to set up one user account which automatically boots into Xwindows, but lets all other accounts boot into command prompt.

    Say that user account called "u1", who will boot into Xwindow. Assume the default shell for that user is sh or bash.

    Edit /etc/profile  (assume the account default shell is bash/sh shell) and add
---
USER="`id -un`"
# check login username #
CURRENT_DATE=`date +%Y%m%d`
if [ $USER = "u1" ]   ## the account1 may vary
then
   startx
fi
....
-------

So, the default runlevel is 3 and the user "u1" login in will run "startx" immediately.

> /root/.Xauthority from RW
If you login as odin and "su - " to root, then root has no problem to run "startx" since root account can bypass all the authentication
limitation. tty is hard to manuplate as regular user.

Wesly
Avatar of akaodin

ASKER

Hi,
  Not really:
If you login as odin and "su - " to root, then root has no problem to run "startx" since root account can bypass all the authentication
limitation. tty is hard to manuplate as regular user.

When I try it my system hangs w/ a blank screen and the mouse X in the middle.  It's not a bad hang because I can Ctrl-Alt_Backspace and return.  Yet the log file doesn't show any errors.

When I log in as root and su - odin, then I get a PAM authentication failure.  I am sure there is something wrong somewhere, but I know not what it is.  Pls advise.  Thx.

By the way Wesly, your trick w/ the startx in the /etc/profile did work.  Thx.
> When I try it my system hangs w/ a blank screen and the mouse X in the middle.
I tested with my system and the startx worked for "su -".

Besides, "su -" is not hang with PAM authenication failure on your case, either.

tty is the key role for graphic display on Xwinidow.
I don't know how to work around on it.

Wesly
But does it hang on second time when you startx as odin ???
Please reset the point to 0 and don't delete the question.
There are some good information provided by experts.
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial