Monday, August 3, 2009

enable "sudo" in Fedora..

One fine day I became tired of "su -" and entering the password every other minute. (Also, had to write a script which needed to sudo). So, I decided to enable sudo access. Its pretty simple.
There's a sudo'ers file : /etc/sudoers

Run "man sudoers" to find out exactly what format the file has to be in. It is a bit complex, but don't distress, you won't need its complexity unless you are a funky sysadmin. The sudoers file usually comes with the basic infrastructure and most-frequently-used categories defined. You can define your own categories too. (refer to "man sudoers")

One thing to remember is that the sudoers file should be modified *only* with the "visudo" command. visudo checks the syntax while exiting and optionally, replaces the old file if the syntax is found to be invalid.

Just append the following entry to your sudoers file
jitesh ALL=(ALL)    NOPASSWD: ALL

where, "jitesh" is the username on my machine.
"NOPASSWD: ALL" means that sudo won't ask for password. Use with care.


No comments: