Not that i’m newb or anything, but…
Let’s just say i’ve done something terrible:
sudo rm -rf /etc/shadow
Don’t ask!
Obviously only TTY now.
Is there a way out of it?
Not that i’m newb or anything, but…
Let’s just say i’ve done something terrible:
sudo rm -rf /etc/shadow
Don’t ask!
Obviously only TTY now.
Is there a way out of it?
Timeshift or equivalent - or a copy from a similarly setup system, and a chroot from a live boot to copy in from a separate USB stick. Beyond that, my limited experience suggests beginning again!
That’s what i’m thinking too, since no timeshift here - like to play rough on that machine as you can see lol
I have no idea how you could restore encrypted passwords. The rest of the /etc/shadow
file should be easily reconstructible from /etc/passwd
how comes?
hopefully, you have:
ls /etc/shadow-
and can do a cp /etc/shadow- /etc/shadow
Actually i do have it…So shadow- is just a backup?
Just you know…Having some sudo fun
i am not sur ei do never need to do such before, nor someone asking for it
Looking at my /etc/shadow-
, you might be missing some users if you just copy it, but you can reconstruct those from /etc/passwd
(as they don’t have a password).
So, you copy the encrypted passwords from /etc/shadow-
(they are the same as in /etc/shadow
) and restore the rest from /etc/passwd
.
yes now i remember… Rebuild /etc/shadow file from /etc/passwd is the way to go …
Thx guys, that looks promising
Will try later today and let you know how it go
in linux everything is a file
That was surprisingly easy !
Booted from live USB
cp /etc/shadow- /etc/shadow
Able to boot in system and use user / root passwords already!
Just in case done Step #3: Rebuild /etc/shadow file from /etc/passwd
Thx everyone, today we have learned something totally unnecessary and useless, but you never know!
Feelin’ like a human pen-test today
Search & Destory!!
Most probably will be useful to me for I am a destruction lover
I once “sudo rm -rf” ed my / to see some fun
What a classics!
Been there, done that
Just wanted to see…
You know, it’s like in extreme sports they always say - first you learn to fall properly.
Now planning to use a dedicated machine for the fun of ‘Destruction’ .
Do you have any suggestions ?
or
Should I start a topic ?
or
Is there one already ?
I think proper rule for that would be:
That should be fair
Oh and in terms of how exactly to mess things up - your imagination is the limit!
next one play /usr/lib recursive with mplayer:
mplayer -quiet -shuffle -playlist <(find /usr/lib -type f)
mplayer can play raw binary, don’t it?))
P.S. That’s real thing!
I loved in the past to create samples from raw binaries back on Windows with Sound forge…