As root edit /etc/sudoers and place the following line:
youruser ALL=(ALL) NOPASSWD:ALL
after
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
以debian系统举例
搬运自https://linuxize.com/post/how-to-create-a-sudo-user-on-debian/
The sudo command (short for Super-user do) is a program designed to allow users to execute commands with the security privileges of another user, by default the root user.
In this guide, we will show you how to create a new user on a Debian system and give it sudo access.
You can use this user account to execute administrative commands without a need to log in to your Debian server as a root user.
Create a sudo user
Follow the steps below to