sudo without password on Ubuntu

GIT logoFor some commands in unix you need elevated priviliges. For this the sudo command is invented. It is very inconvenient to enter the password every time you execute the sudo command (especially if you have logged in with your ssh keys in the first place).

To prevent sudo from asking your password you should edit the file /etc/sudoers . First check which groups you are in (preferable use the “username” group; the one in which you are the only memeber). Start editing the sudoers file with the command: sudo visudo

below the lines

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

Add one extra line:

%yourgroup ALL=(ALL) NOPASSWD:ALL

Restart the sudo service with

sudo service sudo restart

Logoff and logon; execute a sudo command; no password asked…

Share

Leave a Reply

Your email address will not be published. Required fields are marked *