Getting "cannot connect to xserver" with sudo

Hi,

when I open bash and enter the following:-

sudo kwrite /etc/fstab

I get the following error:

kwrite: cannot connect to X server

This happens for anything opened with sudo, does anyone perhaps know of what is wrong? This is a new installation of openSUSE 11.1

Many thanks

Paul

Try the following command instead:
kdesu kwrite /etc/fstab

Hi
Try kdesu kwrite /etc/fstab. Maybe it’s a good time to learn vi or
vim :wink:


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.1 x86 Kernel 2.6.27.7-9-default
up 18:31, 2 users, load average: 0.06, 0.09, 0.08
GPU GeForce 6600 TE/6200 TE - Driver Version: 180.22

thanks that worked a treat :slight_smile:

I will take a look at vi and vim as well.

Paul

I used to could use sudo but now I also have to use this kdesu. What could have changed in my system?

I used to could use sudo but now I also have to use this kdesu. What could have changed in my system?

That may have been the case a few versions of openSUSE ago, but not now. In general, for graphical KDE/QT applications (requiring root privileges), kdesu <name of app> is used.

man kdesu

Alternatively, you can do

su -

then

kwrite