Remember -linux system forget the root password

 centOS:

  1, the boot process press the up and down arrow keys, let the system do not enter into the boot program,

  2, according to 'e' into the edit mode
  3, find the first line linux16 started, adding 'rw init = / bin / sh ' at the end (appears phenomenon Change password no effect) or 'rw init = sysroot / bin / sh '

  

 

  4, according to ctrl + x vectored:

 

  5, first enter chroot / sysroot, then enter the passwd then enter the new password (twice)

  

 

   6, input touch /.autorelabel update information system

  

  7, ctrl + d or exit, and then reboot reboot

  

 

Ubuntu:

  1. Turn on the computer program prior to entering the guide long press 'shift' or press 'esc' (with this feeling bad)

   

  2, select 'Advanced options for Ubuntu' (Ubuntu advanced options), Enter

  

   3, select 'recovery mode', by 'e', ​​found

  

 

  4, modified as follows:

  

  5, pressing the ctrl + x into bootstrap

  

  6, type passwd:

  

  7. Enter a new password

  8, restart the computer

 

 

 

 

  

 

  

 

Guess you like

Origin www.cnblogs.com/leonchan/p/10979735.html