How can I disable the passwordless sudo access for the default ubuntu user on an EC2 instance? Is it safe to do it?
Of course you can that. Is it safe? First be sure to set password on user ubuntu.
Edit the sudoers file with command visudo otherwise be very careful.
Find the line matching ubuntu user and change it to
Be sure to chek the manual of sudoers
Yes, but make sure to set that user's password to something known before you do that.