Centos 7 Root Password Reset

In Centos 7 the days of editing the "kernel" line and adding "single" are gone.  On top of that sometimes after a new install passwords do not work, maybe you forgot your password or for some other reason you need to break in or fix your system?  It could also be because you can't mount your root / or some other /etc/fstab error and many other errors.

Short Version:

1. Edit your grub settings and find the linux16 /vmlinuz and then the "ro" portion.

2. Replace "ro" with "rw init=/sysroot/bin/sh" and boot.

3. Type chroot /sysroot to enter your OS environment to fix/change things.

Long Version:

  1. 1.) On bootup edit the bootline by entering GRUB.
  2. Type e
  3. Find the line that says "linux16 /vmlinuz"
  4. Edit the part that says "ro" and change with "rw init=/sysroot/bin/sh"
  5. Hit "Ctrl-X"
  6. Upon bootup type "chroot /sysroot"
  7. password
  8. touch ./autorelabel
  9. exit
  10. reboot



centos, password, resetin, editing, quot, kernel, adding, install, passwords, requirements, installer, bootup, edit, bootline, grub, linux, vmlinuz, ro, rw, init, sysroot, bin, sh, ctrl, chroot, autorelabel, reboot,

Latest Articles

  • ssh how to verify your host key / avoid MIM attacks
  • ls how to list ONLY directories
  • How to encrypt your SSH private key file id_rsa
  • Cisco Unified Communications Manager / CUCM IP 8.6,10,12 Install Error Solution
  • Cisco Unified Communications Manager 12 Install Errors on Proxmox/KVM
  • Local Vs Universally Administered MAC Address NIC Refuses to come up
  • Cisco Unified Communications Manager / CUCM IP Telephony Definitions
  • tftp Linux xinetd verbose logging
  • Linux delete unused tap devices automatically