Solution for is not in the sudoers file under Linux

When we use the sudo command to switch users, we may encounter the following error: xxx is not in the sudoers file. This incident will be reported, xxx is your current username, the reason is that the user is not added to the sudo configuration in the file

1. Switch to the root user and run the visudo command

2. In the opened configuration file, find root ALL=(ALL) ALL and add a line below

xxx ALL=(ALL) ALL where xxx is the username you want to join

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326522322&siteId=291194637