Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: How do I set up sudo..

From: ajm <ajm91qw(at)sbcglobal.net>
Date: Fri Dec 21 2007 - 20:15:48 EST


On Thu, Dec 20, 2007 at 10:21:40PM -0500, Douglas A. Tutty wrote:
> On Thu, Dec 20, 2007 at 11:35:32AM -0800, Alou Dialy wrote:
> > I figured out that I didnt have /sbin and /usr/sbin in
> > my PATH but how come when I do sudo env it does show
> > those directories in my PATH ?
> >
> > The man page for sudo or sudoers says that sudo does
> > modify PATH but it doesnt say how and it doesnt say
> > how it tries to find the command that you give it.
> >
> > Is there a way to set up sudo so that I dont have to
> > type the full path to the command.
>
> How about an alias in your own .bash_aliases?
>
> alias shutdown "sudo /sbin/shutdown"
>
> Or something?
>
> Doug.
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>

su to root then type the command visudo

under "User privilege specification" add the following

# User privilege specification

root	ALL=(ALL) ALL
ajm57	ALL=/sbin/shutdown,\
        /bin/mount,\
	/bin/umount

Change ajm57 to your user name then save the file. You can add as many system command as you wish.

So when you want to shutdown simply type

sudo shutdown -h now

it will ask you for your user password (don't type in your root password)

-- 
Alexander J. M.
Linux 2.6.18-5-686 i686


-- 
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Received on Fri Dec 21 20:14:37 2007
Do you need help?X

This archive was generated by hypermail 2.1.8 : Wed Feb 27 2008 - 23:06:23 EST


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library