Questions tagged [polkit]

25 questions
0
votes
0 answers

how can I use polkit in python to run some shell command as root without using pkexec?

I have to call some shell command in my python script as root and I do not want to run the entire python script as root. I can of course prefix those command with sudo in Popen, however it does not really show what commands ask for sudo. Also I…
Wang
  • 7,250
  • 4
  • 35
  • 66
0
votes
0 answers

XOpenDisplay returns NULL with pkexec

I'm developing simple X app, which works fine with sudo, but I can't open display with pkexec (XOpenDisplay returns 0). Any idea?? What am I missing? Please note I added following policy in /usr/local/share/polkit-1/actions with symlink to…
0
votes
1 answer

Debuginfo for polkit-0.115-11.el8.x86_64

I am trying to use systemtap hooks on polkit functions, but I get an error that I need to install debuginfo. I can't find debuginfo for polkit package - polkit-0.115-11.el8.x86_64. Does anyone know where can I find it? Thnaks. enter image…
gal
  • 1
  • 2
0
votes
2 answers

Policy Kit does not allow to restart a service, despite an adequate rule

As nagios user, I cannot execute systemctl. Tracking it down to pkexec, I get : -sh-4.2$ pkexec systemctl reload nagios ==== AUTHENTICATING FOR org.freedesktop.policykit.exec === Authentication is needed to run `/bin/systemctl' as the super…
0
votes
1 answer

How to Execute Python Script Using pkexec

For a project I am writing a PyQt5 widget for ifconfig on Linux. Some parts of my code require admin privilege. For example, shutting down an interface. This is a GUI application and users must enter their sudo password using a GUI. I have searched…
Grabinuo
  • 334
  • 2
  • 11
0
votes
2 answers

Unable to start httpd service on Centos 7 "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject"

When trying to (re)start httpd service I get the following error: ** (pkttyagent:2574): WARNING **: 01:33:55.345: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject Error…
Dzseti
  • 447
  • 1
  • 7
  • 18
0
votes
1 answer

How to drop privileges in bash script between pipes?

dbus-monitor --system --profile interface=org.freedesktop.login1.Session,type=signal,member={Lock,Unlock} | egrep --line-buffered -o 'Lock|Unlock' | while read SIGNAL; do case "${SIGNAL}" in Lock) for i in "$(systemd-path…
e142804
  • 3
  • 1
0
votes
1 answer

using dbus and polkit to run a root privilege python service that calls a root script

I have written a python script that downloads deb files from launchpad, and then calls out to a shell script to use alien to convert the debs to rpms. The shell script uses alien, and so it needs to be run as root. The program uses a thread pool to…
miller the gorilla
  • 860
  • 1
  • 7
  • 19
0
votes
1 answer

Spawn GUI from service

I have a service running as root in a linux system that is launched via systemd. This service at some point might spawn a GUI in the current login environment of a user (I get the values of Display and Xauth from Logind via DBUS). The launching of…
Nidhoegger
  • 4,973
  • 4
  • 36
  • 81
-1
votes
1 answer

illegal module type: etc/login.defs

I'm using Ubuntu 16.04.2 LTS, and I have the "shaking authentication window" problem mentioned a few times around the internet, specifically here: https://ubuntuforums.org/showthread.php?t=1761052&p=11267228#post11267228 and…
1
2