An error is reported when installing VMware tools: not in the sudoers file. This matter will be reported.

       When installing the VMware Tools tool, it will prompt: not in the sudoers file, this matter will be reported.

       Because the authority of the current operating user is insufficient, the root user can only be used in authority distribution and system settings, and the password of the root user cannot be disclosed. When ordinary users execute system programs, they need to temporarily elevate their privileges. sudo is our commonly used command. You only need to enter the current user password to complete the temporary elevation of privileges.

The solution is as follows:

1. Switch to the root user authority, enter the command: "su root", enter the password and press Enter after pressing Enter

2. Check the /etc/sudoers file permissions, if the permissions are read-only, modify them to writable permissions

The command to view the file is as follows:

ls –l /etc/sudoers

Enter the modify permission command:

chmod u+w /etc/sudoers

 

3. Execute the vim command, edit the /etc/sudoers file, and add the user who wants to elevate the privilege; find root ALL=(ALL) ALL in the file, and add the user information to elevate the privilege under this line

Enter the edit file command:

vim /etc/sudoers

 Find Allow root to run any commands anywhere, add a line of commands under the root command, first enter the command: "i", the word "insert" will appear below, and enter the information you want to add. (wzq is my system username)

 

4. Save and exit, and restore the access permission of /etc/sudoers to 440. First press the Esc key to exit the editing mode, and then enter the forced save command: " : wq! "

 

5. Return to the command page and enter the command to restore permissions

chmod 440 /etc/sudoers

6. Switch to a normal user and test the user privilege escalation function. Enter the switch user command

su wzq

 

 This problem is perfectly solved, you can continue to install your VMware tools!

Guess you like

Origin blog.csdn.net/weixin_45730522/article/details/125954768