Junior — Middle
How can access to the root account on a server be restored if the password is lost?
sobes.tech AI
Answer from AI
If the root password on the server is lost, access can be restored using the following methods (on Linux systems as an example):
- Reboot the server and enter recovery mode or single-user mode.
- In this mode, access to the shell is usually provided without a password prompt.
- Use the
passwdcommand to set a new root password:
passwd root
- Reboot the system normally and log in as root with the new password.
Important: physical or console access to the server is required for this. If the server is in the cloud, there is often an option to reset the password through the provider's control panel.