Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2930

Allowing a sudo command to run without needing password [duplicate]

$
0
0

I have the following command:

sudo service cron start

When I type it into the terminal, it asks me for a password, just as it should.But I need for users (or if all users aren't possible, then at least my user) to be able to run this specific command without needing to put in any passwords.I googled around, even looked at similar questions here and found about visudo, so I gave it a try, and put this into the sudo config file, which I accessed through visudo.

mike ALL = NOPASSWD: /usr/sbin/service cron start

But it had no effect at all, I still get asked for a password when I try to do sudo service cron start, or even sudo /usr/sbin/service cron start

sudo -l:

Matching Defaults entries for mike on bolt:    env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/binUser mike may run the following commands on bolt:    (root) NOPASSWD: /usr/sbin/service cron start    (ALL : ALL) ALL

So what am I doing wrong here?


Viewing all articles
Browse latest Browse all 2930

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>