Nine traits of the veteran Unix admin | Unix - InfoWorld

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Tue Feb 15 01:05:22 UTC 2011


On Mon, Feb 14, 2011 at 05:31:05PM -0500, Lennart Sorensen wrote

> And how do you deal with 'you need to run fsck manually, please
> enter root password to continue'?
> 
> sudo only is a nice theory, but no more than that.

  I'd boot from a boot CD or USB stick, and run fsck from there.  Having
said that, I'm not doctrinaire about sudo.  I've set up certain commands
that I need on accasion to run via sudo, without a password.  Here is my
/etc/sudoers.d/001 on my machine (i3).  Note that I'm the only person on
my machine.  And yes, I do have a password for root.

# Copy appropriate ssmtp.conf for 295.ca and initiate dialup session
waltdnes    i3 = (root) NOPASSWD: /bin/cp -f /etc/ssmtp/295.ssmtp.conf /etc/ssmtp/ssmtp.conf
waltdnes    i3 = (root) NOPASSWD: /usr/sbin/pon u295.ca

# End dialup session, and restore ssmtp.conf for Teksavvy
waltdnes    i3 = (root) NOPASSWD: /usr/sbin/poff
waltdnes    i3 = (root) NOPASSWD: /bin/cp -f /etc/ssmtp/teksavvy.ssmtp.conf /etc/ssmtp/ssmtp.conf

# Get and set datetime, and save to hardware clock too
waltdnes    i3 = (root) NOPASSWD: /usr/bin/rdate time.nrc.ca -s
waltdnes    i3 = (root) NOPASSWD: /sbin/hwclock --systohc

# hibernate/shutdown/reboot
waltdnes    i3 = (root) NOPASSWD: /usr/sbin/hibernate
waltdnes    i3 = (root) NOPASSWD: /sbin/poweroff
waltdnes    i3 = (root) NOPASSWD: /sbin/reboot

# For when I'm playing around with a USB stick or new USB drive
waltdnes    i3 = (root) NOPASSWD: /sbin/fdisk -l

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list