LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-23-2015, 10:29 PM   #1
MrBumps
LQ Newbie
 
Registered: Aug 2014
Posts: 6

Rep: Reputation: Disabled
Polkit - Does it only work with a gui ?


Can I only use polkit with a gui ? Is there away to make it work with the command line ?

Thanks
 
Old 02-23-2015, 11:00 PM   #2
upthehill
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Rep: Reputation: Disabled
123

Last edited by upthehill; 02-23-2015 at 11:01 PM.
 
Old 02-23-2015, 11:02 PM   #3
MrBumps
LQ Newbie
 
Registered: Aug 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
I should add I don't think it will work because it uses D-BUS.

D-Bus is a technical specification for an inter-process communication (IPC) system, allowing communication between multiple concurrently running computer programs (that is, processes). D-Bus was designed as part of the effort of the freedesktop.org project to standardize services provided by Linux desktop environments such as GNOME and KDE.
 
Old 02-24-2015, 06:48 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by upthehill View Post
123
Do not ever mutilate your post contents again.
 
Old 02-24-2015, 06:52 PM   #5
MrBumps
LQ Newbie
 
Registered: Aug 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Is there a delete function ?
 
Old 02-24-2015, 07:23 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by MrBumps View Post
Can I only use polkit with a gui ?
If you define "use" as "create authorization rules" then the answer is no as configuration is only XML/JS files. If you define "use" as "have authorization rules apply to command line applications" then the answer is "not likely" as an application has to incorporate support for PolicyKit (something like 'ldd /path/binary|grep libpolkit') or request its service. Is there a particular problem you're trying to solve?
 
Old 02-24-2015, 07:33 PM   #7
MrBumps
LQ Newbie
 
Registered: Aug 2014
Posts: 6

Original Poster
Rep: Reputation: Disabled
Without using sudo and in run level 5 (rhel) I am able to create a pkla file that has an action that allows me to install a package without prompting for a password providing I use the software gui to install.

However if I try and install the same package using "yum install .... " from the command line I get a message saying only root can do that.

The problem I'm trying to solve is that I don't want to use sudo for reasons that are specific to my environment but something like policy kit might work providing I don't need to use run level 5, is that possible ?
 
Old 02-25-2015, 04:01 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Hmm, maybe use 'pkcon'? See the red box at http://www.freedesktop.org/software/.../pk-using.html which points to this http://www.freedesktop.org/software/...ession-methods FAQ entry & invitation?
 
Old 08-23-2022, 10:14 AM   #9
stoorky
Member
 
Registered: Sep 2015
Posts: 63

Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
If you define "use" as "have authorization rules apply to command line applications" then the answer is "not likely" as an application has to incorporate support for PolicyKit (something like 'ldd /path/binary|grep libpolkit') or request its service. Is there a particular problem you're trying to solve?
Reviving this old post, because I was asking myself the same question (can PolKit be used without desktop environment ?).

Answer is yes, since it's used by systemd, even in a very basic server installation, without any X11/Wayland stuff whatsoever :

Code:
$ tree /usr/share/polkit-1
/usr/share/polkit-1
├── actions
│   ├── org.dpkg.pkexec.update-alternatives.policy
│   ├── org.freedesktop.hostname1.policy
│   ├── org.freedesktop.locale1.policy
│   ├── org.freedesktop.login1.policy
│   ├── org.freedesktop.network1.policy
│   ├── org.freedesktop.resolve1.policy
│   ├── org.freedesktop.systemd1.policy
│   └── org.freedesktop.timedate1.policy
└── rules.d
    └── systemd-networkd.rules
Tested on Debian 11

But as @unSpawn said, your non-gui application has to incorporate PolKit support (which systemd obviously does)

Last edited by stoorky; 08-23-2022 at 10:17 AM.
 
  


Reply

Tags
centos6, polkit, rhel 6



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gksu-polkit syntax problem Linux.tar.gz Linux - Software 1 10-14-2013 07:07 PM
LXer: Those Polkit/PolicyKit XML files a pain to view? Polkit Explorer now avaiable... LXer Syndicated Linux News 0 03-31-2013 03:42 PM
PolKit - Permission Errors In KDE cordesir Linux From Scratch 8 12-27-2012 01:53 PM
[SOLVED] polkit-0.107 fail spiky0011 Linux From Scratch 7 10-14-2012 12:46 PM
LXer: KDE extends Polkit support to polkit-1 LXer Syndicated Linux News 0 12-26-2009 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration