This question already has an answer here:

I was reading about changing root password in CentOS 7. it's totally different from centOS 6.

change root password

I was wondering about the steps for example why should I change ro? what exactly happens in every step?

marked as duplicate by Community Jan 13 at 5:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


ro option means read-only, so changing to rw init=/sysroot/bin/sh in kernel-image will open a shell and now your file-system is mounted with read and write.

Now chroot /sysroot means that /sysroot directory will appear as /. For more info regarding this read this answer https://unix.stackexchange.com/a/413790/255251.

  • The difference is due to the change in init systems between CentOS 6 and 7. – jsbillings Jan 13 at 15:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.