0

I am using Debian 7, and my desktop is xfce. I want to achieve managing any command on Linux. For example, executing /usr/bin/xfce4-taskmanager command would not require sudo privileges so any user can execute it. But I want to give privilege to user for taskmanager command. How can I achieve this?

I researched on Internet and found polkit (PolicyKit). Polkit has predefined actions and you can write rules for this actions. So I prepared custom action for taskmanager command. When I had executed pkexec /usr/bin/xfce4-taskmanager on console, I saw the message which I prepared before, but it is not solving my problem. I don't want to use pkexec.

I saw an action class prepared for gparted command. When I click gparted menu item from desktop with normal user, it is not opening because normal user does not have privileges. I changed access privilege and clicked again, and gparted opened successfully.

How can I write action like gparted? There is no documentation enough. Or is there another way to achieve this? Can I give sudo privilege to a command which is not have sudo privilege?

  • I did not fully understand, what you want to achieve. However, I think setuid (en.wikipedia.org/wiki/Setuid) might be worth looking at. Note, that this can be a security issue and you should know what you're doing when you want to use it. – xwst May 12 '15 at 18:47
  • Thnks for reply Stephan. My first aim is running polkit (PolicyKit) truly. This link wiki.archlinux.org/index.php/Polkit says create an action, and this action id will send to DBus, then what will happen ? Here github.com/herzi/polkit-dbus-example an example of usage with dbus but he creates own command. My question is how can create a custom polkit action for already available command on system and how can I manage it user-based. – ibasaran May 13 '15 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.