Author Topic: Editing Red Hat Password Files  (Read 1000 times)

Sleeping Dog

  • Member
  • **
  • Posts: 158
  • Kudos: 0
Editing Red Hat Password Files
« on: 27 May 2002, 22:45 »
Can one of you Unix/Linux Gurus help me with this one?
Question:  Using a utility such as LREAD running under DRDOS, is it possible to manually edit the /etc/passwd and-or the /etc/shadow files so that root access is set back to the original post installation default (as if `root' had not set any passwords yet)?  I was given a box with Red Hat 6.0 already on it, but the benefactor could not remember the root password or even the login name.  I have found the login name(s) and encripted passwords in passwd and shadow respectively, but am hesitant to do any manual editing of these files without `professional' advice.

Your kind advice and assistance would be greatly appreciated.

Sleeping Dog

badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
Editing Red Hat Password Files
« Reply #1 on: 27 May 2002, 23:25 »
the password is encrypted ... forget about it and re-install  
If you can't learn to do something well, learn to enjoy doing it poorly.

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
Editing Red Hat Password Files
« Reply #2 on: 28 May 2002, 00:15 »
couldnt he get a decrypter??
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
Editing Red Hat Password Files
« Reply #3 on: 28 May 2002, 00:41 »
no .... he could brute force crack it ... but that can take a while (depending on the password)

edit:

in theory he could decrypt it, however (to the best of my knowledge) the root password is encrypted with the password itself being the key (so the key to decrypt the password doesn't have to be stored somewhere) which kind of defeats the point in this purpose  

in conclusion:

just re-install  

[ May 27, 2002: Message edited by: BadKarma ]

If you can't learn to do something well, learn to enjoy doing it poorly.

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
Editing Red Hat Password Files
« Reply #4 on: 28 May 2002, 01:22 »
[sarcasm] this is just many of the reasons why windows is so much better, i mean in windows when you forget your password you can just click "cancel" and change it in the control panel. and in win NT+ you can just use a password editing disk that is really just a small linux on a disk.... that way i never have to re-install, except of course once a week to clear all the extra spyware registry files and such.[/sarcasm]
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Calum

  • Global Moderator
  • Member
  • ***
  • Posts: 7,812
  • Kudos: 1000
    • Calum Carlyle's music
Editing Red Hat Password Files
« Reply #5 on: 28 May 2002, 01:47 »
yup, reinstall, linux is too secure to crack!  ;)
visit these websites and make yourself happy forever:
It's my music! | My music on MySpace | Integrational Polytheism

Sleeping Dog

  • Member
  • **
  • Posts: 158
  • Kudos: 0
Editing Red Hat Password Files
« Reply #6 on: 28 May 2002, 01:55 »
An Addendum To My Original Question:

Question 1:  If I loaded the same Red Hat OS on another box, then looked at the passwd and shadow for root and wrote it down, could I manually edit those areas of those files on the box that already has encripted access to say the same thing, and get in as if it were a fresh install?

Question 2: If I loaded the same Red Hat OS on another box, then set up root access on that box under username and password that I select, could I copy that root username and the encripted password string to the passwd and shadow files of the other machine and have access?  (Would the encription algorythm decript the encrypted string in the shadow file the same way on both machines?)

Question 3:  Will this approach, or some variation thereof, allow me to reset root username and password on the machine that already has those things set and encrypted?

hoojchoons

  • Member
  • **
  • Posts: 192
  • Kudos: 0
    • http://www.linux.gr
Editing Red Hat Password Files
« Reply #7 on: 28 May 2002, 02:43 »
Theoretically speaking, anything locked could be unlocked. As to your questions, a simple no to all would give you a proper answer. It's a bit funny though because this is the first time I come across such a question.

To sum up, just re-install  ;)

hoojchoons

  • Member
  • **
  • Posts: 192
  • Kudos: 0
    • http://www.linux.gr
Editing Red Hat Password Files
« Reply #8 on: 28 May 2002, 02:51 »
Have a look here

badkarma

  • VIP
  • Member
  • ***
  • Posts: 497
  • Kudos: 0
Editing Red Hat Password Files
« Reply #9 on: 28 May 2002, 03:51 »
that's just evil ... so a boot floppy and some hands on access would give me a root account on any linux box? too bad you still wouldn't know the old pw so you couldn't change it back  ;)
If you can't learn to do something well, learn to enjoy doing it poorly.

hoojchoons

  • Member
  • **
  • Posts: 192
  • Kudos: 0
    • http://www.linux.gr
Editing Red Hat Password Files
« Reply #10 on: 28 May 2002, 04:11 »
That's the point. You don't have to remember your old password to change it. I'll have to give it a try to see if it works though.. We'll see..

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
Editing Red Hat Password Files
« Reply #11 on: 28 May 2002, 06:26 »
Of course it works. No box is secure unless physical access is restricted. For instance, in Solaris all you have to do is boot off of CD, mount the root file system, edit the passwd/shadow file and delete the encrypted password. Or enter single user mode and change the password like in the Linux example. Physical access is the key. Hell, even Cisco routers can be manipulated similarly with physical access. Same with Windows. With physical access this is trivial on any OS. That's the point of having locked server rooms.

[ May 27, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...

Sleeping Dog

  • Member
  • **
  • Posts: 158
  • Kudos: 0
Editing Red Hat Password Files
« Reply #12 on: 28 May 2002, 08:33 »
I posted this question originally because I am a Linux Newbie.....
However, I do take note of patterns.
Just like the permissions in UNIX seem to fall into a "group of three" pattern, so do those wierd groups of characters that an encrypted password has.

I have noticed that if you put in a five character password, there seem to be fifteen characters in the encrypted thing in the "shadow" file.

Have I made an erroneous observation or are there always three times as many characters in that field of the shadow as there are in the real password?

Kindest Regards

Sleeping Dog

Sleeping Dog

  • Member
  • **
  • Posts: 158
  • Kudos: 0
Editing Red Hat Password Files
« Reply #13 on: 28 May 2002, 08:48 »
Another Addendum:

I just saw a thing on the History Channel about how The Brits broke The German Enigma during WWII.  If my stupid observation about each character of a UNIX/Linux password being made up of three character "groups" in the shadow file is correct, would that facilitate cracking the password or is that already known?

Happy MEM Day...

Sleeping Dog

Sleeping Dog

  • Member
  • **
  • Posts: 158
  • Kudos: 0
Editing Red Hat Password Files
« Reply #14 on: 28 May 2002, 11:22 »
Guess I hit a sore spot.  Some say to re-install, some say that I hit the motherload.

Hmmmmm........guess the UNIX Admins out there don't like a newbie like me asking such deep and dark questions.

Now the curiosity is tweaked and the plot thickens....and if you soak chicken parts in cheap lemon juice for 24 hours before they go on the grill, everyone will think that you know how to cook.

Stupididitity has it's rewards if you know when to just be stupid instead of just being a dumbass.  Trouble is...I don't know when to stop being a dumbass.

You guys know this stuff and I do not.  I just want to load up a computer, write letters, do email and maybe a presentation or two.   Occasionally, people send me photos that I want to see, or joke stuff that I want to laugh at.  I don't want to have to get a PHD in OS operation just to chuckle at an email.

However.....I hate Microsoft.....Their shit is presently user friendly.....Linux is not recognized as being so.  How can we change this attitude and this perception?

I don't know......I just struggle on.  Any suggestions?

With Kindest Regards

Sleeping Dog.