If I su to root in a terminal, and try to edit a file using emacs, I get the following error:
Xlib: connection to "X0.0" refused by server Xlib: client is not authorized to connect to server emacs: cannot connect to Xserver :0. Check the DISPLAY environment variable or use '-d'
It's OK is I log in as root, or as a user, it only has the problem when I su. (This error occurs with any program that uses X). Obviously this is a real pain as I am having to log in as root... which is less than desirable! Any ideas?
Ricardo
Hi Ricardo
Use "su -" or "su -m" instead.
Regards, Paul.
On Tuesday 04 Jun 2002 10:32 pm, Ricardo Campos wrote:
If I su to root in a terminal, and try to edit a file using emacs, I get the following error:
Xlib: connection to "X0.0" refused by server Xlib: client is not authorized to connect to server emacs: cannot connect to Xserver :0. Check the DISPLAY environment variable or use '-d'
Ricardo Campos wrote:
If I su to root in a terminal, and try to edit a file using emacs, I get the following error:
Xlib: connection to "X0.0" refused by server Xlib: client is not authorized to connect to server emacs: cannot connect to Xserver :0. Check the DISPLAY environment variable or use '-d'
You can use sudo and get around this (i.e. "sudo emacs <filename>"). I use this most of the time when i need to run a program that uses X as root, but sometimes it's easier to su to root fully. I've been doing "xhost +localhost" up till now, but Paul's idea of "su -m" works as well ("su -" didn't tho, still got the error).
Andrew