禁止root用户无意使用关机命令

cd 
vi .bashrc 
# 在最后添加
alias shutdown='echo '\''Please contact the root'\'''
alias reboot='echo '\''Please contact the root'\'''
alias init='echo '\''Please contact the root'\'''
alias halt='echo '\''Please contact the root'\'''
alias poweroff='echo '\''Please contact the root'\'''

效果如下

posted @ 2021-09-03 16:04  klvchen  阅读(103)  评论(0编辑  收藏  举报