This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Run a GUI Programm aus root

Tags: None
(comma "," separated)
User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS
Hello

I like to run a programm with an gui interface as root while I am logged in as a normal user. Ok this is not problem generally. But ...

I tried sudo and also su -c and finally since I am running KDE 4.2.3 I created an Desktop Icon an attached the attribute run as root. I think I tried kdesu but I can not confirm or test with in the next 12 hours.

Well, all methods end up with an icon in the taskbar but when I right click the icon and like to "start" the program nothing (visible) happens.

This works fine as long as I do NOT run as "root".

I assume a problem with the display variable but I could not fix it and beside this -- I might be wrong.

How ever has anyone an ideas to run the desktop as root and get the GUI on the normal user screen


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
It depends on what kind of GUI application. Some may be dependent upon desktop features, and will likely print error messages to the console if run from there.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS
Well when I run aus root from consol I get the message that this application can only run with gnome and kde.

This might lead to the assumption that this also happens when I klick the icon on the desktop... basically the propgramm does not find something what it is looking for and does not detect KDE... Hm what todo?

In the past I could often use the command "sux - " to login as root with GUI. What would be a valid replace? Could be worth a try.

Michael


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You could try using "dbus-launch " as root. Try using "kdesu" to get it to run as root.
What is the name of the application in particular?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS
It is the adrive desktop -> www.adrive.com
which is actually an adobe air application

Michael


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
It is likely that the ADrive desktop uses the Encrypted Local Store feature of Air, which requires KWallet or Keyring (GNOME) to be available, thus it will not start without one available.

You could try using dbus-launch as recommended above, or alternately you could try making a set SUID script which would function under your normal user but have root privilages.
Such a script would look normal except it would be owned by root and setuid as part of its permissions.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS

[SOLVED] Run a GUI Programm aus root

Thu May 14, 2009 10:35 am
bcooksley wrote:You could try using dbus-launch as recommended above, or alternately you could try making a set SUID script which would function under your normal user but have root privilages.
Such a script would look normal except it would be owned by root and setuid as part of its permissions.


Thanks a lot,

What would the syntax for dbus-launch look like?

Concerning the script:
would it be enought to setuid for the programfile which I execute right now or do I need to a script which justs start the programfile and the script has the setuid? actually where would the difference be?

Michael


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS
Hello

you are correct this is from the adobe page:

Encrypted Local Store
* Local store data cannot be accessed when session is exported using SSH or when session is changed to another user using su.

Unfortunately neither suid nor dbus-launch as root helped -- so at this point I have no more ideas, do you?

Michael


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
User avatar
google01103
Manager
Posts
6668
Karma
25
@bushveld as you're using kde you could open a second session (using switch user) as root and toggle between sessions (alt+ctrl+F8) or maybe even krd into it?


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS
Hello,

well I though of this and I tried an surprisingly I can run the program and I get the taskbar icon but nothing else. Also I am not really happy to run root as gui ..

Michael


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Is there any particular reason why you need to run the application as root?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS
Yes, there is: I like to sync my data starting at / to an online storage.

Michael[/align]


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --
User avatar
Ahmad Samir
Registered Member
Posts
127
Karma
0
OS
Did you try:
su - -c

or
su -
HMC
Registered Member
Posts
4
Karma
0
OS
Try sudo when starting a graphical app from a console.

Or... If you have to run as root, create a menu item or a *.desktop file to run as a different user.

Cheers
User avatar
bushveld
Registered Member
Posts
174
Karma
0
OS
NOP

this is from the adobe page su, su -, or all the other options (and there are plenty) fail due to this reason:

Encrypted Local Store
* Local store data cannot be accessed when session is exported using SSH or when session is changed to another user using su.

There seems to be no solution as long as Adobe does not "fix" it.

Michael


openSUSE 11.2 and KDE 4.4.0 -- Vita brevis! --


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, mickae, Sogou [Bot]