Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to open a file named tester.php from gedit by logging in as root, I see this :

[root@Feddy htdocs]# gedit tester.php

(gedit:4310): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported

** (gedit:4310): WARNING **: Could not connect to session bus

What is this message and why do I get this ?

NOTE: I am able to open the file by the same command

gedit tester.php

when I act as a regular user. (i.e not root)

share|improve this question
up vote 2 down vote accepted

By default, and for security reasons, the only user that interacts with X-server is the logged-in user. Meaning, You can not initiate a connection to x-server as a different user or in your case as root, unless you have overridden the default setting to allow different users/hosts to connect to x-server. So the error message you are getting is related to x-server since any other user can't connect to it. In order to get around it, you have various fixes you can apply. What I normally do when ever I need to run an X-app as root is as follows.

  • From normal user terminal, I run xhost + to grant access to all user temporarily
  • Then I log in as root from a different terminal and execute the X-app ie gedit tester.php

To make it permanent (which I don't suggest), edit /etc/profile and add the following line:

export XAUTHORITY=/root/.Xauthority
share|improve this answer
The same message..Here is a shot of what I did – Suhail Gupta Jan 9 '13 at 10:34
instead of su do su - – WeloSefer Jan 9 '13 at 15:58
yeah it worked ! Thank you. Can you please tell me the difference between su and su - – Suhail Gupta Jan 26 '13 at 7:20
also is there any time duration till I will be able to open a file directly from terminal as root ? – Suhail Gupta Jan 26 '13 at 7:23
The use of the hyphen "-" forces the new shell connection to run with adjustment of variables environment and all the default settings according to user preferences. – WeloSefer Jan 26 '13 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .