How to solve the problem of is not in the sudoers file when Linux switches users
This article introduces the relevant knowledge of "how to solve the problem of is not in the sudoers file when switching users in Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
This is a prompt that the current user is not in the sudoers file and needs to be added to the sudoers. Do the following:
Switch to root user first:
Su root
Enter the root password
Sudoers files are read-only by default and need to be given write permission
Then save and return the permissions of the sudoers file to the read-only state. if you don't change to read-only permissions, you'll see.
Chmod 440 / etc/sudoers
Then exit the root user
Exit
Now execute sudo su-you can switch directly to root.
This is the end of the content of "how to solve the problem of is not in the sudoers file when switching users in Linux". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!