restriction on commands
I am using Ubuntu linux.
Do we have any mechanism in linux where we can restrict user for giving any commands?
E.g. I have one folder named <home>/myCode
Now I want to make sure that any user including me, is not able to user "rm -rf *" on this folder.
Can we do this?
Any help would be really grateful.
You could change the execute permissions on rm (preventing anyone other than root from executing the command) however this would probably cause lots of issues elsewhere.
You could write your own front-end to the rm command, performing some basic checks before allowing the command to be run.
EDIT:- Sample front-end:
chown root:root /usr/local/bin/rm
chmod 755 /usr/local/bin/rm
chown root:root /usr/local/bin
chmod 755 /usr/local/bin
ensure that /usr/local/bin is before /bin in the $PATH environment variable.
Have you thought about 'chattr'?
|All times are GMT -5. The time now is 09:03 AM.|