Disable a command


 
Thread Tools Search this Thread
Operating Systems AIX Disable a command
# 1  
Old 06-10-2014
Disable a command

I need to disable a command. For example - disabling "ls" means that when someone type "ls" - nothing happens .

Somebody help ???? SmilieSmilieSmilie
# 2  
Old 06-10-2014
For which all users do you need to disable it? For all the users or just some specific user?

If it is for all the users you can always move the executable to some other place or just rename it.
# 3  
Old 06-10-2014
Quote:
Originally Posted by chacko193
For which all users do you need to disable it? For all the users or just some specific user?

If it is for all the users you can always move the executable to some other place or just rename it.
I need to do it for all users. Can you show me more detail, i'm just a newbie SmilieSmilieSmilie
# 4  
Old 06-10-2014
Lets say you want to disable ls. First find where the executable is:
Code:
which ls
/usr/bin/ls

This will give you the actual file name. Now rename it:
Code:
mv /usr/bin/ls /usr/bin/ls_disabled

And if in some point of time you need to enable the command, then rename it to its original name.
This User Gave Thanks to chacko193 For This Post:
# 5  
Old 06-10-2014
Why in the world would you think you "need" to disable ls?

Disabling or removing any system supplied utility may turn your system into an expensive doorstop. This is a VERY bad idea. Your boot scripts may stop working, your system administration scripts may stop working, and your user's scripts will stop working.
This User Gave Thanks to Don Cragun For This Post:
# 6  
Old 06-10-2014
WOW it works. Thank chacko193 (^__^)

---------- Post updated at 01:48 AM ---------- Previous update was at 01:46 AM ----------

Quote:
Originally Posted by Don Cragun
Why in the world would you think you "need" to disable ls?

Disabling or removing any system supplied utility may turn your system into an expensive doorstop. This is a VERY bad idea. Your boot scripts may stop working, your system administration scripts may stop working, and your user's scripts will stop working.
Just an example. I need to disable some commands for security reason.
# 7  
Old 06-10-2014
By all means, why is ls a security issue?
I'd rather deny access to folders conent (by user/group permissions), rather than disable ls alltogether...

See: chmod / chown / usermod
And depending on your OS, maybe (pam-)selinux

Hope this helps
This User Gave Thanks to sea For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Not able to disable finger & telnet command in Solaris 8

Hi I need to disable finger & telnet command in solaris 8 I have put the # infront of finger and telnet line in /etc/inetd.conf file. Further I have run the below command kill -1 <process id of inetd > But when I am running finger command it is till giving information for remote machine... (8 Replies)
Discussion started by: amity
8 Replies

2. OS X (Apple)

Disable / mute microphone from command line

Googling suggested "osascript -e 'set volume 0' " but that doesn't work. I know I'd found this before... some command-line utility that had something to do with audio, mixers, whatever, but I forgot to keep it somewhere I could find it. I did find references to writing an AppleScript app, but... (3 Replies)
Discussion started by: jnojr
3 Replies

3. 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

4. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies

5. Shell Programming and Scripting

Need to disable options from a command

Hi, I am working on a Linux machine. I need to disable 2 options from the available 6 options of a command. For eg. in the "ls" command we have various options like "l ,r, t, a, .... " From this, I need to disable option "a" So when the users type in "ls -a", they should get an error or... (4 Replies)
Discussion started by: aster007
4 Replies

6. Shell Programming and Scripting

How to disable backslash in command line

Dear I have one problem in SCO Unix command line. I want to disable execution of commands with backslash. For example - if the user executes the following command \exec_script Here - i want the system should NOT execute this command. Can any one give me a suitable... (8 Replies)
Discussion started by: subbu62
8 Replies

7. UNIX for Dummies Questions & Answers

how to disable su command without the "-"

hello all i need to disable the su without "-" with another meaning i need to force executing of the .profile when using su command any ideas ??? (4 Replies)
Discussion started by: islam.said
4 Replies

8. 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

9. Solaris

OBP command to enable/disable a processor

Hello experts.. How can i enable or disable a processor from OBP(OK prompt)? Thanks in advance... (8 Replies)
Discussion started by: younus_syed
8 Replies

10. UNIX for Advanced & Expert Users

Disable the `rm -f ` command

I wish to learn how to use the alias command in .cshrc I need to change some Unix commands, like : change "rm -f " into "rm -i " or to write small scripts using alias. (7 Replies)
Discussion started by: kamil
7 Replies
Login or Register to Ask a Question