Monday, April 27, 2020

How to change root password in centos7 or RHEL7


Today, we are going to learn at any case we forgot root password then how to change it. During RHCSA examination they  will provide you a system where root password is needed to change. Its a first step of the examination. Every administrator should know it by default.

Lets, see steps to change root password on centos7 system.

i) Reboot the server by pressing reboot command , when you will see image like below




then press e to edit the file.

ii) write rd.break into the kernel file after UTF-8 as given into image.


iii)Then press ctrl+x to come out from kernel file.

iv)Press mount command you will see that kernel file has only read only permission.




vi) Type chroot /sysroot then press enter.






vii) write passwd command & press enter





you will get prompt for entering new password . Enter password two times.



after entering password you will get below message.




viii)write command touch /.autorelabel







Then type exit then enter. again type exit & enter.








after that automatically server  will turn on. you will get login prompt. you can login by using updated password as shown in below image.










Thanks for reading the above learning & sharing document. If you have any query please feel to contact on mail id as zurangechaitali13@gmail.com 

No comments:

Post a Comment

If you have any doubts. Please let me know.