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


Please Help Members By Posting Answers For Below Questions

Which command is used to review boot messages?

561


Who whoami linux?

557


How do I run bash on windows?

508


Find command can search for files by

547


What is the root directory linux?

504






What is filter command in unix?

547


Write a command that will look for files with an extension "c", and has the occurrence of the string "apple" in it.

1173


What could possibly be the problem when a command that was issued gave a different result from the last time it was used?

537


If we transfer 100 files by ftp to remote server, how to know the files are successfully transfer or some file are not transferred?

546


Explain the ‘ls’ command in linux

557


What does grep grep do?

519


How find ip address linux?

555


What is lsof command in linux?

586


What does curl command do in linux?

489


How do you save a file in linux?

569