userlimtPlease follow the below steps to disable a specific command(s) for a certain user.

# su – riyesh
$ 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/riyesh/MyPATH.txt >> /home/rieysh/.bashrc

Change the permission of /home/riyesh/.bashrc
# chmod 444 /home/riyesh/.bashrc
# chattr +i /home/riyesh/.bashrc

That’s all.
But the user can reset the PATH variable anytime to overcome this.
Please comment with alternatives for this.