Linuxtipstricks – Just another /linux/blog

March 21, 2009

How to change sudo to not ask for your personal password

Filed under: user tipstricks — Antonio Portuesi @ 4:13 pm

On any default Ubuntu box, any task which requires root (or Administrator) privileges runs a program called sudo (or the graphical version, gksu) to run a helper program in a privileged mode.
By default, for security reasons, this program will ask you to input your personal password. When you make many settings changes on your system (or need to run applications as root), each password prompt can get rather annoying.
This tip will show you how to configure sudo to allow a specific user to run commands as root (or any other user you define) without prompting for a password.

The sudo program saves its configuration information in the text file /etc/sudoers. So you should edit this file:

user@pc:~$ sudo nano /etc/sudoers

and add the following line:

#USER# ALL=NOPASSWD:ALL

Replace #USER# with the username of the user you wish to add. E.g. if the username was bill, insert a string like that:

bill ALL=NOPASSWD:ALL

Now you will not have to give Ubuntu the password when you use sudo.

March 7, 2009

How to add a user to the sudo list

Filed under: user tipstricks — Antonio Portuesi @ 11:16 pm
Tags: , , , , , , ,

When you set up Ubuntu or Kubuntu or some other Ubuntu-like distro, during the installation process it automatically will add the first user to the sudo group, allowing that user to make changes as the super user (aka root aka administrator if you come from Windows environment) by typing in the related password.
However, if you want to give someone else superuser privileges (please think on it) on your Linux system, you’ll have to give it a specific sudo access.

That is very easy to do. Just run:

user@pc:~$ sudo usermod -G admin username

That’s all!

If you prefer the graphic way of doing things, open System -> Administration -> Users and Groups.
Select the user you want to add to sudo, and click Properties.
Under the User privileges area, check the box “Executing system administration tasks” and you’ll be done.

Create a free website or blog at WordPress.com.