Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.
| Volgende revisie | Vorige revisie | ||
|
werkinstructies:recover_root_password [2016/03/26 14:44] abel aangemaakt |
werkinstructies:recover_root_password [2018/08/30 08:59] (huidige) abel |
||
|---|---|---|---|
| Regel 1: | Regel 1: | ||
| ====== Root password recovery on console of CentOS7 ====== | ====== Root password recovery on console of CentOS7 ====== | ||
| - | there are times you may need to reset the root password which is unknown to you. | + | There are times you may need to reset the root password which is unknown to you. |
| - | This procedure will work fast on systems that have SELinux enabled and large volumes with lots of files which you definitely do not want to relabel as it is timeconsuming | + | This procedure will work fast on systems that have SELinux enabled and large volumes with lots of files which you definitely do not want to relabel as it is timeconsuming |
| - | so, get on to the console, reboot the server and interupt the bootproces by pressing the up arrow button, and you get a list of boot profiles not unlike: | + | * Get on to the console, reboot the server and interupt the bootproces by pressing the up arrow button and you get a list of boot profiles not unlike:< |
| - | < | + | |
| CentOS Linux (3.10.0-327.10.1.el7.x86_64) 7 (Core) | CentOS Linux (3.10.0-327.10.1.el7.x86_64) 7 (Core) | ||
| CentOS Linux (3.10.0-327.3.1.el7.x86_64) 7 (Core) | CentOS Linux (3.10.0-327.3.1.el7.x86_64) 7 (Core) | ||
| Regel 14: | Regel 13: | ||
| </ | </ | ||
| - | from the list of boot profiles chose the last and pres '' | + | * From the list of boot profiles chose the latest, which is at the top, and pres '' |
| + | |||
| + | * Find the line that starts with '' | ||
| + | linux16 / | ||
| + | ro rd.lvm.lv=centos/ | ||
| + | craskkernel=auto | ||
| + | </ | ||
| + | |||
| + | * Replace '' | ||
| + | linux16 / | ||
| + | rw rd.lvm.lv=centos/ | ||
| + | craskkernel=auto | ||
| + | </ | ||
| + | * Now press '' | ||
| + | |||
| + | <note tip> you could remove '' | ||
| + | |||
| + | |||
| + | The system boots and presents you with a prompt: '' | ||
| + | |||
| + | * Do so by: '' | ||
| + | |||
| + | * Change the root password '' | ||
| + | |||
| + | Now we need to continue the boot proces. | ||
| + | |||
| + | * Do so by exiting the chroot shell '' | ||
| + | |||
| + | The boot process continues and you are presented by the regular login prompt.\\ | ||
| + | However, we forced the system to boot in SELinux permissive mode because we needed to alter the shadow password file. We need to correct this: | ||
| + | |||
| + | * Log in (with your new password) | ||
| + | |||
| + | * Restore the SELinux context of the shadow password file: '' | ||
| + | |||
| + | * Set SELinux to enforcing again : '' | ||
| + | |||
| + | Done. | ||
| + | |||
| + | |||
| - | find the line that starts with '' | ||