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

Oracle Linux: How to Reset or Set the Root (or opc) Password in Oracle Linux 7

edited Jul 26, 2023 8:36AM in Linux 2 comments

Applies to:

Oracle Cloud Infrastructure

Linux OS - Version Oracle Linux 7.x

Linux x86-64

 

Goal

This article explains how the root password can be reset on Oracle Linux 7.


Solution

1) While booting GRUB 2 Edit Menu Option (by pressing E)

 Select the line that starts with linux16**** (or linuxefi**** for UEFI BIOS)  and append "rd.break" at 

the end of the line.

Example:

linux16 **** … rd.break

 

2) Press CTRL+X to boot the system


3) Remount the sysroot file system in reading and write mode and then use chroot to get into a 

chroot jail:

$ mount -o remount,rw /sysroot
$ chroot /sysroot

Use the passwd command in the command line and enter the same password twice to reset the root or opc password:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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