Launcher to run script with elevated permissions
-
Dear All,
I have created a desktop file in
~/.local/share/applications/to run a script of mine with elevated permissions. This is the important part:
Exec=env SUDO_ASKPASS=/usr/bin/systemd-ask-password sudo -A /usr/bin/bash /home/phablet/path/to/my/script.sh
Unfortunately, when I launch this, I am not asked for my password and in the logs, it says:ubuntu-phablet bash[29466]: Failed to query password: Permission denied
In the terminal, the same agent works for me, e.g. as inSUDO_ASKPASS=/usr/bin/systemd-ask-password sudo -A id. But there, it uses the terminal itself to ask for my password, while in the case of my launcher, I would need a GUI for the same.
Can anyone help me with this? -
C CiberSheep moved this topic from OS on
-
I suspect now that this might be the reason: Please let non-root users ask for passwords. Anyway, I cannot see, how the suggested workaround could be implemented in my case, also given that there's no
setfaclcommand on UT... -
@Babber you will probably want to write a QML / C++ wrapper around your scrips, to do what you want. See the Terminal app source code for an idea how to do that.
-
@arubislander OK, thank you, I'll have a look at it and consider this option. Cheers
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register Login