<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 14, 2019 at 12:49 PM Simon McVittie <<a href="mailto:smcv@collabora.com">smcv@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, 14 Aug 2019 at 12:05:41 -0600, Gabe Alford wrote:<br>
> I have a QT application that logs into a remote machine through SSH. I plan on<br>
> using polkit in some way for privileged access to admin commands that are not<br>
> services. I want to be able to handle both password-less and password<br>
> authentication in polkit. What's the best way of handling a password prompt<br>
> remotely with polkit?<br>
<br>
The app will need to run a polkit agent at the remote end so that it can<br>
answer polkit requests. Polkit agents are implemented using the<br>
polkit-agent-1 library.<br>
<br>
Normally, a polkit agent is a GUI thing, and typically each<br>
desktop environment has one; when asked for a password, it asks<br>
the user for a password, waits for their response, and sends the<br>
password as a response to the request. There's a simple agent,<br>
pkttyagent(1), in the polkit source code: it uses the tty instead of a<br>
GUI. <a href="https://github.com/lxqt/lxqt-policykit" rel="noreferrer" target="_blank">https://github.com/lxqt/lxqt-policykit</a> is one implementation in Qt.<br>
<br>
In your case, instead of asking the user, the polkit agent will have<br>
to ask your Qt application (perhaps via a Unix socket forwarded through<br>
the ssh connection), which can do whatever it wants to do (perhaps asking<br>
the GUI user) and send back an appropriate password.<br></blockquote><div><br></div><div>Thanks for the response!</div><div><br></div><div>It sounds like pkttyagent is the way to go as I don't want to have to set DISPLAY</div><div>settings on the remote host. Will look at lxqt-policykit as well as having the polkit</div><div>agent ask the QT application instead of the user directly.<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
    smcv<br>
_______________________________________________<br>
polkit-devel mailing list<br>
<a href="mailto:polkit-devel@lists.freedesktop.org" target="_blank">polkit-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/polkit-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/polkit-devel</a></blockquote></div></div>