This question makes two assumptions:
My root user's interactive shell runs bash
.bashrc
is only called on interactive shells
If I append the generally known fork bomb (:(){ :|: & };:
- do not run this!) to the end of root's .bashrc
file, could this prevent somebody from accessing an interactive root shell when I don't want them to? Obviously not the best solution and something to do more for curiosity. I just want to know what people think of this.
Edit: I know this is in no way useful. I was just curious.
sudo passwd root
. – user323419 Sep 30 '15 at 21:00bash
/ shell scripting is on-topic: meta.askubuntu.com/a/13808/380067; also root is not "disabled", otherwise how would you even be able to runsudo
at all? It has no password set by default, which inhibts e.g. obtaining a root shell usingsu
, but not e.g. obtaining a root shell usingsudo -i
. – kos Sep 30 '15 at 21:07