Solved

startx question

Posted on 2001-08-29
6
548 Views
Last Modified: 2013-12-27
Hi, I am using RedHat Linux 6.2, the following is the problem:

(1) At the server console, I login as root
(2) Then I "su - userSOMEONE" to switch to "userSOMEONE"
(3) Then I "startx" to start the X-window, but I got this error
        Authentication failed - cannot start X server.
        Perhaps you do not have console
ownership?_X11TransSocketUNIXConnect: Can't connect: errno = 111
        giving up.
        xinit:  Connection refused (errno 111):  unable to connect to X
server
        xinit:  No such process (errno 3):  Server error.

However, if I "startx" after step (1), where login as root, the error won't
appear and X-window starts normally.

Does anyone have this experience? Did I missed some settings?
Thanks in advance.
0
Comment
Question by:eleungks
[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
6 Comments
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 6440492
It's behaving the way it is supposed to. When you log in as root, the system gives ownership of the console to root. As a security measure X will fail if the user that starts it isn't the same user that owns the console.

The solution is to log onto the console as the user, not as root, and then start X. If you need root privs later during that session, simply su to root.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6442737
.. or do a
     xhost +
before su - userSOMEONE
(keep security in mind: man xhost)
0
 
LVL 5

Expert Comment

by:garboua
ID: 6464050
I agree with jlevie,you should always log with a generic account, and you can always su to root when needed.
0
 
LVL 1

Expert Comment

by:bearware
ID: 6813452
xhost is not the issue, the other stuff looks correct to me. If there is a good reason to login as root then change. I cant imagine why. Then change the ownership of the console.

Hooky workaround:
Find the console name. (tty?)
as root type:
chown userSOMEONE /dev/tty?
su userSOMEONE
0
 

Expert Comment

by:CleanupPing
ID: 9090221
eleungks:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

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!

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…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

751 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