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:55] 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 | + | * Replace |
| + | linux16 / | ||
| + | rw rd.lvm.lv=centos/ | ||
| + | craskkernel=auto | ||
| + | </ | ||
| + | * Now press '' | ||
| - | now press '' | + | <note tip> you could remove |
| + | |||
| - | the system boots and presents you with a prompt: '' | + | The system boots and presents you with a prompt: '' |
| - | We need to chroot to the filesystem on which the /etc/shadow file is present, do so by: '' | + | * Do so by: '' |
| - | Change the root password '' | + | * Change the root password '' |
| - | now we need to continue the boot proces, do so by exiting the chroot shell '' | + | Now we need to continue the boot proces. |
| - | The boot process continues and you are presented | + | * 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: | 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: | ||
| - | First restore | + | * Log in (with your new password) |
| + | |||
| + | * Restore | ||
| - | Second set SELinux to enforcing again : '' | + | * Set SELinux to enforcing again : '' |
| + | Done. | ||