This question already has an answer here:
I deleted the /etc/passwd file and cannot login now. I don't know the root password and tried lots of passwords, but none of them worked.
How can I fix this?
|
This question already has an answer here: I deleted the How can I fix this? |
||||
marked as duplicate by user68186, Eric Carvalho, Pilot6, A.B., karel Jun 22 '15 at 2:27This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
||||
|
This question seems to already have the suitable answers, I will just expand on @Lekensteyn 's comment:
|
||||
|
|
|
Here are the steps to do this graphically:
You can do the same using terminal in a live environment. The steps:
|
|||||||||||||
|
|
If you are can login just open terminal and try this :
Else Boot into recovery mode or from Ubuntu live Cd . Then, mount your old drive:
then reboot. That will set no passwd for root. Then, you can login, create all of your accounts over again, etc. You may also use the back up which is called(i think) Edit:(another method "I don't try that before bu i think it should work also")
|
|||||||||
|
/etc/passwd-or in/var/backups/. – Lekensteyn Jan 27 '14 at 13:38passwd.bakfile under/var/backups/.. simply restore it. :) – AzkerM Jan 27 '14 at 13:46/etc/passwdfile from a backup which he manually made. – Dan Jan 27 '14 at 14:52