![](https://seccdn.libravatar.org/avatar/51ec7cc9d995ca9f604ff1301e1e0dc0.jpg?s=120&d=mm&r=g)
Hi guys! Please excuse me if this question has already been asked and solved -- I don't have much time to read through the archives. At any rate, whenever I use a terminal or shell (it doesn't matter which), and switch users to root, I get the following error whenever I try opening any type of file using emacs: linux:/usr/local/pmfirewall # emacs pmfirewall.rules.masq Xlib: connection to ":0.0" refused by server Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison) emacs: Cannot connect to X server :0. Check the DISPLAY environment variable or use `-d'. Also use the `xhost' program to verify that it is set to permit connections from your machine. The same thing happens even when I try to use some programs, like xkill: linux:/usr/share # xkill & [1] 10141 linux:/usr/share # Xlib: connection to ":0.0" refused by server Xlib: Invalid XDM-AUTHORIZATION-1 key (failed key comparison) xkill: unable to open display ":0" linux:/usr/share # The funny thing is that *sometimes* emacs and other programs will work, but most of the time they will not. Everything works perfectly fine when I am a regular user, the problem only occurs while root. Does anyone have any clues, suggestions, tips, solutions? Please let me know. Thank you to anyone who responds. --Chris