I get in trouble sometimes because I am too concise in my posts. Could you please read the third paragraph of the attached Launchpad bug report to see if that answers your question?
@Jeremy, thanks, didn’t know that. From third paragraph:
[…] in Ubuntu 17.10 and 18.04 LTS. […] for instance, instead of running gksu gedit or gksu nautilus to edit /etc/default/grub, navigate to admin:///etc/default/
In 17.10 I was able to start apps with a different user without entering the password.
I for example input this into visudo:
zzz ALL=(abc) NOPASSWD: /usr/bin/java
Which means user zzz is able to run java as user abc without entering the password. With ubuntu 18.04 this does not seem to work anymore. What is the way to do this now?
@V thank you. The article is written most confusingly, but after some experimentation, I managed to work out what was meant. The end result is writing two custom scripts to create a generic solution! Strange.
… and what do you suggest to used instead? Some command example would be nice.
I get in trouble sometimes because I am too concise in my posts. Could you please read the third paragraph of the attached Launchpad bug report to see if that answers your question?
@Jeremy, thanks, didn’t know that. From third paragraph:
[…] in Ubuntu 17.10 and 18.04 LTS. […] for instance, instead of running gksu gedit or gksu nautilus to edit /etc/default/grub, navigate to admin:///etc/default/
This is the article explaining in plain English:
https://www.linuxuprising.com/2018/04/gksu-removed-from-ubuntu-heres.html
Hello Jeremy,
Does this affect visudo as well?
In 17.10 I was able to start apps with a different user without entering the password.
I for example input this into visudo:
zzz ALL=(abc) NOPASSWD: /usr/bin/java
Which means user zzz is able to run java as user abc without entering the password. With ubuntu 18.04 this does not seem to work anymore. What is the way to do this now?
@horacij thank you for the reference, which is helpful to show how to edit a system file.
What it doesn’t show is how to run an app with admin permissions, where admin:// isn’t relevant.
E.g., sometimes I have to run a command from a script where the user needs to enter his password. So, instead of sudo, I might use this:
gksudo killall NetworkManager # Prompt the user for the password.
Alternatively, one could capture the password within the script, useful when the script needs to run multiple commands as root. Here is the format:
local -r PASSWORD=”$( gksudo –print-pass –message='[explanatory message]’ : 2>/dev/null )”
@Jeremy, how would you perform these two actions without gksudo?
Here is what I found for as gksu replacement in scripts: https://madebits.github.io/#blog/2018/2018-04-24-Gksu-Is-Dead-Long-Live-Pkexec.md
@V thank you. The article is written most confusingly, but after some experimentation, I managed to work out what was meant. The end result is writing two custom scripts to create a generic solution! Strange.