{"id":710,"date":"2012-07-13T15:44:54","date_gmt":"2012-07-13T07:44:54","guid":{"rendered":"http:\/\/rmohan.com\/?p=710"},"modified":"2012-07-13T15:45:48","modified_gmt":"2012-07-13T07:45:48","slug":"recovery-of-deleted-etcpasswd-file-in-linux","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=710","title":{"rendered":"Recovery of deleted \/etc\/passwd File in Linux"},"content":{"rendered":"<h3>Recovery of deleted \/etc\/passwd File in Linux<\/h3>\n<div id=\"Blog1\">\n<div>\n<div>\n<div>\n<div>\n<div>\n<div id=\"post-body-6686833233908540005\">\n<div dir=\"ltr\">\n<pre>In that case you need to recover \/etc\/passwd file first.\r\nFor this you have to following steps,\r\n\r\n-Start GRUB on boot (press ESC while booting)\r\n-Press e over (recovery mode)\r\n-Press e over the line beginning with kernel\r\n-Press Space bar and enter \"init=\/bin\/bash\"\r\n-Press enter\r\n-Press b\r\n-At command prompt type: \"cp \/etc\/passwd- \/etc\/passwd\"\r\n-reboot to GRUB again\r\n-Press e over (recovery mode)\r\n-Press e over the line beginning with kernel\r\n-Press Space bar and enter \"init=\/bin\/bash\"\r\n-Press enter\r\n-Press b\r\n-At command prompt type \"mount -o remount,rw \/\"\r\n-Type \"passwd YOURUSERNAMEHERE\" (IF you don't know your user \r\nname type \"ls \/home\" (that is a Lower case L and lower case \r\nS) for a list of users)\r\n-Enter new password at prompt\r\n-reboot to normal boot.\r\n\r\nHope that helps others like it did me!\r\n\r\n### Then to recover \/etc\/shadow file, Use following command\r\npwconf\r\n\r\nThis command will generate \/etc\/shadow file from \/etc\/passwd<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Recovery of deleted \/etc\/passwd File in Linux In that case you need to recover \/etc\/passwd file first. For this you have to following steps, -Start GRUB on boot (press ESC while booting) -Press e over (recovery mode) -Press e over the line beginning with kernel -Press Space bar and enter &#8220;init=\/bin\/bash&#8221; -Press enter -Press b [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/710"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=710"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/710\/revisions"}],"predecessor-version":[{"id":712,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/710\/revisions\/712"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}