Disable rm -rf * or rm -rf / in Cent OS


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Disable rm -rf * or rm -rf / in Cent OS
# 1  
Old 07-08-2013
Wrench Disable rm -rf * or rm -rf / in Cent OS

Can some one suggest me the way to disable " rm -rf * " or " rm -rf / " command execution permanently from the server. Any suggestion will be very much helpful .
# 2  
Old 07-08-2013
Quote:
Originally Posted by shiek.kaleem
Can some one suggest me the way to disable " rm -rf * " or " rm -rf / " command execution permanently from the server. Any suggestion will be very much helpful .
I assume you're concerned over this so that people can't mess up your system. Actually I don't believe it's possible to do what you want for 2 reasons:
1) rm -rf *: this command deletes all files / subdirectories that are located inside your current working directory. If the right permissions are set, a normal user will not be able to delete anything over which he doesn't have write permissions. On the other hand, I (as a normal user) should be allowed to delete the files and the directories that I own.
2) rm -rf /: this command deletes *everything*, beginning at the root directory down to the last file / directory in the filesystem tree. Again, if you're not root, you won't be allowed to do it. Now, if you're root and still do that, you are either suicidal or up for a good punch in the face Smilie.

So, rest assured that with the right permissions policy (everything comes down to it) your system should be safe.

If you have any further questions, do not hesitate to let us know Smilie.
These 2 Users Gave Thanks to gacanepa For This Post:
# 3  
Old 07-08-2013
What about rm -rf ../* when you're one dir up from root? What about /bin/rm -rf ../* ? What about cd / ; rm -r * ? There are thousands of possible permutations.
This User Gave Thanks to Corona688 For This Post:
# 4  
Old 07-08-2013
What everyone is saying:

1. when your system permissions are correct, and the average user is not logged in as root, things will be fine.

2. You cannot anticipate every command that could delete entire filesystems/ & directory trees. You have to use both permissions, and prevent privileged access.
This User Gave Thanks to jim mcnamara For This Post:
# 5  
Old 07-09-2013
Thanks for the suggestions guys,

But the question is still half answered . The application which is running on the server has to be accessed or do any code change in it requires root permissions ,so every of the workstation with Cent OS being accessed is given root permissions and most of the programmers are non linux users who are causing this. Atleast it will be good if i can make a message echo "Please verify your command ".
# 6  
Old 07-09-2013
Split the environment. Have the code changes happen on a development server and implement some kind of checkin/transfer to bring the code to the production server.
This User Gave Thanks to zaxxon For This Post:
# 7  
Old 07-09-2013
Hope that could have been in my hand .Its already been developed and now only thing i can do as an admin is to stop the users to stop them from executing the deadly commands
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Linux

Add persistent route in cent os 6.5

Hi , I have cent os 6.5 and am trying to make few routes permanent for bond: i have added two routes using below two commands : /sbin/route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.59.160.128 /sbin/route add -net 0.0.0.0 netmask 0.0.0.0 gw 49.44.52.90 post which route command output is... (5 Replies)
Discussion started by: omkar.jadhav
5 Replies

2. Red Hat

How to Find all the SSL certs on a give host Cent OS

Hi I am trying to find all the ssl certs installed/located on cent os Host , Please help . (1 Reply)
Discussion started by: smartguyz2012
1 Replies

3. Red Hat

AD Intergration with Cent OS 6

Hello, I am integration AD authentication to Cent OS 6 servers. I am running to this error when I tried to join with AD server. error message : # net ads join -U 504783 Host is not configured as a member server. Invalid configuration. Exiting.... Failed to join domain: This... (0 Replies)
Discussion started by: bobby320
0 Replies

4. Red Hat

SSL/TLS renegotiation DoS -how to disable? Is it advisable to disable?

Hi all Expertise, I have following issue to solve, SSL / TLS Renegotiation DoS (low) 222.225.12.13 Ease of Exploitation Moderate Port 443/tcp Family Miscellaneous Following is the problem description:------------------ Description The remote service encrypts traffic using TLS / SSL and... (2 Replies)
Discussion started by: manalisharmabe
2 Replies

5. Linux

UVFS in Cent OS

Hi, Trying to install Interwoven Teamsite in CentOs 5.4. Found issue in the first step while installing the uvfs . # gmake /usr/bin/gcc -g -O3 -Wall -I. -c -o uvfs_signal.o uvfs_signal.cc gcc: error trying to exec 'cc1plus': execvp: No such file or directory gmake: *** Error 1 # ... (2 Replies)
Discussion started by: rajarshiroy77
2 Replies

6. Shell Programming and Scripting

How to disable Enable/Disable Tab Key

Hi All, I have bash script, so what is sintax script in bash for Enable and Disable Tab Key. Thanks for your help.:( Thanks, Rico (1 Reply)
Discussion started by: carnegiex
1 Replies

7. Red Hat

Installation of Web Logic9.2 on Cent OS5

Hi, Trying to install web logic 9.2 on Cent OS in the Graphical mode. After accepting the license agreement the "Complete" installation is selected.The path for installing the components is mentioned and when clicked on "Next" it hangs and is not proceeding further. Any suggestion or... (0 Replies)
Discussion started by: rajp_8007
0 Replies

8. Linux

how to make a Cent OS package.

I am using Cent OS 5.1. It has a command "yum" to install or update new packeges from a mirror or repository. i am doing installation and configuration of Sun directory server and opensso. i have made a shell script to install and configure both. but now the need is to create a Cent OS packege,... (1 Reply)
Discussion started by: toanilsharma1
1 Replies

9. Shell Programming and Scripting

Chek if a file exists in Ubuntu and Cent OS using shell script

I have tried few examples in the internet but all of them are different and none worked. I need to check if a file exists in a directory if it does not then exit . here is what I have for now $filename ="/usr/local/net/var/lib/directoryservice/sync.disable" if ; then echo "The file exists"... (2 Replies)
Discussion started by: m_kk
2 Replies
Login or Register to Ask a Question