On Sat, 19 Aug 2023 10:16, jdd@dodin.org <jdd@...> wrote:
Le 19/08/2023 à 05:11, David T-G a écrit :
% if I write % % jdd ALL=(ALL:ALL) NOPASSWD: /usr/bin/sudo -i
Are you running
/usr/bin/sudo -i
when this doesn't work for you?
I just tested the two and the result is the same. ALL works, but the above line asks for jdd passwd. Notice that without any than default, the prompt is not for jdd but for root passwd
Frist of all: Be lazy. Trick is to "encapsulate" the command in question in a dedicated script and call that. %><-- Begin of file /root/bin/makeroot #!/usr/bin/bash exec /usr/bin/sudo -i %><---End of file /root/bin/makeroot Create that file, make it executeable and create a sudoers line for it. e.G.: jdd ALL=(ALL:ALL) NOPASSWD: /root/bin/makeroot now comes the lazy part, create an alias for the command: alias makeroot="/usr/bin/sudo /root/bin/makeroot" This has worked for me in the past, and serves me well today. HtH - Yamaban.