Please follow the below steps to disable a specific command(s) for a certain user.
# su - hari
$ which rm (Here rm command as an example)
$ mkdir ~/bin
$ ln -s /bin/* ~/bin/ (/bin is the PATH for rm)
$ rm -rf ~/bin/rm
Take the output of $PATH for this user
$ echo $PATH > MyPATH.txt
Edit this file and replace /bin with ~/bin
Login as root
$ su -
# cat /home/hari/MyPATH.txt >> /home/hari/.bashrc
Change the permission of /home/hari/.bashrc
# chmod 444 /home/hari/.bashrc
# chattr +i /home/hari/.bashrc
That's all.
But the user can reset the PATH variable anytime to overcome this.
Please comment with alternatives for this.
Monday, September 22, 2008
Subscribe to:
Posts (Atom)
AT&T USA | Internet not working | Fix by custom APN
If the AT&T Mobile internet is not working on your cellphone, it can be fixed easily by adding an APN configuration. You can read this a...
-
1. Open Applications -> System -> Configuration Editor from the GUI OR Open a terminal, type gconf-editor 2. Go to "...
-
#!/bin/bash # BASH Script to generate $EXTENSION files like FILE_fr.$EXTENSION,FILE_sp.$EXTENSION from existing FILE_$SEARCHSTRING.$EXTENSIO...
-
#!/bin/bash # Script to create a CSV formatted text with a file of a few lines having one entry per line. # This will merge the files line b...