Solved

startx question

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pauing printer deamon in AIX 10 63
reinstall 1 85
Move nodes from one TSM to another. 3 89
Linux : taking backup different mount points under the same directory 8 88
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…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
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…

820 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