Reset root password – RHEL7/8 CentOS 7/8

https://images.unsplash.com/photo-1584433144859-1fc3ab64a957?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb

Reboot your Server, at the bootloader screen select the kernel you would like to boot it with (usually the latest one) and hit ‘e’

In the next screen, find the line that refers to the kernel

  • For RHEL/CentOS 7, the line starts with ‘linux16’.
  • For RHEL/Centos 8x, and Fedora the line starts with ‘linux’.

Add ‘rd.break‘ at the end of kernel line and press Ctrl-x

Now the server will boot into OS rescue mode

switch_root:/#.

Now, remount root partition in read/write mode

#mount -o remount rw /sysroot

Next, switch to root directory

#chroot /sysroot

At this point you can change the root password

#passwd <enter>
*<new password>*
*<repeat new password>*

Next step is for SELinux to allow new file changes – such as password reset in our case.

#touch /.autorelabel

This step will take some time to relabel, as it depends on filesystem size

Once complete, Exit Server

#exit

then, Restart server

#reboot

Validate new password has been set on Server after reboot by logging in with root account.

Some Linux Definition

Linux

Linux

Some basic definition which I wanted to remember always, in my early stages, whereas which is very important to understand if someone will like to learn Unix / Linux with basic concepts rather then just a knowing.

  1. Kernel – It is the core of the system. It controls all the tasks, schedules all the process and carries out all the functions of the operating system. It is the code that controls the interface between user programs and hardware devices. Please always remember it is not an operating system.
  2. Shell – It is the command interpreter of the operating system. It accepts commands from the user and analyzes and interprets these commands. Hence shell acts as a middle man between the Kernel and the users of operating system.
  3. Command – It is a instruction given by a user telling a computer to do something, such as to run a program.
  4. Program – It is an executable file usually files that are stored in one of the bin directory.

Have figured out these definitions from numerous areas.  Share more if you feel like to include in the list.

File Types & I/O Rediction

I/O

I/O

I was has having problem in recognizing file types in my studies, therefore to learn I searched and read few documents and found these types under Unix / Linux:-

  • (-) – ASCII/ordinary files
  • (d) – Directories
  • (c) – Character Special Files
  • (b) – Block Special Files
  • (p) – FIFO Files or Pipes

Further everything which carry down with Input Output Redirection over entire Unix / Linux is followed by

  • Standard Input – “0” – Keyboard
  • Standard Output – “1” – Terminal / Display
  • Standard Error – “2” – Terminal / Display

Note:- It will be pleasure if someone would like to contribute more to this post

Some History Points of Unix / Linux

LINUX LINUS TORVALDS

LINUX LINUS TORVALDS

As I entered in the world of open-source by adopting Unix / Linux on my passion list, few basic things which I highlighted in the beginning were written down on a piece of paper. Thought to pool it down for my memories.

Unix / Linux

  • Minix – Unix like operating system before Linux
  • Unix – developed by Bill Labs
  • BSD – Popular distribution from University of California at Barkley
  • Main Purpose – Multitasking system for minicomputers
  • Linux originally developed by Linux Torvalds, began work in 1991 as a student in Finland at University of Helsinki
  • Linux Kernel – Lowest level core component is still maintained by Linus Torvalds
  • March 1994 – Version 1.0 finally was appeared.
  • Text Formatter (TeX) was by Donald Knutn
  • Linux is an inexpensive, efficient and robust system.

Hope you have got the vision of how basically we all started, like I have done. Share your experience for more fun.