Run kde apps as superuser?
Can I start kwrite as superuser from kde?
I try to run it from xterminal (after su -l) but I only get an error message:
Cannot connect to xserver
I wonder why, since so far as I remember I could do this in Blackbox.
did you try to go to under k menu, run application and start kwrite from there? but that wouldn't start the app in super user mode though...you can just log in as root and run it but i am sure there are other&better ways to do it...
i would recommend you not to use the root login to often
too dangerous to fuck it all up. Almost everyone uses a 'user' login here..
but if you don't believe then you'll just learn it the hard way ;)
but as pointed out, using root for gui apps is rare.
FYI, the reason you get that error is because only the user you logged in as can display things to the screen normally unless you do some security related stuff.
.Xauthority is the key
Dear J_Szucs: before using my script below consider whether it is in fact necessary for you to use kwrite. There are many text-only replacements (e.g. editor) which support basic text editing too.
newbieME: i am sorry, but your suggestion to logon KDE directly as root is among the worst as this completely exposes the system when most of the time a simple su will do.
personal recommended solution: below you find a shell script which is fairly simple and does not compromise on your system security. I named it mysu to make it clear that it is not the simple su command, though one could alias it to replace the su command. The script has to be placed in any directory included in $PATH and must me marked executable (e.g. chmod a+x mysu)
# script allowing su to access X-server from logged-in non-root user
# for feedback (i am really a newbie) email@example.com
# point $XAUTHORITY to current user's .Xauthority file
# .Xauthority stores authorization keys for X-system of current user
# $XAUTHORITY is an environmental variable pointing to the file
# containing keys. If it doesnt exist X defaults to $HOME/.Xauthority
# let new processes inherit environment variable $XAUTHORITY
# login as superuser (su)
# remove "export attribute" from $XAUTHORITY
export -n XAUTHORITY
I hope this helps,
. Mischa Altmann
Here's how I do it on KDE:
alt+F2 gets me a RunCommand dialog. I can enter "kwrite" as the program to run, then expand the Options and choose "Run as a Different User," username is 'root' and enter the password for that user. Now I'm in kwrite with root permissions. I can't think of any reason why this would make problems.
|All times are GMT -5. The time now is 01:06 PM.|