Getting sudo to work without a password

4. January 2012 21:26

 

I started working with linux for development work again after a break for a few years. I have ended up working on a project that requires a lot of mixed access from the normal user account to root or to other accounts. The simple way todo this without having to type a password a million times a day is to use sudo.

This is a quick guide to how I went about configuring it in such a way they you can also have support for multiple users on the same machine that may require root. You will need to be root of course for this to work.

 

First of all add a new group.

 

root@linux:~# addgroup sudoers
Adding group `sudoers' (GID 1001) ...
Done.

 

 

Then add your self to the group and repeat for each of the other users you need to have access.

 

 

root@linux:~# adduser james sudoers
Adding user `james' to group `sudoers' ...
Adding user james to group sudoers
Done.

 

Then make sure the following line exist in the /etc/sudoers config file.

 

 

%sudoers ALL=NOPASSWD: ALL

 

 

Then to test it you will need to logout and in again to allow the group change to be visible and then run something like "sudo bash" to get a root shell. Now you don't need to type a password a million times a day.

 

I should probably point out that there are security considerations on this and bear in mind that I use it on a development box which only has extremly limited access.

E-mail Kick it! DZone it! del.icio.us Permalink


Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading