Difference between revisions of "Protect Shutdown Reboot all Users on Bash"

From wiki.linuxonlinehelp.eu
Jump to navigation Jump to search
 
(No difference)

Latest revision as of 01:02, 26 March 2011

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