This may sound like a bad idea in general but I do this in my testing virtual machine (VM) with Ubuntu or Debian operating systems. It makes it easier to restart servers.

First you need to edit your /etc/sudoers file through:

[code language=“bash”]visudo[/code]

In the editor, locate this:

[code language=“bash”]# Allow members of group sudo to execute any command

%sudo ALL=(ALL:ALL) ALL[/code]

Change to this:

[code language=“bash”]# Allow members of group sudo to execute any command

%sudo ALL=(ALL:ALL) NOPASSWD:ALL[/code]

Now you can use sudo without a password.

comments powered by Disqus