If you are tired of typing password every time you execute a sudo command,and you are the only user for the operating system, you may want to skip typing password when running a sudo command,this tutorial will explain how to do that easily.
First,open a terminal window and type following to go to root(it is necessarily,or you cannot use sudo command if you execute sudo chmod 740 /etc/sudoers,only by restart to go to recovery mode to change it back to 0440 ):
(Use sudo passwd root to set root password).
You’ll be root after inputting password,and execute command:
chmod 740 /etc/sudoers gedit /etc/sudoers
At the file window,change the last line to %admin ALL=(ALL) NOPASSWD: NOPASSWD: ALL
Save and close the file,then type following command:
chmod 0440 /etc/sudoers
If you want to back as before,type following command:
Following code is to deal with the ready only file:
chmod 740 /etc/sudoers
Edit the file by:
Change the last line back to
%admin ALL=(ALL) ALL
Save and close it .