So say you out init 0 in your bashrc


New Member
Aug 21, 2020
Reaction score
I'm currently in a class, and we are working on linux troubleshooting. On CentOS 6, the only local user is root, all other users are network users. Our most recent bug, is init 0 in root's bashrc. I know that this can be fixed via ssh, however, the instructor said that there are three ways to fix it. I'm curious if anyone else knows of a way to go about fixing this.

It's not a bug it works as intended, this file used to set bash settings and such and it executed when the user logs into the system. Why would you even want to put init 0 in the root bashrc, what's the point? You can't fix this through ssh or through the console because every time you try to login the system is shutdown because init 0 gets executed. The only way to fix this it to boot from the cd into rescue mode, to then undo the line in root bashrc, and then to reboot into a normal running environment again.
There is another way, assuming someone besides root has full sudo privileges.
There is another way, assuming someone besides root has full sudo privileges.
I was going by that the OP said that the only user on the system is root and the only other users available are system users. Agreed with you on that point if there are other normal users on the system available that have full sudo privileges.
Remote fix: You could replace the file by pushing an overwrite the file using secure copy. bashrc shouldn't be invoked since it wouldn't be an interactive shell on the target system.
Local fix: Another would be to change the file from a shell invoked from the bootloader, if available, like in debian or unix systems. This root user is not associated with the OS but can mount the file system and has permissions to make changes files and file system. I have used the second method to recover root without sudo users available on debian and on unix systems without a user with enough permissions to change the root user's password.

Members online