Protect Shutdown Reboot all Users on Bash

From wiki.linuxonlinehelp.eu
Revision as of 01:02, 26 March 2011 by Author (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to 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