Its mandatory to setup password for root account in Linux. Sometimes, we don't remember passowrd and somehow lose. There are the procedures for breaking it or you can say reset this to new one.
Below is the step by step process for achieving the target :
Below is the step by step process for achieving the target :
- Boot up your Fedora system, during bootsplash/bootscreen press arrow keys which will show you grub boot screen as below:
- Press "e" to enter into edit mode as below:
- After this scroll down to line starting with "linux16" and add "rw init=/bin/bash" at the end of line. Now what these parameter do is :
- rw : With this option kernel will mount the root File System in Read-Write mode.
- init=/bin/bash : In Linux/Unix based systems init is the first process which gets started during booting. Here we are asking to start bash shell instead of normal system initialization scripts.
- Now boot System using "Ctrl-x" as mentioned in screen as well and it will take you to bash shell with root file system mounted in read-write mode.
- Create .autorelabel file in root(/) file system to relabel SeLinux Policy as changing password will change the other files as well e.g. shadow. Another thing you need to reboot server forcefully otherwise it will not be able to communicate with init daemon for reboot. SO, make sure to use "-f" switch during reboot. If reboot doesn't work, then try with "exec /sbin/init" command. Finally reboot the server and test your new password.
Enjoy!!