sudo without a password
If you are tired of typing your password all the time and want to be able to sudo without using a password you can modify the sudo configuration so that you can always execute a command as root without a password.
Method 1 - For a single user
Edit the /etc/sudoers configuration file.
Add a line like this replacing the
Method 2 - For multiple users
Create a new group on the system eg sudo or sudoers nu using the following command. You should be aware that most systems now already have a group setup to do this so you may be able to skip creating the group.
groupadd sudoers
Then add the usernames you want it to work for by using the following command
addgroup yourusername sudoers
Edit the /etc/sudoers configuration file and add the group and tell sudo not to prompt for a password
%sudoers ALL=(ALL) NOPASSWORD: ALL
The above should work on debian / ubuntu and should only be used for trusted users as you have just given them root access without a password so some care should be taken!
Did You find this page useful?
Yes
No