人有错手,马有失蹄:
可惜rm自带的-i参数效果不太好,要是把-f放在了-i后面,什么提示都没了……
为了防止在各位身上再次出现类似的杯具,特意弄了个叫Security Remove的东西。
Download Link: http://soft.yzs.me/securityremove
此文件的内容很简单,很简单,只有数行。
使用方法,执行以下数行代码即可:
1 2 3 4 |
wget http://soft.yzs.me/securityremove -O /bin/securityremove && chmod 755 /bin/securityremove test -f /etc/bash.bashrc && sed -i "/securityremove/d" /etc/bash.bashrc && echo 'alias rm="/bin/securityremove"' >> /etc/bash.bashrc && . /etc/bash.bashrc test -f /etc/bashrc && sed -i "/securityremove/d" /etc/bashrc && echo 'alias rm="/bin/securityremove"' >> /etc/bashrc && . /etc/bashrc test -f /root/.bashrc && sed -i "/alias rm/d" /root/.bashrc && echo 'alias rm="/bin/securityremove"' >> /root/.bashrc && . /root/.bashrc |
效果如图所示:
NOTE: 本文的方法仅适用于Login Shell为bash的用户。
Comments are closed.