hacking contest

hacking exploits security forum
hacking
compliance articles
upgrade backup exec
information security consultant

t0bban
Hey. As I'm not all too good with this linux security stuff, I read the book "Linux Server Hacks" by Bob Flickenger. It's great for admins..

Now to the story, I read the book, and learned this:

If you (, a friend, or whatever) misplaced the root password, I'd say no worries.
If you've got consoleaccess and don't mind rebooting, you could try to login with single user mode.
Simplay, after hitting Ctrl+Alt+Del you wait for the POST, then pass the parameter "single" to the booting kernel. I.e. in an LILO promt:

LILO: linux single

On many systems, this will provide you with a root shell. But on some systems (RedHat for instance) you'll run into the emergencypropmpt..

"Give root passwoed for maintenance
(Or type Control-D for normal startup"

If you knew the root pass, you woudln't be here...
If you're lucky, the initscript will let you hit ^C to get you a root prompt.. But most init processes are smarter than that and will tracp the ^C.

Soo, again from the LILO start, you could do:

LILO: linux init=/bin/bash

This will tell the kernel to give you a shell. No passwords, no filesystemchecks and no starting environment... But a very quick new root prompt.

This will be mounted read only though, networking will be down and none of the usual deamons will be running.. Above all, DONT hit ^D or type Exit!
You little shell (and the kernel) constitutes the entire filesystem in this situation..
Now, if it's read-only what do you do?
Try this:

# mount -o remount,rw /

It will force the filesystem to be remounted as read-write wink.gif
You should now be able to type "passwd" to change the actual root password.

When the pass is reset, DO NOT REBOOT!
Since there's ni init running, there'sno process in place to safely taking the system down.
Quickest way to shutdown would be :

#mount -o remount,ro /

Now with the rootpartition readonly, you can confidently hit the Reset button, bring it up in single user mode and begin your actuall work wink.gif

Hope this helps =)
dissolutions
Great Tutorial smile.gif I fixed linuc for you.
t0bban
QUOTE (dissolutions @ Sep 8 2003, 02:25 PM)
Great Tutorial smile.gif I fixed linuc for you.

Thanks.

I'll be more active here in the LInux forums nowforth, cause I'm reading the book "Linux Server Hacks". It got 100 tips in different stuff, mostly adminrelated.

But there' probably some goodies, like this one =)
bri77
agreed. i have the book also. im a noob and its a great read. though only partially through it. recommended.

bri77
scooby
you can always password protect lilo in linuxconf to prevent this.wink.gif
w00dy
QUOTE
you can always password protect lilo in linuxconf to prevent this
smartass tongue.gif
Then all you do is make a new Lilo boot disk on a different computer and bypass that lilo install.... provided you can boot from CD or floppy first, or have BIOS password
Hexboy
Yeah,but you gotta remember its a never ending cycle of getting past one password and putting a new safeguard on tongue.gif Nice lilo tips nonetheless
scooby
QUOTE
provided you can boot from CD or floppy first, or have BIOS password

biggrin.gif biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.

 
Invision Power Board © 2001-2005 Invision Power Services, Inc.