Process to give a root password

Assume I lost a root password and i require to give it, I tried to alter it through single user mode even though i am not obtain a password, then what is the other process to give a root password?

E

Expert

Verified

Login to single user mode and attempt below things:

A. passswd [ Change Password for root ]
B. rm -rf /etc/nologin
C. remove any "nologin" shell for root user into /etc/passwd file
D. chage -l root then chage -E root
E. passwd -u root
F. chattr -i /etc/passwd /etc/shadow
G. chmod 600 /etc/securetty
H. vim /etc/rc.local --> then eliminate any line like say "
    /etc/nplogin "
I.       chsh root [ /bin/bash ]

 

   Related Questions in Science

©TutorsGlobe All rights reserved 2022-2023.