PDA

View Full Version : terminal as root for editing-no good



pgk3734
06-27-2004, 03:59 AM
In a terminal, I try to open kedit or kate, whatever, to edit a file such as /etc/apt/sources.list and get this:

root@knopbox:/home/dpucci# kedit /etc/apt/sources.list
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

kedit: cannot connect to X server :0.0

Consequently I must open kedit as root and then hunt for the file to edit, etc.

What gives? Any help would be appreciated. I also use Mandrake with no problem, but I
prefer Knoppix/Debian.

Using Knoppix v. 3.4.

Markus
06-27-2004, 11:00 AM
You could use a console editor for editing as root. If nano is included in 3.4 it's a lot easier to use than vi (which isn't that difficult either), you could allways apt-get nano if it isn't included.
Other than that you can do: ln -s /home/dpucci/.Xauthority /root/.Xauthority to be able to run kdeapps as root.
Or do as user: kdesu kedit /etc/apt/sources.list which I think is the preferred way nowadays.

mzilikazi
06-27-2004, 03:14 PM
root doesn't have access to the Xserver. Issue this as user:
xhost local:

Markus
06-27-2004, 03:26 PM
root doesn't have access to the Xserver. Issue this as user:
xhost local:
Thanks! Googled the $£&% out of this one once, didn't find your solution which is quite functional.

pgk3734
06-27-2004, 07:51 PM
Thank you gooroo of the CLI and bash mzilikazi!!!!
I am trying to learn to be more effeicient with the cli and bash.
Any tutorials you'd recommend?
Thanks again
pgk