You are not logged in.
Pages: 1
I reinstalled my sistem recently, got it up and running and when I tried to run kwrite or any other application that has gui (for example jacman) I receive the same error:
[root@lightbringer dheart]# kwrite
No protocol specified
kwrite: cannot connect to X server :0.0
[root@lightbringer dheart]#
Running GUI applications with sudo is fine, though jacman fails to start with sudo.
However I got used to run kwrite/gedit as root in order to edit my system preferences and I'd like to be able to do so again.
Any suggestions?
My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...
Offline
Try running "xhost +" from your regular user account, then run the application as root. If it works, you can put the command in your ~/.bashrc
Offline
Thanks! Now it works!
My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...
Offline
Try running "xhost +" from your regular user account, then run the application as root. If it works, you can put the command in your ~/.bashrc
For the record, this is bad advice. Please don't do this.
Running GUI apps as root *shouldn't* be common place.
Offline
XAUTHORITY=/home/<your-non-root-user>/.Xauthority kwrite
Try that.
1000
Offline
Running GUI apps as root *shouldn't* be common place.
I'm inclined to disagree -- if your preferred editor is a GUI app (as mine is), why should you use VIM, emacs, nano, or siblings to edit /etc/rc.conf?
Its true that GUI apps are more complex than command-line apps, and complexity can hide security flaws that might mean if you're using a GUI app as root there's a hypothetical possibility someone can gain control of your root account that wouldn't happen with a console app. Is there a documented case of this happening or is it just paranoia/FUD?
Having said that, running 'xhost +' is insecure, it can allow X connections from external systems (they'd have to know your root or user password though). Try 'xhost + localhost' instead to prevent this possibility.
Dusty
Offline
If you're in KDE, just use kdesu. It will allow you to launch GUIs as root from within the user account:
kdesu kwrite
Offline
gksu and gksudo do the same thing for gnome/gtk systems.
Dusty
Offline
@Dusty: thanks for the security advice, changed my .bashrc.
@skottish: I have kdemod installed, but I only use a few application (kwrite, kite, k3b). I'm running openbox and kdesu and gtksu are out of question (They output tons of errors that something isn't running and start slow (especially gtksu).
Besides I got used using gedit for editing sistem preferences.
@phrakture: As Dusty said it's a matter of choice - some prefer command line editors, other - GUI editors. And besides: Linux is secure enough and not to run a GUI text editor because of a theorical hole in it is something really really paranoic...
My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...
Offline
ssh -X -Y -C root@localhost
does the job. What's wrong with gedit-ing your /etc/whatever?
Somewhere between "too small" and "too large" lies the size that is just right.
- Scott Hayes
Offline
Having said that, running 'xhost +' is insecure, it can allow X connections from external systems (they'd have to know your root or user password though).
They don't even need a password if you have done 'xhost +', but this isn't that big a risk if you are behind a firewall (on a secure network where you trust the other users), and even less of a risk if X is set not to listen to TCP connections (as is default with KDM)
Try 'xhost + localhost' instead to prevent this possibility.
This won't work if X is set not to listen to TCP connections, but 'xhost +local:' will work.
Offline
@phrakture: As Dusty said it's a matter of choice - some prefer command line editors, other - GUI editors.
I never said it wasn't a matter of choice - I'm just saying that it shouldn't be recommended as the first way to do this. "How do I run GUI apps as root?" should probably be questioned as to why these apps can't run as a normal user _first_.
Offline
Pages: 1