Resetting a root password in Linux without external media

Configurare noua (How To)

Situatie

We have to follow 8 steps to crack root password without using any external media.

Solutie

Pasi de urmat

Reboot the system and interrupt the boot loader countdown timer by pressing any key except enter.

  • Find the entry that is normally booted, and change it to halt execution during the initial ram disk.
  • Use the cursor keys to highlight the entry that is normally booted and press e
  • Use the cursor to move to the line that has the kernel and kernel arguments. This line normally starts with
  • linux16 or linuxefi.
  • Move the cursor to the end of line by pressing End, and add rd.break.
  • Press Ctrl+x to boot using the modified stanza and you will get a command line interface

Lightbox

On command line Interface you have to write command

# mount -o remount,rw /sysroot

Here we are mounting the system read-write . The file system is mounted under /sysroot.

Change the working root to /sysroot directory.

# chroot /sysroot

Now you can change password

#passwd root

Now make sure that all the unlabeled files(like /etc/shadow) get relabeled during boot so run the command

#touch /.autorelabel

Lightbox

Now by running command exit you can exit from interactive shell.

# exit

Now again run exit command by which you can exit from command line interface and booting process will start again with new root password.

# exit
Lightbox

Tip solutie

Permanent

Voteaza

(7 din 21 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?