Disable environment settings

Shawn O'Shea shawn at eth0.net
Tue Jun 3 12:59:25 EDT 2008


>
> If they're special, you can wrap them, e.g.:
>
> /usr/local/bin/foobar:
>
>   #!/bin/sh
>   sudo /usr/local/realbin/foobar $*
>
> Better yet, if you're already modifying their environment with profile
changes (which it sounds like you are), just setup some shell aliases. I've
done this for sudo commands for some users before. For example:
dhcp48:~ shawn$ alias foo="ls -l /etc/services"
dhcp48:~ shawn$ foo
-rw-r--r--  1 root  wheel  677959 Sep 23  2007 /etc/services

sudo also supports aliases, so you can control things there, so yeah, they
still have to type 'sudo', but it could be like 'sudo restartfoo' instead of
'sudo /sbin/service foo restart'

man your shell for alias info (it's a shell builtin) or 'man sudoers' for
info on sudo aliases.

-Shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20080603/b192c86f/attachment.html 


More information about the gnhlug-discuss mailing list