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. Regards, Kumar |
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: Code:
#!/bin/bash vi /usr/local/bin/rm 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. export PATH=/usr/local/bin:$PATH |
Have you thought about 'chattr'?
Code:
chattr +i filename Code:
chattr +a filename |
All times are GMT -5. The time now is 03:17 PM. |