Dit geeft de verschillen weer tussen de geselecteerde revisie en de huidige revisie van de pagina.
| Beide kanten vorige revisie Vorige revisie Volgende revisie | Vorige revisie | ||
|
werkinstructies:recover_root_password [2016/03/26 14:54] abel |
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 '' | + | * 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 '' | ||
| + | |||
| - | replace '' | + | The system boots and presents you with a prompt: |
| - | now press '' | + | * Do so by: '' |
| - | the system boots and presents you with a prompt: | + | * Change |
| - | We need to chroot to the filesystem on which the /etc/shadow file is present, do so by: '' | + | Now we need to continue |
| - | Change | + | * Do so by exiting |
| - | now we need to continue the boot proces, do so by exiting | + | The boot process continues and you are presented |
| + | However, we forced | ||
| - | The boot process continues and you are presented by the regular login prompt. | + | * Log in (with your new password) |
| - | However, we forced | + | * Restore |
| - | * first restore the SELinux context of the shadow password file: '' | + | * Set SELinux to enforcing again : '' |
| - | * second set SELinux to enforcing again : '' | + | |
| + | Done. | ||