Add a common user to The sudo list in Linux.
Preface
Linux users (uid> = 500) do not have the permission to execute certain commands. to execute commands with higher permissions, there are two methods:
The first is to use the su-command to switch to the root user for execution;
Another method is to add sudo to execute the command.
Edit File
Before using sudo to execute the command, you need to add this common user to the/etc/sudoers file:
1. Switch to the root user and run the cmddo command to enter vim. The/etc/sudoers file is opened.
2. Enter "/root" to search and find"Root ALL = (ALL) ALL"In this line, press" yyp "to get a copy of a row and change it"Username ALL = (ALL) ALL"," Username "is the user name to be added.
(If you do not want to enter the user password when using sudo, change it"Username ALL = (ALL) NOPASSWD: ALL")
3.: Save and exit x.
Reference link: [Debian] add normal users to sudoer