Add Your Username To Sudo Group And Run Sudo Without Password
usermod -aG sudo yourusername
Then edit the sudoers file. Run:
and add at the end of the file
yourusername ALL=(ALL) NOPASSWD:ALL
Another option is to allow passwordless sudo for any user in the sudo group.
# Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command, no password %sudo ALL=(ALL:ALL) NOPASSWD:ALL
It might be better to make another file in the /etc/sudoers.d directory. If you have a typo or error of any sort, it will break sudo.
Then it might be a good idea to disallow root login