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
What is ps command in linux?
Hi everyone i want to learn Devops in Hyderabad can anyone please suggest me best institute.
Who linux commands?
How do I find the umask value in linux?
What is $$ in shell script?
Which daemon is used for scheduling of the commands?
How do I permanently delete linux history?
What does in makefile do?
What is command example?
What is bash linux?
How to hide the partition in grub booting?
What is command grouping and how does it work?
Which is the required command for checking the file system?
What is the difference between command ‘ping’ and ‘ping6’?
What is devops model?