You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How To Reset the root Password on Oracle Linux In Rescue Mode

edited Dec 3, 2024 2:28AM in Linux

It is possible to reset the root password systems running Oracle Linux 7 or higher without knowing the current root password by booting the server into rescue mode via systemd.

Boot the server in to rescue mode via systemd using the following procedure, and then use below commands to reset root password:

1) To switch contexts so all the files will be available at their usual locations:

For Oracle Linux 7 do:

# chroot /mnt/sysimage

For Oracle Linux 8 & 9 do:

# chroot /mnt/sysroot

2) To reset the root password for all versions of Oracle Linux, do:

# passwd root

Changing password for user root.

New password: <Enter_new_Password>

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!