Need to login on to LINUX machine – but don’t have the privilege? – or want to gain root privilege?
Pre Requisite – you need the access physical or command line or console access to reboot the machine.
Follow the steps :-
- The very first screen when you restart the linux machine – press an enter or space whichever works and this will take you to the snapshot of step 2.
- You will get this screen –
Press Enter. You will get the screen in Fig.3
Press e in the end of 2nd line , the one starting with kernel, to enter the edit mode.
- You will get the screen in fig 4, add “s” at the end to login next time in single user mode Type Enter
4. After the step 3 you will get this screen, press b to reboot.
- After the reboot, below is the screen you will get-
Now you can change the password by typing passwd,it won’t ask you this time for the old password.
Now, you have successfully changed the root password.
PS : Remove the “s “, that you have put in there previously by using the same procedure. And next time you reboot you can login as root!!
Any query/help/suggestion/feedback regarding this is welcome. Please feel free 🙂