![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Invalid MIT-MAGIC-COOKIE-1 key and cannot open display: :0.0
Submitted by Easy Tofu on Sun, 06/05/2011 - 16:03
If you arelogged in as a normal user and are attempting to launch any application that requires root permission and the application does not show up after you give permission. The issue you may be experiencing maybe related with xauth/xhost. The xhost program is used to authorize remote hosts and user names that can make connections to your X server. The xauth program is used to display and edit authorizations that you have that is used to connect to your X server.
An example of error that may be shown to you if you run an application that requires root permission and after you enter your password it may simply disappear:
A possible solution to the above problem is to enter the following command as a normal user:
xhost local:root
After you enter the above command you can go ahead and launch whatever application you were attempting to launch. Once the prompt for root permission is needed you can enter your root password. After you hit enter the application should appear.
An example of error that may be shown to you if you run an application that requires root permission and after you enter your password it may simply disappear:
Invalid MIT-MAGIC-COOKIE-1 key
(synaptic:3245): Gtk-WARNING **: cannot open display: :0.0
A possible solution to the above problem is to enter the following command as a normal user:
xhost local:root
After you enter the above command you can go ahead and launch whatever application you were attempting to launch. Once the prompt for root permission is needed you can enter your root password. After you hit enter the application should appear.
- Log in to post comments
You can also add it to .bashrc to get executed after login.
Code:
echo "xhost local:root > /dev/null" >> ~/.bashrc
http://ubuntuforums.org/showthread.php?t=1014700&page=2
http://www.mepis.org/docs/en/index.php?title=XHost_errors_when_trying_to_run_programs_as_root
http://www.leidinger.net/X/xhost.html
...
Quote:
I don't have /root/.bashrc (nor /home/root/.bashrc). I'm using Debian etch. What could I do? |
You can create it with just that one line that was suggested for this problem:
Code:
export XAUTHORITY=/home/name/.Xauthority
This means you, as the administrator of your computer, get to decide what all goes in them. Typically, users would decide what goes in their own $HOME/.bashrc and $HOME/.bash_profile - most likely that is also you. My main point is that they are there for your convenience, rather than being some untouchable and necessarily mysterious file of the "us mortals shall not touch" category.
This link explains more clearly the difference between these different files: http://www.linuxquestions.org/questi...bashrc-273992/
Note: $HOME refers to your home directory, for example it might be /home/kiel2155/.bashrc
http://www.linuxquestions.org/questions/linux-software-2/xlib-connection-to-0-0-refused-by-server-331779/