satishex
asked on
Restrict "rm -rf *" command in Linux/Unix ?
Hi All,
Can anyone suggest me how to restrict the "rm -rf *" command.
I want to restrict some users accidently typing the "rm -rf *" command from a login at unintended directory. (Say if i want to delete log files in log directory and uses "rm -rf *" command and later found out that i was in HOME ?????)
I tried <<alias rm "rm -i">>. The above command interactively asks me before deleting.
But the problem comes when the -f option is used. It overrides others and just deletes.
Just needs to know, how i can restrict this command.
Thanks for your valuable suggestions...
Can anyone suggest me how to restrict the "rm -rf *" command.
I want to restrict some users accidently typing the "rm -rf *" command from a login at unintended directory. (Say if i want to delete log files in log directory and uses "rm -rf *" command and later found out that i was in HOME ?????)
I tried <<alias rm "rm -i">>. The above command interactively asks me before deleting.
But the problem comes when the -f option is used. It overrides others and just deletes.
Just needs to know, how i can restrict this command.
Thanks for your valuable suggestions...
Hi yah
normal user who does not have root priviligies would not able to delete any log file , he would only able to delete his own home directory file and the file he created
so all those user you are talking about, are the root priviligies user ?? in that case you would not be able to restrict them
only way to use sudo file as samo4fun said
normal user who does not have root priviligies would not able to delete any log file , he would only able to delete his own home directory file and the file he created
so all those user you are talking about, are the root priviligies user ?? in that case you would not be able to restrict them
only way to use sudo file as samo4fun said
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It seesm to me that all users are logging on using the same account. If this is the case try to create separate accounts for all the users and try further restrict their file owning rights.
Make sure that they go root using su / sudo only but not login as root.
Make use od Sticky bit if a directory contains files from different users.
Apart from that feed them with enuogh coffee to ensure that they have at least RDA amount of caffeine and kept awake during their shift :)
Make sure that they go root using su / sudo only but not login as root.
Make use od Sticky bit if a directory contains files from different users.
Apart from that feed them with enuogh coffee to ensure that they have at least RDA amount of caffeine and kept awake during their shift :)
ASKER
Thanks all for your valuable replies :-)
more details can be found here
http://linux.about.com/od/commands/l/blcmdl8_sudo.htm