Solved

startx question

Posted on 2001-08-29
6
540 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now