[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Unable to execute a script without asking for sudo password, even after editing sudoers file.



> That is your problem: You have configured sudo to allow you to run
> i3exit as root.
>
> But you don't. You run i3exit as yourself (without sudo), and IT then
> uses "sudo pm-suspend" (and others).
>
> Two possible ways forward:
>
> - Call it using "sudo i3exit" and remove the calls to sudo from inside
>   the script
>
> - Call it as yourself (= just "i3exit") and give yourself the
>   privileges to run "reboot", "halt" and others as sudo.
>
> Hope this helps

Hi basically I just want i3exit to run without asking any password, as I will
be using this script to be executed by i3.

So I guess your second option will suit me. If I do something like this:

 neo1691 ALL=(ALL) ALL, NOPASSWD: /usr/sbin/pm-suspend, /usr/sbin/pm-hibernate
-- 
Regards,
Anubhav Yadav
Imperial College of Engineering and Research,
Pune.


Reply to: