Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using pkexec could fail if using ssh #4783

Closed
Wang-Yue opened this issue Jan 16, 2019 · 4 comments · Fixed by #11366
Closed

Using pkexec could fail if using ssh #4783

Wang-Yue opened this issue Jan 16, 2019 · 4 comments · Fixed by #11366

Comments

@Wang-Yue
Copy link

meson default to use pkexec if it's available in the system. However, pkexec needs two windows (see NixOS/nixpkgs#18012 (comment)) when running remotely via ssh. So it becomes very cumbersome to install a package in an ssh session.

Is it possible for the user to choose the privilege escalation (pkexec/sudo) method? Or use sudo whenever user is away from X.

@eli-schwartz
Copy link
Member

#11366

@eli-schwartz eli-schwartz linked a pull request Feb 8, 2023 that will close this issue
@xclaesse
Copy link
Member

xclaesse commented Feb 8, 2023

When I use pkexec over ssh, it asks for password in the terminal:

$ pkexec true
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/bin/true' as the super user
Authenticating as: root
Password: 

Why is it different on your system or in Meson?

@eli-schwartz
Copy link
Member

I think it requires a logind session, because it sure doesn't work for me over ssh. I successfully type in my password, then it complains about session cookies.

I have literally never had a problem with sudo over ssh. Polkit unpredictably fails unless I obtain physical access to the device and log into a desktop. Then ssh works. Go figure.

To add to the indignity, it used to complain I'm not authorized anyway, and I had to manually configure polkit to allow the wheel user to obtain privileges. I did so purely as an experiment to see if it could work, my system didn't preconfigure this at all.

@xclaesse
Copy link
Member

xclaesse commented Feb 8, 2023

Sounds like bad polkit config and/or bugs, but it seems pretty common to not work indeed, judging from what I find in google. Possibly you need a session open on the machine you ssh, that was the case when I tried it at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants