Solved

startx question

Posted on 2001-08-29
6
535 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
Comment Utility
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
Comment Utility
.. or do a
     xhost +
before su - userSOMEONE
(keep security in mind: man xhost)
0
 
LVL 5

Expert Comment

by:garboua
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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 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…
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…

772 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

13 Experts available now in Live!

Get 1:1 Help Now