Posts

Showing posts with the label Password

How To Reset Root Password in CentOS 7

Image
  In the boot grub menu select option to edit (Hit Enter or Shift key to enter Grub menu). Grub Menu select option to edit 2 — Select Option to edit (Press e for edit). Change in line no 16(may vary system to system) replace ro 3 — Go to the line of Linux 16 and change ro with rw init=/sysroot/bin/sh. And more than one tty console available then remove extra tty console exept One. 4 — Now press Control+x to start on single user mode. Go to Single user mode 5 — Now access the system with this command. mount –o remount,rw /sysroot chroot /sysroot 6 — Reset the password. passwd root 7 – Update selinux information touch /.autorelabel 8 — Exit chroot exit 9 — Reboot your system reboot That’s it. Enjoy.

How to set Grub Password in UBUNTU 18.03 (Password protect Boot Loader)

Image
  First, open a terminal from Ubuntu’s applications menu Take backup of two files :  cp /etc/grub.d/40_custom /etc/grub.d/40_custom.old and  cp /boot/grub/menu.lst /boot/grub/menu.lst.bkp Generating a Password Hash :  Just type  grub-mkpasswd-pbkdf2  and press Enter Generating a Password Hash 4.  Setting a Password:  Type  sudo vi /etc/grub.d/40_custom  to open the 40_custom file in the Nano text editor. This is the place where you should put your own custom settings. They may be overwritten by newer versions of Grub if you add them elsewhere. Save password in /etc/grub.d/40_custom scroll down to the bottom of the file and add a password entry in the following format: set superusers=”name” password_pbkdf2 <superusers_name>[long string from earlier] password Entry in /etc/grub.d/40_custom file 5. Open /boot/grub/menu.lst file and follow the below steps a. Generate md5 password :  echo -n <password> | md5sum b. Ope...