abbreviations in sudo

Dana Kaempen decay at flash.net
Tue Jun 3 14:28:57 EDT 2003


Jim wrote:
> Greetings:
> 
> 1. Is it possible to use a small sudo command (alias) to be expanded
> into
> the correct command?
> 
> ex:
> 
> I want the sudo user to enter 'sudo addu bob' which in turn will run
> the
> sudo command:
> 
> useradd -g staffer -k skel1 -s /usr/bin/ksh
> 
> and add bob to the end of the expanded command resulting in:
> useradd -g staffer -k skel1 -s /usr/bin/ksh bob
There's no reason not to use a script in a case like this and then add
the script into the sudoers file via visudo.  Just make sure that root
is the only user that can modify the script and that all commands are
explicitly PATHed in the script (or explicitly set the PATH).  That
way, you'll be able to change the script to make it do what you want,
testing will be easier, and it's still secure.

Dana



=====
--
..d..ecay

mailto:decay at flash.net
-------------------------
"Keep the wheels rolling." - Anonymous traffic prophet


More information about the sudo-users mailing list