?
Solved

console ownership

Posted on 2005-03-06
12
Medium Priority
?
647 Views
Last Modified: 2013-12-27
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.
0
Comment
Question by:akaodin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
12 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 13474435
" RedHat 9.0 on an Intel Pentium 4"

Is it supported ???
RH 9 is old try Fedora Core 3
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 13500758
> " 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
0
 

Author Comment

by:akaodin
ID: 13526537
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 62

Expert Comment

by:gheist
ID: 13526549
You should use display manager and make it log you in. Too much permissions can be of problem too.
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 13527254
> 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
0
 

Author Comment

by:akaodin
ID: 13529592
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.
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 13540247
> 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
0
 
LVL 62

Expert Comment

by:gheist
ID: 13542050
But does it hang on second time when you startx as odin ???
0
 
LVL 38

Expert Comment

by:wesly_chen
ID: 15713820
Please reset the point to 0 and don't delete the question.
There are some good information provided by experts.
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 15749508
PAQed with no points refunded (of 250)

DarthMod
Community Support Moderator
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question