Thursday, March 07, 2019

Linux root password reset


Mode 1:Recover mode

In recover mode try to remount and after that change password

mount -o remount,rw /
 
Mode 2: Using live

mkdir /mnt/recover
mount /dev/sda2 /mnt/recover
 
chroot /mnt/recover
 
passwd  #or
passwd user 
exit
umount /mnt/recover

Other way : Using files(for root or any user)
 
 /etc/passwd
 /etc/shadow
  
root:x:0:0:root:/root:/bin/bash
to
root::0:0:root:/root:/bin/bash 
 
References:
[1] http://www.microhowto.info/howto/reset_a_forgotten_root_password_using_a_live_distribution.html
[2] https://www.computersecuritystudent.com/UNIX/UBUNTU/1204/lesson5/index.html
 

No comments:

PostgreSQL json fields

select name->'es_PE',* from product_template where name->>'es_PE' like '%MEGACI%'   References: [1] https:/...