You are not logged in.

#1 2012-12-28 19:59:31

cmorgenstern
Member
Registered: 2012-06-21
Posts: 34

[SOLVED] Accidentally deleted passwd file, no root access

So I did something unthinkably stupid while editing .pacnew and regular files using vimdiff: I accidentally deleted the passwd and the passwd.pacnew file from the /etc directory.

The good news is that I have a backup copy of the file saved on my backup drive from about a week ago when I last backed up, and there are also two passwd backup files still in the /etc directory (passwd- and passwd.OLD).  The bad news is that I no longer have root access nor can I access my backup drive since all the authentication details were in the passwd file.  Is there an easy way to create a new passwd file without root privileges that can be placed into the /etc directory?

Any help would be most appreciated. Thank you!

Last edited by cmorgenstern (2012-12-29 04:57:17)


"Never ascribe to malice that which is adequately explained by incompetence."
~ Napoleon I

Offline

#2 2012-12-28 20:07:18

WorMzy
Forum Moderator
From: England
Registered: 2010-06-16
Posts: 5,059

Re: [SOLVED] Accidentally deleted passwd file, no root access

LiveCD?


Sakura:-
Mobo: ASUS P8Z77-V PRO // Processor: Intel Core i7-3770K 3.4GHz // GFX: nVidia GeForce GTX 970 Ti // RAM: 32GB (4x 8GB) Corsair DDR3 (@ 2133MHz) // Storage: 1x 3TB Seagate SATAII 5x 1TB Samsung SATAII, 2x 120GB Corsair SSD

Offline

#3 2012-12-28 20:07:30

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,350
Website

Re: [SOLVED] Accidentally deleted passwd file, no root access

Chroot.


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#4 2012-12-28 20:28:06

Awebb
Member
Registered: 2010-05-06
Posts: 4,139

Re: [SOLVED] Accidentally deleted passwd file, no root access

WorMzy wrote:

LiveCD?

jasonwryan wrote:

Chroot.

Wiki article :-)

Offline

#5 2012-12-28 20:32:26

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [SOLVED] Accidentally deleted passwd file, no root access

WorMzy wrote:

LiveCD?

jasonwryan wrote:

Chroot.

Awebb wrote:

Wiki article

Mark solved. smile


ᶘ ᵒᴥᵒᶅ

Offline

#6 2012-12-29 03:16:45

cmorgenstern
Member
Registered: 2012-06-21
Posts: 34

Re: [SOLVED] Accidentally deleted passwd file, no root access

Ok, I just restored the file after chrooting into the system using a LiveCD. Thanks! I hoped it would be that straightforward.

Is there anything else I need to do besides restoring the file, or is it safe enough to unmount the temporary file system, exit the live environment, and try booting?


"Never ascribe to malice that which is adequately explained by incompetence."
~ Napoleon I

Offline

#7 2012-12-29 03:17:54

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: [SOLVED] Accidentally deleted passwd file, no root access

Done

Offline

#8 2012-12-29 04:56:13

cmorgenstern
Member
Registered: 2012-06-21
Posts: 34

Re: [SOLVED] Accidentally deleted passwd file, no root access

All fixed, thanks!


"Never ascribe to malice that which is adequately explained by incompetence."
~ Napoleon I

Offline

#9 2012-12-29 08:41:27

Awebb
Member
Registered: 2010-05-06
Posts: 4,139

Re: [SOLVED] Accidentally deleted passwd file, no root access

Efficient Thread!

Offline

Board footer

Powered by FluxBB