Hi students,
As now a days you are using RHEL6 and i want to let you that RHEL6 is totally different from RHEL5 in terms of boot process and also in service handling and some others.But today i want to let you how to repair the corrupted .bashrc of root user or /etc/bashrc which is actually the global file for every user.Actually what every Rhel5 linux admin think when we have corrupted bashrc file and we cant login to my root account from runlevel 3 or runlevel 5 because may be somebody put some nasty commands like init 6 in my root bashrc file or in /etc/bashrc file so now what a rhel5 admin do ,he reboot the machine and move to the single user mode .But I want to tell you one thing that in RHEL6 in single user mode bashrc file works so if your bashrc file is corrupted or having some nasty commands so you cannot even access your single user mode.So now my tips will help you.
Now in RHEL6 you need to move to emergency mode by typing the following commands:-
note:->>>(Actually there is no emergency mode command in RHEL6 like we have in RHEL5 ,in RHEL5 we have to type emergency in grub screen in RHEL-5)
1. Reboot the machine and Press any to stop the boot process at grub screen
2. Now when you are with black/blue grub screen ,press e to edit the grub .
3. Now when you press e to edit the grub ,you have three lines with you ,now move to second line and again press e to edit the second line.
4. Now you need to add init=/bin/bash at the end of the line after a single space.But remember one thing there should not be any space in the above option,it should be init=/bin/bash
5. Ater this press enter and then b to boot the machine .
6. Now after booting you have a single user shell but remember one thing you are workng in emergency mode so you file system is in readonly mode.
7. So now you need to make your filesystem read-write mode by the following command:-
mount -o remount,rw /
8. Now you have read-write permission on your / filesystem,so run the following command to open your bashrc file or /etc/bashrc file.
vim .bashrc
or
vim /etc/bashrc
and remove the nasty or any line which corrupts your bashrc file or for example if somebody puts init 6 in your bashrc file and your system is continously reboots, so now you can remove that option or lines from your bashrc files.
9. After this reboot the pc and enjoy....
As now a days you are using RHEL6 and i want to let you that RHEL6 is totally different from RHEL5 in terms of boot process and also in service handling and some others.But today i want to let you how to repair the corrupted .bashrc of root user or /etc/bashrc which is actually the global file for every user.Actually what every Rhel5 linux admin think when we have corrupted bashrc file and we cant login to my root account from runlevel 3 or runlevel 5 because may be somebody put some nasty commands like init 6 in my root bashrc file or in /etc/bashrc file so now what a rhel5 admin do ,he reboot the machine and move to the single user mode .But I want to tell you one thing that in RHEL6 in single user mode bashrc file works so if your bashrc file is corrupted or having some nasty commands so you cannot even access your single user mode.So now my tips will help you.
Now in RHEL6 you need to move to emergency mode by typing the following commands:-
note:->>>(Actually there is no emergency mode command in RHEL6 like we have in RHEL5 ,in RHEL5 we have to type emergency in grub screen in RHEL-5)
1. Reboot the machine and Press any to stop the boot process at grub screen
2. Now when you are with black/blue grub screen ,press e to edit the grub .
3. Now when you press e to edit the grub ,you have three lines with you ,now move to second line and again press e to edit the second line.
4. Now you need to add init=/bin/bash at the end of the line after a single space.But remember one thing there should not be any space in the above option,it should be init=/bin/bash
5. Ater this press enter and then b to boot the machine .
6. Now after booting you have a single user shell but remember one thing you are workng in emergency mode so you file system is in readonly mode.
7. So now you need to make your filesystem read-write mode by the following command:-
mount -o remount,rw /
8. Now you have read-write permission on your / filesystem,so run the following command to open your bashrc file or /etc/bashrc file.
vim .bashrc
or
vim /etc/bashrc
and remove the nasty or any line which corrupts your bashrc file or for example if somebody puts init 6 in your bashrc file and your system is continously reboots, so now you can remove that option or lines from your bashrc files.
9. After this reboot the pc and enjoy....
Thank you
ReplyDelete