I am using ubuntu server on which some commands like
apt-get install
needs sudo access so need to stop sudo access for that specific command i.e. while executing that command we don't need sudo access. So how to any solution for this ?
I am using ubuntu server on which some commands like
apt-get install
needs sudo access so need to stop sudo access for that specific command i.e. while executing that command we don't need sudo access. So how to any solution for this ?
Copyright © 2021 Jogjafile Inc.
                        
There are any number of ways to do this.
One which springs immediately to mind is to have a setuid script which does the job for you. Make it owned by
rootand also runnable by the groupaptgrp(which you create and manage yourself).The script will basically take arguments then call
apt-getin turn, but as therootuser.However, I'd advise against this since you're creating a new tool with all the opportunities for getting security wrong. Especially since
sudocan be configured in great detail in what programs you're allowed to run (no need to open up everything with"pax ALL=(ALL) ALL") and whether or not you need to supply a password for it (the"NOPASSWD"clause).I'd look into configuring
sudocorrectly before attempting any other solution.