Solved

startx question

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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
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.

627 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