I lost a root password and i need to give it, I treid to
change it through single usermode even though i am not get
a password, then what is the other procedure to give a root
password?
Answer Posted / kvenkat
Login into single user mode and try below things:
1. passswd [ Change Password for root ]
2. rm -rf /etc/nologin
3. remove any "nologin" shell for root user in /etc/passwd file
4. chage -l root then chage -E root
5. passwd -u root
6. chattr -i /etc/passwd /etc/shadow
7. chmod 600 /etc/securetty
8. vim /etc/rc.local --> then remove any line like say "
/etc/nplogin "
9. chsh root [ /bin/bash ]
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How do I move to root in linux?
How do I search bash history?
How do you create a file?
What is the best cpu stress test?
What are bash scripts used for?
What is finger in networking?
What are the commands in linux?
Which command would you use if you want to remove the password assigned to a group?
What are linux commands useful?
What is ulimit command?
You want to verify which lines in the file kickoff contain ‘bob’. Which of the following commands will accomplish this?
tell me something about linux commands.
Which Command used to lock user password in Linux?
How to recover /etc/passwd file and /etc/shadow file?
How will you suspend a running process and put it in the background?