English
Ask Your Question
4

no gksudo? so just su or sudo then?

asked 2012-12-03 17:33:08 +0000

lenrev gravatar image

Hi, I'm a Fedora newbie, I'm trying to run some applications with GUI as root and for that I've gotten used to typing 'gksudo [command]'.

My question is how to run an app with GUI as root without using gksudo?

please help me, I just don't want to go back to Ubuntu.

edit retag flag offensive close merge delete

Comments

Can PolicyKit be a total replacement for sudo?

q2dg ( 2014-01-29 19:04:21 +0000 )edit

5 answers

Sort by » oldest newest most voted
0

answered 2012-12-03 18:00:00 +0000

sten gravatar image

Fedora doesn't have gksudo, because it uses PolicyKit instead. The short answer to your question is, yes, use sudo.

The long answer is, if you'd rather have a GUI prompt, either you or the maintainer of the application you want to run can implement PolicyKit rules. Docs start here: https://live.gnome.org/PolicyKit

edit flag offensive delete link more

Comments

Probably not! What are you actually trying to do?

randomuser ( 2012-12-13 15:14:22 +0000 )edit
3

answered 2012-12-03 18:34:51 +0000

hhlp gravatar image

Beesu is a wrapper around su and works with consolehelper under Fedora to let you have a graphic interface like gksu

Instalation

sudo yum install beesu
edit flag offensive delete link more

Comments

It helped me with another question that took me sometime to solve. How to create a Shortcut [Desktop Entry] to open as root! Thanks a lot!

Danielson Júnior ( 2016-02-16 13:24:02 +0000 )edit
3

answered 2014-01-29 10:13:53 +0000

Dennis gravatar image

i found a PolicyKit alternative called pkexec

usage is

pkexec [--user username] PROGRAM [ARGUMENTS...]
edit flag offensive delete link more
1

answered 2016-01-05 05:57:44 +0000

The thing is that if you want to run as root a graphical application you have 2 ways:

1.- Open the terminal and type:

$ sudo app_name

or

2.- Add a policy kit rule:

In /usr/share/polkit-1/actions you have to create a xml file with the information about the application you want to run with privileges. In my case I wanted to run glogg cos I need to open system log files and had to be root for that.

After you create the xml file you have to edit the .desktop file in /usr/share/applications, adding before the binary name, the pkexec command.

That's all. Then you've got your application asking for root password.

For glogg I create this XML, named org.freedesktop.policykit.pkexec.glogg.policy (path: /usr/share/applications/)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

    <vendor>Nicolas Bonnefon</vendor>
    <vendor_url>http://blog.bonnefon.org/</vendor_url>

    <action id="org.freedesktop.policykit.pkexec.glogg">
    <description>Run glogg with elevated privileges</description>
    <message>Authentication is required to run glogg as root</message>
    <defaults>
      <allow_any>auth_admin_keep</allow_any>
      <allow_inactive>auth_admin_keep</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/glogg</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
  </action>

</policyconfig>

And the glogg.desktop file (path: /usr/share/applications):

[Desktop Entry]
Name=glogg
GenericName=Log file browser
# %f because glogg supports only one file for now
Exec=pkexec glogg %f
Icon=glogg
Type=Application
Comment=A smart interactive log explorer.
Terminal=false
Categories=Qt;Utility;TextTools;Development;
MimeType=text/plain;
Actions=Session;NewInstance;

[Desktop Action Session]
Exec=pkexec glogg --load-session %f
Name=Open With Previous Session

[Desktop Action NewInstance]
Exec=pkexec glogg --multi %f
Name=Open In A New glogg Window
edit flag offensive delete link more
0

answered 2012-12-03 17:40:59 +0000

ThomasMcA gravatar image

I recently switched from Kubuntu to Fedora XFCE, and I use kdesu in my GUI shortcuts. To find out if you have kdesu, run which kdesu in a console. If it returns a path (like /bin/kdesu) then kdesu will work on your system.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Stats

Asked: 2012-12-03 17:33:08 +0000

Seen: 16,492 times

Last updated: Jan 05