How to prevent command from deleted


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to prevent command from deleted
# 1  
Old 08-04-2012
How to prevent command from deleted

Hi,

I've been searching around for solution, hope that some gurus here can help.

I'm using some commands in my shell script and I'd like to protect these command to be moved to another directory. For instance, cp currently in /bin/cp. If I move it to /bin/cpxxx, my script will not be able to work as it give "command not found error" . How can I prevent it from happening?
# 2  
Old 08-04-2012
Only root should be able to move things around in there, and root should be smart enough not to break his/her system...
# 3  
Old 08-04-2012
Thank you for the prompt reply.

This is in the event that the system is being hacked into and hence I'd like to the script to be able to send notification once it has been moved. Anyway to protect that?
# 4  
Old 08-05-2012
Hi Gklntn,

Did you said hacked? - Then it's time to tighten your security. And, first and foremost, change the root password Smilie

However, the best thing I would suggest to implement "auditd - The Linux Audit daemon".

Let us know if it helps or else you need some more assistance on this.

Br,
VB
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Answers to Frequently Asked Questions

How to prevent sed command removing whole line?

hello, I'm using sed command to extract the text between 2 special characters which are /* and */ I used following command to do this. sed -n '/\/\*/,/\*\//p' file.txt But if the file.txt contains a line something like this, a=5; /* this is a comment */ the above command... (3 Replies)
Discussion started by: beginner_99
3 Replies

2. OS X (Apple)

Does there exist a UNIX command to prevent docs' versions from uncontrolled erasing on logging in?

So far nobody on ASC, nor anywhere was able to respond to my issue and Google wasn't much of help either. I started to experience the issue some time ago: my OS is Lion 10.7.5. It occurs in all apps that have the function of versioning (iWork which I have updated up to v9.2, namely, Pages 4.2,... (0 Replies)
Discussion started by: scrutinizerix
0 Replies

3. UNIX for Advanced & Expert Users

Recover Deleted Folder using rm command

Hi All, I accidentally deleted a important folder using rm command. Can i recover that folder. I don't have any backup mechanism. Please suggest.... its very urgant..Plz (1 Reply)
Discussion started by: vijay.gandra
1 Replies

4. UNIX for Dummies Questions & Answers

Prevent terminal from closing after command execution

Hello, I want to create application which launches some terminal, then some command is executed on that terminal and then prevent terminal from closing. I started to do on gnome-terminal because the Gnome is the most widely used desktop-manager in the Linux distributions. I want to do... (3 Replies)
Discussion started by: tyanata
3 Replies

5. UNIX for Dummies Questions & Answers

rm command-outputting files as they are deleted?

Solaris 10/Korn Hi unix experts!, Is it possible to output the actual file names to a file as they are being deleted via the rm command? Context: Im executing the shell script at the command line and directing the output to an output file eg purgescript.ksh > output.lst within the... (3 Replies)
Discussion started by: satnamx
3 Replies

6. Cybersecurity

prevent user from excute command

Dears I want to prevent users from doing spesific command "history -c" or "history" in general How can I do ? (4 Replies)
Discussion started by: reaky
4 Replies

7. Linux

how to get passwd command again if it is deleted by usin rm command

hai friends i have deleted passwd command using rm command i thought it will come again at the time of rebooting but it is completely deleted how to get it worked again (5 Replies)
Discussion started by: venkata.ganesh
5 Replies

8. UNIX for Advanced & Expert Users

How to prevent grep command from throwing a system trap if No match is found.

Hi How to prevent grep command from throwing a system trap(or returning error status) if No match is found in the specified file(s) ? Consider this simple shell script: #!/usr/bin/ksh trap 'STATUS=$?;set +x;echo;echo error $STATUS at line nb $LINENO executing :\ `sed -n... (2 Replies)
Discussion started by: cool.aquarian
2 Replies

9. Shell Programming and Scripting

How to deleted a string using tr- command

I have a file like below 4 0 /work/ram/jagan/irt_XXrules.dat 4 0 /work/ram/jagan/irt_NNrules.dat 4 0 /work/ram/jagan/irt_MMrules.dat 4 0 /work/ram/jagan/irt_ZZrules.dat My output should be 4 0 XXrules 4 0 NNrules 4 0 MMrules 4 0 ZZrules (3 Replies)
Discussion started by: suresh3566
3 Replies

10. Shell Programming and Scripting

Is there a way to recover files deleted using rm command???

Hi All, I just mistakingly deleted some files using rm command.Is there a way to get it back?i work on Solaris 10 Thanks, Kumar (1 Reply)
Discussion started by: kumarsaravana_s
1 Replies
Login or Register to Ask a Question