[ale] Sudo

Michael B. Trausch fd0man at gmail.com
Wed May 18 18:51:48 EDT 2005


Jim Popovitch wrote:
> Several times in the (still going)
> setuid/viral/malware/root/non-root/etc discussion people have mentioned
> using sudo.  One of the things I've always disliked about sudo is the
> need for me to have to preface some commands I want to run as su vs
> which I don't.  What I mean is as a user if I want to run "ifconfig eth
> mtu 1149", I need to acually run "sudo ifconfig eth0 mtu 1149", but if I
> want to just see what the MTU is for interface eth0 I don't need sudo.
> What I think would be neat is for bash (or other shells) to remember
> sudo commands that users run and to automatically invoke sudo the next
> time I run the command without it.  Knowing when to use sudo is not the
> issue here, having sudo know when it is needed is.  
> 

You should need to enter a password to change the MTU.  Of course, you
can just run /sbin/ifconfig at any time without root access to see what
interfaces are up or not.

And, such functionality is already in bash, if you want to use it.
Place the following command in your .profile / .bash_profile / .bashrc
(whichever is configured to run on your system) file:

alias ifconfig='sudo ifconfig'

	- Mike

-- 
Michael B. Trausch                               <fd0man at gmail.com>
Website: http://fd0man.chadeux.net/     Jabber: mtrausch at jabber.com
Phone: +1-(678)-522-7934              FAX (US Only): 1-866-806-4647
===================================================================
Do you have PGP or GPG?  Key at pgp.mit.edu, Please Encrypt E-Mail!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature




More information about the Ale mailing list