sudo fails after Ubuntu operates the sudoers file

  Today, when changing the permissions of the user, I changed the permissions of sudoers to 777, resulting in an error message that sudo /etc/sudoers can be written by anyone using sudo.

Method 1

  If you have the root password

  pkexec chmod 0440 /etc/sudoers Method

2 Let’s go fast, I only click on the second time First, restart ubuntu, press shift (the speed is faster, rely on the speed of the hand), select the second item, Press e then press down, change "ro recovery nomodeset" to "rw single init=/bin/bash", then press F10 or Ctrl+X: then: select recovery mode: select the second one because the first is selected Then enter the system again. After hitting Enter, a large string of text flashes. Finally, enter the root command line: use the command chmod 440 /etc/sudoers to change the permissions of sudoers. After entering vi /etc/sudoers, you can modify the content of sudoers for modification. Then, press ctrl+alt+del to restart;














Guess you like

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