Sudo question specific commands on specific directories
Ok what I want to do is allow a user to run the following commands on specific directories but these are root commands
Code:
unlink /source/directory Code:
ln -s /source/directory /destination/directory Code:
mv /source/directory to /destination/directory.old |
Make the user owner of parent directory.
|
You can set up sudoers so that the user is allowed to run those commands with exactly those arguments.
|
sudo permissions for specific commands
Ok what I want to do is give a user permissions or the ability to run the command below for only the specific command and location nothing else on a case by case bases, i.e..
Code:
unlink /forms/directory Code:
ln -s /new/location/ to /forms/directory Code:
mv /old/location to /old/location.old |
Note 'unlink' doesn't automagically mean being able to delete directories. Also note this seems to be a continuation of https://www.linuxquestions.org/quest...es-4175529280/ so I'll be merging threads.
As for your question: first create a shell script containing the above commands, then make it executable (0755) and place it in say /usr/local/sbin/, then edit (visudo) /etc/sudoers to allow that user to execute the script as root user. See 'man sudoers' for examples. If unsure post your script plus your modified /etc/sudoers. |
replay
Quote:
|
Quote:
Elif this is a question then I do not comprehend it. |
All times are GMT -5. The time now is 08:06 AM. |