Protect Shutdown Reboot all Users on Bash

From wiki.linuxonlinehelp.de
Jump to: navigation, search

To prevent reboot or shutdown over ssh, console or network.

chmod 700 /sbin/reboot chmod 700 /sbin/shutdown

edit .bashrc for ALL users and root, set it to /etc/skel for new users too!

alias reboot='echo Not allowed!'
alias shutdown='echo Not allowed!'
alias init='echo Not allowed!'
alias sh='echo Not allowed!'
alias dash='echo Not allowed!'

then disable other shells for users

chmod 700 /bin/sh
chmod 700 /bin/dash