sudo, a wonderful little utility for doing administrative tasks without actually logging in as root, has been around for a while in the UNIX world. Now that Mac OS X is using it, it is becoming more popular.
Unfortunately, the binary distributions of sudo fail to enable by default one of it's more memorable traits: its tendency to verbally abuse you if you mistype the password. This can be fixed by adding the following line to /etc/sudoers :
Defaults insults
Personally, I don't like some of the wimpier insults. It is easy to fix this, by recompiling to only include the classic insults. At the same time, we will increase the timeout period, so we don't have to retype our password quite as often ! Download the source for sudo, and enable insults using the following (which should be run as root, not using sudo):
apt-get source sudo
chown -R root:root sudo-1.6.8p7
chmod -R go-rwx sudo-1.6.8p7
cd sudo-1.6.8p7
./configure --with-classic-insults --with-csops-insults --with-insults \
--prefix=/usr --with-fqdn --disable-root-mailer \
--with-logging=syslog --with-logfac=authpriv \
--with-env-editor --with-editor=/usr/bin/editor \
--with-timeout=60 --with-password-timeout=0 \
--with-secure-path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
make install
These options for Debian. YMMV on other systems
If you get a message like "Sorry, you must put some 'source' URIs in your sources.list", then add lines like the following to your /etc/apt/sources.list file.
deb-src ftp://debian.lcs.mit.edu/debian/ stable main non-free contrib
Then you will need to update your apt index --- which you should be doing before using apt-get if more than a day has passed since the last update...
sudo apt-get update
Another reason I recompile sudo is to change the name of the sudoers file and place it somewhere other than /etc. First, configure sudo with an additional option identifying the new directory for the sudoers file:
sudo ./configure --with-classic-insults --with-csops-insults --with-insults \
--prefix=/usr --with-fqdn --disable-root-mailer \
--with-logging=syslog --with-logfac=authpriv \
--with-env-editor --with-editor=/usr/bin/editor \
--with-timeout=60 --with-password-timeout=0 \
--with-secure-path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin" \
--sysconfdir=/usr/local/etc
Then edit the resulting Makefile to provide a new name for the sudoers file (normally sudoers, changed to .bashrc in the new line provided below.)
DEFS = -D_PATH_SUDOERS=\"$(sudoersdir)/.bashrc\" \
-D_PATH_SUDOERS_TMP=\"$(sudoersdir)/.bashrc.tmp\" \
-DSUDOERS_UID=$(sudoers_uid) -DSUDOERS_GID=$(sudoers_gid\) \
-DSUDOERS_MODE=$(sudoers_mode)