is not in the sudoers file solution (transfer)

Solution:
First, you need to switch to root identity
$su -
(note that there is - , this is different from su, when you use the command "su", you just switch to root, but you don't pass the root environment variable, you are still the current user environment variables, use the "su -" command to bring the environment variables together, just like logging in with root)

then
$visudo      //Remember, there is no space between vi and sudo here

1. Move the cursor to the last line
2. Press a to enter append mode
3. Enter
your_user_name ALL=(ALL) ALL
4. Press Esc
5. Enter ":w" (save the file)
6. Enter ":q" (exit)

to add yourself to sudo group, you can use the sudo command. 

Guess you like

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