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

Explain about document formatting?

596


Hi everyone i want to learn Devops in Hyderabad can anyone please suggest me best institute.

1153


What is the difference between kill and kill in linux?

774


what is the fastest way to enter a series of commands from the command-line in linux

530


Explain trap command; shift command, getopts command of linux?

571






What the command used for list the contents of your home directory, current directory and all subdirectories?

525


You issue the command head * what would the resulting output be?

542


please advice me what i have to prepare for NIC Exam(22-feb- 09). send me the question pattern for the 2 hrs exam. please sent it to manivannan_it15@yahoo.co.in

1905


What are two functions the move mv command can carry out?

606


What are bash scripts used for?

575


Which Command used to lock user password in Linux?

570


What is simple command?

536


What is nbtstat command?

597


What is the use of finger command in linux?

521


What is gnu in linux?

535