I have a few virtual machines from Amazon Lightsail and Linode all running Ubuntu 22.04.
With Amazon, by default, the root login is disabled, public-key authentication is enabled and default user is ubuntu
.
With Linode, there's no default user and root login with password is enabled.
So on Linode I disable root login, create ubuntu
user, disable password-login, enable public-key login and add ubuntu
to sudo
group.
So far everything works fine.
However, on Linode sudo
command asks for password of ubuntu
user but on Amazon doesn't.
So I run sudo visudo
on both Amazon and Linode and notice that the content is exactly the same but on Amazon sudo
doesn't ask for password while on Linode it does:
root ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL
%sudo ALL=(ALL:ALL) ALL
What else I have to check/change to stop sudo
from asking for password?