Need to get red of sudo

John Calderon johnnycal at ispchannel.com
Sat Nov 11 01:49:02 EST 2000


I would sugest not doing this this way because if a user has any unix ability 
they can just vi their .profile or equivalent and run those commands anyways 
bye overridding what you set as an alias.

I have used wrote a little perl snippet and that calls sudo like this 

$ls 

in /bin/ls I have 
#!/usr/bin/perl

system "sudo /usr/local/admin/ls @ARGV";   #or whatever option you allow.... 
#there is a predefined variable $RNV{SUDO_USER} that is cool to play with.

john 

>
>I did this by aliasing the command(s) for the users. Their shell config file
>(.bash_profile in this example) defines the alias. 
>
>For eg. to allow a user to stop the Apache server I defined:
>alias apache_stop="sudo /usr/local/apache/bin/apachectl stop"      
>
>You can also define aliases for standard commands.
>
>The sudoers file defines if the user needs to enter the password for the
>command or not.
>
>This scheme is not very scalable ie. it becomes very time consuming to
>maintain if you have a lot of 'protected' commands and/or users.
>
>Regards,
>Harshal
>
>
>
>> -----Original Message-----
>> I want my users to type any command they want without 
>> preceding it with sudo
>> , and the password prompt will come on if the guy needs to enter it
>> otherwise no password will be necessary.
>> 
>> Did any body came across anything like that?
>
>> Awwad A. Alhabli
>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
><HTML>
><HEAD>
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
><META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
><TITLE>RE: Need to get red of sudo</TITLE>
></HEAD>
><BODY>
><BR>
>
><P><FONT SIZE=2>I did this by aliasing the command(s) for the users. Their 
>shell config file (.bash_profile in this example) defines the alias. </FONT>
<
>/P>
>
><P><FONT SIZE=2>For eg. to allow a user to stop the Apache server I defined:
<
>/FONT>
><BR><FONT SIZE=2>alias apache_stop="sudo /usr/local/apache/bin/
apachectl 
>stop"      </FONT>
></P>
>
><P><FONT SIZE=2>You can also define aliases for standard commands.</FONT>
></P>
>
><P><FONT SIZE=2>The sudoers file defines if the user needs to enter the 
>password for the command or not.</FONT>
></P>
>
><P><FONT SIZE=2>This scheme is not very scalable ie. it becomes very time 
>consuming to maintain if you have a lot of 'protected' commands and/or 
users.
></FONT></P>
>
><P><FONT SIZE=2>Regards,</FONT>
><BR><FONT SIZE=2>Harshal</FONT>
></P>
><BR>
><BR>
>
><P><FONT SIZE=2>> -----Original Message-----</FONT>
><BR><FONT SIZE=2>> I want my users to type any command they want without 
<
>/FONT>
><BR><FONT SIZE=2>> preceding it with sudo</FONT>
><BR><FONT SIZE=2>> , and the password prompt will come on if the guy 
needs 
>to enter it</FONT>
><BR><FONT SIZE=2>> otherwise no password will be necessary.</FONT>
><BR><FONT SIZE=2>> </FONT>
><BR><FONT SIZE=2>> Did any body came across anything like that?</FONT>
></P>
>
><P><FONT SIZE=2>> Awwad A. Alhabli</FONT>
></P>
>
></BODY>
></HTML>




More information about the sudo-users mailing list